]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
configure.ac: add --enable-deprecated flag 844/head
authorChristian Brauner <christian.brauner@mailbox.org>
Wed, 24 Feb 2016 18:28:12 +0000 (19:28 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Wed, 24 Feb 2016 20:07:26 +0000 (21:07 +0100)
- lxc-clone and lxc-start-ephemeral are marked deprecated. We add a
  --enable-deprecated flag to configure.ac allowing us to enable these
  deprecated executables
- update tests to use lxc-copy instead of lxc-clone

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
config/bash/lxc.in
configure.ac
doc/Makefile.am
doc/ja/Makefile.am
doc/ko/Makefile.am
src/lxc/Makefile.am
src/lxc/arguments.h
src/tests/lxc-test-cloneconfig
src/tests/lxc-test-snapdeps
src/tests/lxc-test-unpriv

index 344d5cb2acd87b618a13367ba63d5b833a1e7e03..7dcf3022b2675d19d0b34a2ee7e1b9358e3ec1e7 100644 (file)
@@ -98,6 +98,6 @@ _have lxc-start && {
 
     complete -o default -F _lxc_generic_t lxc-create
 
-    complete -o default -F _lxc_generic_o lxc-clone
+    complete -o default -F _lxc_generic_o lxc-copy
     complete -o default -F _lxc_generic_o lxc-start-ephemeral
 }
index 68d89b27420cae32f03b0cf56d70fb9ff54b1d1e..fd2c569782ea3f4777a4281a5b030eb508a6cc0a 100644 (file)
@@ -147,6 +147,13 @@ if test "x$with_systemdsystemunitdir" != "xno"; then
   AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
 fi
 
+# Allow enabling deprecated executables
+AC_ARG_ENABLE([deprecated],
+       [AC_HELP_STRING([--enable-deprecated],
+       [enable deprecated executables [default=no]])],
+       [], [enable_deprecated=false])
+AM_CONDITIONAL([ENABLE_DEPRECATED], [test "x$enable_deprecated" = "xyes"])
+
 # Allow disabling rpath
 AC_ARG_ENABLE([rpath],
        [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
index c309ef8b1f43a7cb084faaebff7858560d321335..b0f81151761492330fc6fca39ae66368fbafed61 100644 (file)
@@ -21,7 +21,6 @@ man_MANS = \
        lxc-cgroup.1 \
        lxc-checkconfig.1 \
        lxc-checkpoint.1 \
-       lxc-clone.1 \
        lxc-config.1 \
        lxc-console.1 \
        lxc-copy.1 \
@@ -50,9 +49,12 @@ man_MANS = \
        \
        lxc.7
 
+if ENABLE_DEPRECATED
+    man_MANS += lxc-clone.1
 if ENABLE_PYTHON
     man_MANS += lxc-start-ephemeral.1
 endif
+endif
 
 %.1 : %.sgml
        $(db2xman) $<
index 671dcfe41c70bbe4cb1e37d09fea7a764dded547..201094be963096fd8229e5a8059fccfc5a30fb27 100644 (file)
@@ -13,7 +13,6 @@ man_MANS = \
        lxc-cgroup.1 \
        lxc-checkconfig.1 \
        lxc-checkpoint.1 \
-       lxc-clone.1 \
        lxc-config.1 \
        lxc-console.1 \
        lxc-copy.1 \
@@ -42,9 +41,12 @@ man_MANS = \
        \
        lxc.7
 
+if ENABLE_DEPRECATED
+    man_MANS += lxc-clone.1
 if ENABLE_PYTHON
     man_MANS += lxc-start-ephemeral.1
 endif
+endif
 
 %.1 : %.sgml
        $(db2xman) --encoding=UTF-8 $<
index 6d0cf4dc0369b5832e69b550713e37e80eb378ab..b4ae2c57b2564a0e8cde6eddb0d0676c8ce7ba3d 100644 (file)
@@ -13,7 +13,6 @@ man_MANS = \
        lxc-cgroup.1 \
        lxc-checkconfig.1 \
        lxc-checkpoint.1 \
-       lxc-clone.1 \
        lxc-config.1 \
        lxc-console.1 \
        lxc-copy.1 \
@@ -42,9 +41,12 @@ man_MANS = \
        \
        lxc.7
 
+if ENABLE_DEPRECATED
+    man_MANS += lxc-clone.1
 if ENABLE_PYTHON
     man_MANS += lxc-start-ephemeral.1
 endif
+endif
 
 %.1 : %.sgml
        $(db2xman) --encoding=UTF-8 $<
index 85791db69e90c8d931912c3d31c21f8e692dd04b..9f7a29e8343d7e51b8c32f3363c6bee4148c7d1a 100644 (file)
@@ -192,16 +192,17 @@ bin_SCRIPTS = lxc-checkconfig
 EXTRA_DIST = \
        lxc-top.lua
 
+if ENABLE_DEPRECATED
 if ENABLE_PYTHON
 bin_SCRIPTS += lxc-start-ephemeral
 endif
+endif
 
 bin_PROGRAMS = \
        lxc-attach \
        lxc-autostart \
        lxc-cgroup \
        lxc-checkpoint \
-       lxc-clone \
        lxc-copy \
        lxc-config \
        lxc-console \
@@ -222,6 +223,10 @@ bin_PROGRAMS = \
        lxc-usernsexec \
        lxc-wait
 
+if ENABLE_DEPRECATED
+bin_PROGRAMS += lxc-clone
+endif
+
 sbin_PROGRAMS = init.lxc
 pkglibexec_PROGRAMS = \
        lxc-monitord \
@@ -246,7 +251,6 @@ lxc_info_SOURCES = lxc_info.c
 init_lxc_SOURCES = lxc_init.c
 lxc_monitor_SOURCES = lxc_monitor.c
 lxc_monitord_SOURCES = lxc_monitord.c
-lxc_clone_SOURCES = lxc_clone.c
 lxc_ls_SOURCES = lxc_ls.c
 lxc_copy_SOURCES = lxc_copy.c
 lxc_start_SOURCES = lxc_start.c
@@ -261,6 +265,10 @@ lxc_usernsexec_SOURCES = lxc_usernsexec.c
 lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h
 lxc_checkpoint_SOURCES = lxc_checkpoint.c
 
+if ENABLE_DEPRECATED
+lxc_clone_SOURCES = lxc_clone.c
+endif
+
 if !HAVE_GETSUBOPT
 lxc_copy_SOURCES += ../include/getsubopt.c ../include/getsubopt.h
 endif
index 861437ee87332b83fb474b1ec18adb13e87bb615..6bc6fcd5c4421ffba17c41ecf498278f51d54e99 100644 (file)
@@ -102,7 +102,7 @@ struct lxc_arguments {
        int list;
        char *groups; /* also used by lxc-ls */
 
-       /* lxc-snapshot and lxc-clone */
+       /* lxc-snapshot and lxc-copy */
        enum task {
                CLONE,
                DESTROY,
index 0f38369d97b13d8de81d12f5c3538a13e7806bbf..4e51cc48ed46d913ecd1a77f398790116c52b3a4 100755 (executable)
@@ -124,7 +124,7 @@ for f in $s/*.conf; do
        echo "Test $testnum starting ($f)"
        lxc-create -t busybox -f $f -n lxctestb
        touch $CONTAINER_PATH/x1
-       lxc-clone -s -o lxctestb -n lxctestb2
+       lxc-copy -s -n lxctestb -N lxctestb2
        # verify that # nics did not change
        verify_numnics
        # verify hwaddr, if any changed
index 273ecc802aa18e6fad31203c8ea61acb99ff98c8..3f95bbaf76012dc5fccf3c2694d00b7a4f3f2bb1 100644 (file)
@@ -52,7 +52,7 @@ cleanup
 trap cleanup EXIT SIGHUP SIGINT SIGTERM
 
 lxc-create -t busybox -n snapdeptest
-lxc-clone -s -o snapdeptest -n snapdeptest1
+lxc-copy -s -n snapdeptest -N snapdeptest1
 fail=0
 lxc-destroy -n snapdeptest || fail=1
 if [ $fail -eq 0 ]; then
@@ -61,7 +61,7 @@ if [ $fail -eq 0 ]; then
 fi
 
 for i in `seq 2 20`; do
-       lxc-clone -s -o snapdeptest -n snapdeptest$i
+       lxc-copy -s -n snapdeptest -N snapdeptest$i
 done
 
 verify_deps 20
index 93c91a9f4ee9b7ca2b9f4b11f538947a01391513..141f509748d74a90adc1d8d9de99887a8a2d78be 100755 (executable)
@@ -134,7 +134,7 @@ run_cmd lxc-info -n c1
 run_cmd lxc-attach -n c1 -- /bin/true
 
 run_cmd lxc-stop -n c1
-run_cmd lxc-clone -s -o c1 -n c2
+run_cmd lxc-copy -s -n c1 -N c2
 run_cmd lxc-start -n c2 -d
 p1=$(run_cmd lxc-info -n c2 -p -H)
 [ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; }