From e34c0810a80744bcece8b6a4947f70786cdcb005 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Sun, 26 Jul 2009 16:17:36 +0300 Subject: ubi-utils: remove depricated -d option It's already about 2 years since the "-d" option was declared deprecated. UBI utils have printed a warning about this. Now it is time to kill this option completely. The affected utilities are ubimkvol, ubirmvol and ubiupdatevol. Their versions are also increased. Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubimkvol.c | 42 +++++++++--------------------------------- 1 file changed, 9 insertions(+), 33 deletions(-) (limited to 'ubi-utils/src/ubimkvol.c') diff --git a/ubi-utils/src/ubimkvol.c b/ubi-utils/src/ubimkvol.c index b5805a4..c1b577d 100644 --- a/ubi-utils/src/ubimkvol.c +++ b/ubi-utils/src/ubimkvol.c @@ -32,7 +32,7 @@ #include #include "common.h" -#define PROGRAM_VERSION "1.0" +#define PROGRAM_VERSION "1.1" #define PROGRAM_NAME "ubimkvol" /* The variables below are set by command line arguments */ @@ -45,9 +45,6 @@ struct args { const char *name; const char *node; int maxavs; - /* For deprecated -d option handling */ - int devn; - char dev_name[256]; }; static struct args args = { @@ -56,7 +53,6 @@ static struct args args = { .lebs = -1, .alignment = 1, .vol_id = UBI_VOL_NUM_AUTO, - .devn = -1, }; static const char *doc = PROGRAM_NAME " version " PROGRAM_VERSION @@ -74,11 +70,7 @@ static const char *optionsstr = "-m, --maxavsize set volume size to maximum available size\n" "-t, --type= volume type (dynamic, static), default is dynamic\n" "-h, -?, --help print help message\n" -"-V, --version print program version\n\n" -"The following is a compatibility option which is deprecated, do not use it\n" -"-d, --devn= UBI device number - may be used instead of the UBI\n" -" device node name in which case the utility assumes\n" -" that the device node is \"/dev/ubi\""; +"-V, --version print program version"; static const char *usage = @@ -100,8 +92,6 @@ static const struct option long_options[] = { { .name = "help", .has_arg = 0, .flag = NULL, .val = 'h' }, { .name = "version", .has_arg = 0, .flag = NULL, .val = 'V' }, { .name = "maxavsize", .has_arg = 0, .flag = NULL, .val = 'm' }, - /* Deprecated -d option */ - { .name = "devn", .has_arg = 1, .flag = NULL, .val = 'd' }, { NULL, 0, NULL, 0}, }; @@ -133,7 +123,7 @@ static int parse_opt(int argc, char * const argv[]) int key; char *endp; - key = getopt_long(argc, argv, "a:n:N:s:S:t:h?Vmd:", long_options, NULL); + key = getopt_long(argc, argv, "a:n:N:s:S:t:h?Vm", long_options, NULL); if (key == -1) break; @@ -171,14 +161,6 @@ static int parse_opt(int argc, char * const argv[]) return errmsg("bad volume ID: " "\"%s\"", optarg); break; - case 'd': - /* Handle deprecated -d option */ - warnmsg("-d is depricated and will be removed, do not use it"); - args.devn = strtoul(optarg, &endp, 0); - if (*endp != '\0' || endp == optarg || args.devn < 0) - return errmsg("bad UBI device number: " "\"%s\"", optarg); - break; - case 'N': args.name = optarg; break; @@ -207,18 +189,12 @@ static int parse_opt(int argc, char * const argv[]) } } - /* Handle deprecated -d option */ - if (args.devn != -1) { - sprintf(args.dev_name, "/dev/ubi%d", args.devn); - args.node = args.dev_name; - } else { - if (optind == argc) - return errmsg("UBI device name was not specified (use -h for help)"); - else if (optind != argc - 1) - return errmsg("more then one UBI device specified (use -h for help)"); - - args.node = argv[optind]; - } + if (optind == argc) + return errmsg("UBI device name was not specified (use -h for help)"); + else if (optind != argc - 1) + return errmsg("more then one UBI device specified (use -h for help)"); + + args.node = argv[optind]; if (param_sanity_check()) return -1; -- cgit v1.2.3