]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
mark lxc-clone & lxc-start-ephemeral as deprecated
authorChristian Brauner <christian.brauner@mailbox.org>
Tue, 23 Feb 2016 23:02:49 +0000 (00:02 +0100)
committerChristian Brauner <christian.brauner@mailbox.org>
Wed, 24 Feb 2016 20:07:26 +0000 (21:07 +0100)
- add deprecation not to man pages
- print deprecation info to stderr when the executables are invoked

Signed-off-by: Christian Brauner <christian.brauner@mailbox.org>
doc/lxc-clone.sgml.in
doc/lxc-start-ephemeral.sgml.in
src/lxc/lxc-start-ephemeral.in
src/lxc/lxc_clone.c

index 42c119cdbeba23aa2de01a3fb86bd14f572f4e8e..f134b8000a4deafb12451c0ccb50bc9bd48baf16 100644 (file)
@@ -278,7 +278,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   <refsect1>
     <title>Notes</title>
     <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>
   </refsect1>
 
index 6db4059434fa73a8341697111b7430597cdfc52f..6831578711a0516d15144f22b5f2ebcab26358ee 100644 (file)
@@ -230,7 +230,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
   <refsect1>
     <title>Notes</title>
     <para>
-    <command>lxc-start-ephemeral</command> is superseded by
+    <command>lxc-start-ephemeral</command> is deprecated in favor of
     <command>lxc-copy</command>.
     </para>
   </refsect1>
index 8d33775b8605354f4e1e7b9fb5a8894a5e8ff7bb..7e0c8eaf9bf685db4d22eca0dc3bc153b09f0dee 100644 (file)
@@ -36,8 +36,14 @@ import tempfile
 _ = gettext.gettext
 gettext.textdomain("lxc-start-ephemeral")
 
-
 # Other functions
+
+
+def printstderr(*args):
+    print("lxc-start-ephemeral is deprecated in favor of lxc-copy\n",
+          *args, file=sys.stderr)
+
+
 def randomMAC():
     import random
 
@@ -61,6 +67,9 @@ def get_rundir():
     raise Exception("Unable to find a runtime directory")
 
 
+# Inform that lxc-start-ephemeral is deprecated
+printstderr()
+
 # Begin parsing the command line
 parser = argparse.ArgumentParser(description=_(
                                  "LXC: Start an ephemeral container"),
@@ -120,11 +129,11 @@ parser.add_argument("--version", action="version", version=lxc.version)
 
 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:
     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 args.keep_data:
         args.storage_type = "dir"
index e88c18bc3f79ba3e342f200a7992e970578a2934..6bd2226484f424dadb3ea32bff1075549a9e1858 100644 (file)
@@ -121,6 +121,8 @@ int main(int argc, char *argv[])
        int c;
        bool ret;
 
+       fprintf(stderr, "lxc-clone is deprecated in favor of lxc-copy.\n\n");
+
        if (argc < 3)
                usage(argv[0]);