Commit 4f97fce4 by Stéphane Graber

Merge pull request #844 from brauner/2016-02-22/manpage_update

configure.ac: add --enable-deprecated flag
parents 55290b83 d0a6bd39
...@@ -98,6 +98,6 @@ _have lxc-start && { ...@@ -98,6 +98,6 @@ _have lxc-start && {
complete -o default -F _lxc_generic_t lxc-create 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 complete -o default -F _lxc_generic_o lxc-start-ephemeral
} }
...@@ -147,6 +147,13 @@ if test "x$with_systemdsystemunitdir" != "xno"; then ...@@ -147,6 +147,13 @@ if test "x$with_systemdsystemunitdir" != "xno"; then
AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir]) AC_SUBST([SYSTEMD_UNIT_DIR], [$with_systemdsystemunitdir])
fi 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 # Allow disabling rpath
AC_ARG_ENABLE([rpath], AC_ARG_ENABLE([rpath],
[AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])], [AC_HELP_STRING([--enable-rpath], [set rpath in executables [default=no]])],
......
...@@ -21,7 +21,6 @@ man_MANS = \ ...@@ -21,7 +21,6 @@ man_MANS = \
lxc-cgroup.1 \ lxc-cgroup.1 \
lxc-checkconfig.1 \ lxc-checkconfig.1 \
lxc-checkpoint.1 \ lxc-checkpoint.1 \
lxc-clone.1 \
lxc-config.1 \ lxc-config.1 \
lxc-console.1 \ lxc-console.1 \
lxc-copy.1 \ lxc-copy.1 \
...@@ -50,9 +49,12 @@ man_MANS = \ ...@@ -50,9 +49,12 @@ man_MANS = \
\ \
lxc.7 lxc.7
if ENABLE_DEPRECATED
man_MANS += lxc-clone.1
if ENABLE_PYTHON if ENABLE_PYTHON
man_MANS += lxc-start-ephemeral.1 man_MANS += lxc-start-ephemeral.1
endif endif
endif
%.1 : %.sgml %.1 : %.sgml
$(db2xman) $< $(db2xman) $<
......
...@@ -13,7 +13,6 @@ man_MANS = \ ...@@ -13,7 +13,6 @@ man_MANS = \
lxc-cgroup.1 \ lxc-cgroup.1 \
lxc-checkconfig.1 \ lxc-checkconfig.1 \
lxc-checkpoint.1 \ lxc-checkpoint.1 \
lxc-clone.1 \
lxc-config.1 \ lxc-config.1 \
lxc-console.1 \ lxc-console.1 \
lxc-copy.1 \ lxc-copy.1 \
...@@ -42,9 +41,12 @@ man_MANS = \ ...@@ -42,9 +41,12 @@ man_MANS = \
\ \
lxc.7 lxc.7
if ENABLE_DEPRECATED
man_MANS += lxc-clone.1
if ENABLE_PYTHON if ENABLE_PYTHON
man_MANS += lxc-start-ephemeral.1 man_MANS += lxc-start-ephemeral.1
endif endif
endif
%.1 : %.sgml %.1 : %.sgml
$(db2xman) --encoding=UTF-8 $< $(db2xman) --encoding=UTF-8 $<
......
...@@ -13,7 +13,6 @@ man_MANS = \ ...@@ -13,7 +13,6 @@ man_MANS = \
lxc-cgroup.1 \ lxc-cgroup.1 \
lxc-checkconfig.1 \ lxc-checkconfig.1 \
lxc-checkpoint.1 \ lxc-checkpoint.1 \
lxc-clone.1 \
lxc-config.1 \ lxc-config.1 \
lxc-console.1 \ lxc-console.1 \
lxc-copy.1 \ lxc-copy.1 \
...@@ -42,9 +41,12 @@ man_MANS = \ ...@@ -42,9 +41,12 @@ man_MANS = \
\ \
lxc.7 lxc.7
if ENABLE_DEPRECATED
man_MANS += lxc-clone.1
if ENABLE_PYTHON if ENABLE_PYTHON
man_MANS += lxc-start-ephemeral.1 man_MANS += lxc-start-ephemeral.1
endif endif
endif
%.1 : %.sgml %.1 : %.sgml
$(db2xman) --encoding=UTF-8 $< $(db2xman) --encoding=UTF-8 $<
......
...@@ -278,7 +278,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -278,7 +278,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<refsect1> <refsect1>
<title>Notes</title> <title>Notes</title>
<para> <para>
<command>lxc-clone</command> is superseded by <command>lxc-copy</command>. <command>lxc-clone</command> is deprecated in favor of
<command>lxc-copy</command>.
</para> </para>
</refsect1> </refsect1>
......
...@@ -230,7 +230,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -230,7 +230,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<refsect1> <refsect1>
<title>Notes</title> <title>Notes</title>
<para> <para>
<command>lxc-start-ephemeral</command> is superseded by <command>lxc-start-ephemeral</command> is deprecated in favor of
<command>lxc-copy</command>. <command>lxc-copy</command>.
</para> </para>
</refsect1> </refsect1>
......
...@@ -192,16 +192,17 @@ bin_SCRIPTS = lxc-checkconfig ...@@ -192,16 +192,17 @@ bin_SCRIPTS = lxc-checkconfig
EXTRA_DIST = \ EXTRA_DIST = \
lxc-top.lua lxc-top.lua
if ENABLE_DEPRECATED
if ENABLE_PYTHON if ENABLE_PYTHON
bin_SCRIPTS += lxc-start-ephemeral bin_SCRIPTS += lxc-start-ephemeral
endif endif
endif
bin_PROGRAMS = \ bin_PROGRAMS = \
lxc-attach \ lxc-attach \
lxc-autostart \ lxc-autostart \
lxc-cgroup \ lxc-cgroup \
lxc-checkpoint \ lxc-checkpoint \
lxc-clone \
lxc-copy \ lxc-copy \
lxc-config \ lxc-config \
lxc-console \ lxc-console \
...@@ -222,6 +223,10 @@ bin_PROGRAMS = \ ...@@ -222,6 +223,10 @@ bin_PROGRAMS = \
lxc-usernsexec \ lxc-usernsexec \
lxc-wait lxc-wait
if ENABLE_DEPRECATED
bin_PROGRAMS += lxc-clone
endif
sbin_PROGRAMS = init.lxc sbin_PROGRAMS = init.lxc
pkglibexec_PROGRAMS = \ pkglibexec_PROGRAMS = \
lxc-monitord \ lxc-monitord \
...@@ -246,7 +251,6 @@ lxc_info_SOURCES = lxc_info.c ...@@ -246,7 +251,6 @@ lxc_info_SOURCES = lxc_info.c
init_lxc_SOURCES = lxc_init.c init_lxc_SOURCES = lxc_init.c
lxc_monitor_SOURCES = lxc_monitor.c lxc_monitor_SOURCES = lxc_monitor.c
lxc_monitord_SOURCES = lxc_monitord.c lxc_monitord_SOURCES = lxc_monitord.c
lxc_clone_SOURCES = lxc_clone.c
lxc_ls_SOURCES = lxc_ls.c lxc_ls_SOURCES = lxc_ls.c
lxc_copy_SOURCES = lxc_copy.c lxc_copy_SOURCES = lxc_copy.c
lxc_start_SOURCES = lxc_start.c lxc_start_SOURCES = lxc_start.c
...@@ -261,6 +265,10 @@ lxc_usernsexec_SOURCES = lxc_usernsexec.c ...@@ -261,6 +265,10 @@ lxc_usernsexec_SOURCES = lxc_usernsexec.c
lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h lxc_user_nic_SOURCES = lxc_user_nic.c network.c network.h
lxc_checkpoint_SOURCES = lxc_checkpoint.c lxc_checkpoint_SOURCES = lxc_checkpoint.c
if ENABLE_DEPRECATED
lxc_clone_SOURCES = lxc_clone.c
endif
if !HAVE_GETSUBOPT if !HAVE_GETSUBOPT
lxc_copy_SOURCES += ../include/getsubopt.c ../include/getsubopt.h lxc_copy_SOURCES += ../include/getsubopt.c ../include/getsubopt.h
endif endif
......
...@@ -102,7 +102,7 @@ struct lxc_arguments { ...@@ -102,7 +102,7 @@ struct lxc_arguments {
int list; int list;
char *groups; /* also used by lxc-ls */ char *groups; /* also used by lxc-ls */
/* lxc-snapshot and lxc-clone */ /* lxc-snapshot and lxc-copy */
enum task { enum task {
CLONE, CLONE,
DESTROY, DESTROY,
......
...@@ -36,8 +36,14 @@ import tempfile ...@@ -36,8 +36,14 @@ import tempfile
_ = gettext.gettext _ = gettext.gettext
gettext.textdomain("lxc-start-ephemeral") gettext.textdomain("lxc-start-ephemeral")
# Other functions # Other functions
def printstderr(*args):
print("lxc-start-ephemeral is deprecated in favor of lxc-copy\n",
*args, file=sys.stderr)
def randomMAC(): def randomMAC():
import random import random
...@@ -61,6 +67,9 @@ def get_rundir(): ...@@ -61,6 +67,9 @@ def get_rundir():
raise Exception("Unable to find a runtime directory") raise Exception("Unable to find a runtime directory")
# Inform that lxc-start-ephemeral is deprecated
printstderr()
# Begin parsing the command line # Begin parsing the command line
parser = argparse.ArgumentParser(description=_( parser = argparse.ArgumentParser(description=_(
"LXC: Start an ephemeral container"), "LXC: Start an ephemeral container"),
...@@ -120,11 +129,11 @@ parser.add_argument("--version", action="version", version=lxc.version) ...@@ -120,11 +129,11 @@ parser.add_argument("--version", action="version", version=lxc.version)
args = parser.parse_args() args = parser.parse_args()
## Check that -d and CMD aren't used at the same time # Check that -d and CMD aren't used at the same time
if args.command and args.daemon: if args.command and args.daemon:
parser.error(_("You can't use -d and a command at the same time.")) parser.error(_("You can't use -d and a command at the same time."))
## Check that -k isn't used with -s tmpfs # Check that -k isn't used with -s tmpfs
if not args.storage_type: if not args.storage_type:
if args.keep_data: if args.keep_data:
args.storage_type = "dir" args.storage_type = "dir"
......
...@@ -121,6 +121,8 @@ int main(int argc, char *argv[]) ...@@ -121,6 +121,8 @@ int main(int argc, char *argv[])
int c; int c;
bool ret; bool ret;
fprintf(stderr, "lxc-clone is deprecated in favor of lxc-copy.\n\n");
if (argc < 3) if (argc < 3)
usage(argv[0]); usage(argv[0]);
......
...@@ -124,7 +124,7 @@ for f in $s/*.conf; do ...@@ -124,7 +124,7 @@ for f in $s/*.conf; do
echo "Test $testnum starting ($f)" echo "Test $testnum starting ($f)"
lxc-create -t busybox -f $f -n lxctestb lxc-create -t busybox -f $f -n lxctestb
touch $CONTAINER_PATH/x1 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 that # nics did not change
verify_numnics verify_numnics
# verify hwaddr, if any changed # verify hwaddr, if any changed
......
...@@ -52,7 +52,7 @@ cleanup ...@@ -52,7 +52,7 @@ cleanup
trap cleanup EXIT SIGHUP SIGINT SIGTERM trap cleanup EXIT SIGHUP SIGINT SIGTERM
lxc-create -t busybox -n snapdeptest lxc-create -t busybox -n snapdeptest
lxc-clone -s -o snapdeptest -n snapdeptest1 lxc-copy -s -n snapdeptest -N snapdeptest1
fail=0 fail=0
lxc-destroy -n snapdeptest || fail=1 lxc-destroy -n snapdeptest || fail=1
if [ $fail -eq 0 ]; then if [ $fail -eq 0 ]; then
...@@ -61,7 +61,7 @@ if [ $fail -eq 0 ]; then ...@@ -61,7 +61,7 @@ if [ $fail -eq 0 ]; then
fi fi
for i in `seq 2 20`; do for i in `seq 2 20`; do
lxc-clone -s -o snapdeptest -n snapdeptest$i lxc-copy -s -n snapdeptest -N snapdeptest$i
done done
verify_deps 20 verify_deps 20
......
...@@ -134,7 +134,7 @@ run_cmd lxc-info -n c1 ...@@ -134,7 +134,7 @@ run_cmd lxc-info -n c1
run_cmd lxc-attach -n c1 -- /bin/true run_cmd lxc-attach -n c1 -- /bin/true
run_cmd lxc-stop -n c1 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 run_cmd lxc-start -n c2 -d
p1=$(run_cmd lxc-info -n c2 -p -H) p1=$(run_cmd lxc-info -n c2 -p -H)
[ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; } [ "$p1" != "-1" ] || { echo "Failed to start container c2"; false; }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment