]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
sfdisk: add deprecated --Linux
authorKarel Zak <kzak@redhat.com>
Thu, 18 Sep 2014 09:56:49 +0000 (11:56 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 7 Oct 2014 12:55:32 +0000 (14:55 +0200)
The sfdisk does not care about compatibility with classic DOS
partitioning, and it does not warn about incompatibility with DOS at
all. It means that --Linux is default and it's unnecessary to use
this option.

It's the same situation like with "--unit S", these options are very
probably often used in scripts, and these all is default now. So for
backward compatibility new sfdisk accepts these options on command
line, but prints "option is deprecated" warning message.

Signed-off-by: Karel Zak <kzak@redhat.com>
Documentation/deprecated.txt
disk-utils/sfdisk.c

index 1757d5cca4cd898a80c08ad3c087da688c194f85..fc31ece5d072d3dea3f9c028573c876b5979a462 100644 (file)
@@ -7,7 +7,12 @@ what:  sfdisk --show-size
 why:   this does not belong to fdisk, use "blockdev --getsz"
 
 --------------------------
-                
+
+what:   sfdisk --Linux
+why:    unnecessary option, only Linux (non-DOS mode) is supported
+
+--------------------------
+
 what:   sfdisk --unit
 why:    unnecessary option, only 'S'ector unit is supported
 
index 32b065d345e1055077a84a97ec376bdaa39b9ebf..dbc1d60f7c03f4064276d4fb6d97662f877c0855 100644 (file)
@@ -916,8 +916,10 @@ static void __attribute__ ((__noreturn__)) usage(FILE *out)
        fputs(USAGE_OPTIONS, out);
        fputs(_(" -N, --partno <num>   specify partition number\n"), out);
        fputs(_(" -X, --label <name>   specify label type (dos, gpt, ...)\n"), out);
-       fputs(_(" -u, --unit S         deprecated, all input and output is in sectors only\n"), out);
        fputs(_(" -q, --quiet          suppress extra info messages\n"), out);
+       fputs(USAGE_SEPARATOR, out);
+       fputs(_(" -u, --unit S         deprecated, only sector unit is supported\n"), out);
+       fputs(_(" -L, --Linux          deprecated and ignored, only for backward copatibility\n"), out);
 
        fputs(USAGE_SEPARATOR, out);
        fputs(USAGE_HELP, out);
@@ -955,7 +957,9 @@ int main(int argc, char *argv[])
                { "quiet",   no_argument,       NULL, 'q' },
                { "verify",  no_argument,       NULL, 'V' },
                { "version", no_argument,       NULL, 'v' },
+
                { "unit",    required_argument, NULL, 'u' },            /* deprecated */
+               { "Linux",   no_argument,       NULL, 'L' },            /* deprecated */
 
                { "type",no_argument,           NULL, 'c' },            /* wanted */
                { "change-id",no_argument,      NULL, OPT_CHANGE_ID },  /* deprecated */
@@ -970,7 +974,7 @@ int main(int argc, char *argv[])
        textdomain(PACKAGE);
        atexit(close_stdout);
 
-       while ((c = getopt_long(argc, argv, "adhglN:qsTu:vVX:",
+       while ((c = getopt_long(argc, argv, "adhglLN:qsTu:vVX:",
                                        longopts, &longidx)) != -1) {
                switch(c) {
                case 'a':
@@ -991,6 +995,9 @@ int main(int argc, char *argv[])
                case 'l':
                        sf->act = ACT_LIST;
                        break;
+               case 'L':
+                       warnx(_("--Linux option is deprecated and unnecessary"));
+                       break;
                case 'd':
                        sf->act = ACT_DUMP;
                        break;