]> www.infradead.org Git - mtd-utils.git/commitdiff
mtd-utils: switch more utils to unified versioning
authorBrian Norris <computersforpeace@gmail.com>
Mon, 27 Jun 2011 18:27:24 +0000 (11:27 -0700)
committerArtem Bityutskiy <dedekind1@gmail.com>
Wed, 29 Jun 2011 05:42:40 +0000 (08:42 +0300)
More utilities now use the common VERSION system.

For utils that printed a very simple message, we use the new
common_print_version() "function."

Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Acked-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Artem Bityutskiy <dedekind1@gmail.com>
14 files changed:
jffs2dump.c
mkfs.ubifs/mkfs.ubifs.c
ubi-utils/mtdinfo.c
ubi-utils/ubiattach.c
ubi-utils/ubicrc32.c
ubi-utils/ubidetach.c
ubi-utils/ubiformat.c
ubi-utils/ubimkvol.c
ubi-utils/ubinfo.c
ubi-utils/ubinize.c
ubi-utils/ubirename.c
ubi-utils/ubirmvol.c
ubi-utils/ubirsvol.c
ubi-utils/ubiupdatevol.c

index d093afcc9316d2ae144dd0b51542cf3e833f69aa..9e13e989788f07cea34c2e1ed565d35f94163605 100644 (file)
@@ -15,7 +15,6 @@
  */
 
 #define PROGRAM_NAME "jffs2dump"
-#define VERSION "$Revision: 1.10 $"
 
 #include <errno.h>
 #include <stdint.h>
@@ -36,6 +35,7 @@
 #include <getopt.h>
 #include <crc32.h>
 #include "summary.h"
+#include "common.h"
 
 #define PAD(x) (((x)+3)&~3)
 
index c718818954b596ba46533a1aad3d5998048bdc58..733a3bbbd72b3631f9b5f7b1693efc920ce48596 100644 (file)
@@ -26,8 +26,6 @@
 #include <crc32.h>
 #include "common.h"
 
-#define PROGRAM_VERSION "1.5"
-
 /* Size (prime number) of hash table for link counting */
 #define HASH_TABLE_SIZE 10099
 
@@ -606,7 +604,7 @@ static int get_options(int argc, char**argv)
                        verbose = 1;
                        break;
                case 'V':
-                       printf("Version " PROGRAM_VERSION "\n");
+                       common_print_version();
                        exit(0);
                case 'g':
                        debug_level = strtol(optarg, &endp, 0);
index bfd7e6de23e32dc77a5cf1e879487a844ecbb7f1..ab00ce02ba58480f2cd7ec9f16cc55fb3232c1e2 100644 (file)
@@ -21,7 +21,6 @@
  * Author: Artem Bityutskiy
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "mtdinfo"
 
 #include <stdint.h>
@@ -53,7 +52,7 @@ static struct args args = {
        .node = NULL,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                         " - a tool to print MTD information.";
 
 static const char optionsstr[] =
@@ -125,7 +124,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       printf("%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index 4f18e9918da80bf6536d97e3e44f792c677d8dd1..27e7c092087ba3c75d49271c1f84feb75db75ad2 100644 (file)
@@ -21,7 +21,6 @@
  * Author: Artem Bityutskiy
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "ubiattach"
 
 #include <stdio.h>
@@ -53,7 +52,7 @@ static struct args args = {
        .dev = NULL,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                         " - a tool to attach MTD device to UBI.";
 
 static const char optionsstr[] =
@@ -129,7 +128,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index 73ec59537e4e412e29076258eb8812eb14b81daf..0ea255da3db714e23f8a68bef58fb28e74c250d3 100644 (file)
@@ -22,7 +22,6 @@
  * Author: Oliver Lohmann
  */
 
-#define PROGRAM_VERSION "1.0"
 #define PROGRAM_NAME    "ubicrc32"
 
 #include <stdio.h>
@@ -37,7 +36,7 @@
 
 #define BUFSIZE 4096
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                         " - a tool to calculate CRC32 with UBI start value (0xFFFFFFFF)";
 
 static const char optionsstr[] =
@@ -70,7 +69,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index 668f1bd6d60f8880dba17f40a72f1230b48919d4..64b748e81b246ae72dc99af75e95ecc780bc6651 100644 (file)
@@ -21,7 +21,6 @@
  * Author: Artem Bityutskiy
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "ubidetach"
 
 #include <stdio.h>
@@ -50,7 +49,7 @@ static struct args args = {
        .dev = NULL,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
 " - tool to remove UBI devices (detach MTD devices from UBI)";
 
 static const char optionsstr[] =
@@ -113,7 +112,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index c4b944a2ff758af2f897a30baaf3b36425fb13ae..bfa17300d3e7cbcb273f1d0b401d49ef6e04f1c1 100644 (file)
@@ -29,7 +29,6 @@
  */
 #define MAX_CONSECUTIVE_BAD_BLOCKS 4
 
-#define PROGRAM_VERSION "1.5"
 #define PROGRAM_NAME    "ubiformat"
 
 #include <sys/stat.h>
@@ -72,7 +71,7 @@ static struct args args =
        .ubi_ver   = 1,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                " - a tool to format MTD devices and flash UBI images";
 
 static const char optionsstr[] =
@@ -206,7 +205,7 @@ static int parse_opt(int argc, char * const argv[])
                        break;
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case 'h':
index 25065e32d50d888be2bdccc211367ff51e6e2ebd..7c2a2345b8b47b81a3310dacb4f15ba8aab6345d 100644 (file)
@@ -23,7 +23,6 @@
  *          Frank Haverkamp <haver@vnet.ibm.com>
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "ubimkvol"
 
 #include <stdio.h>
@@ -56,7 +55,7 @@ static struct args args = {
        .vol_id = UBI_VOL_NUM_AUTO,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                         " - a tool to create UBI volumes.";
 
 static const char optionsstr[] =
@@ -173,7 +172,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case 'm':
index 8e14e6e7a88626eef76e9fc6df105a9dbe341b33..7aa4aa4ad66a2ab652e9501b729737dee8f49b13 100644 (file)
@@ -21,7 +21,6 @@
  * Author: Artem Bityutskiy
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "ubinfo"
 
 #include <stdint.h>
@@ -51,7 +50,7 @@ static struct args args = {
        .vol_name = NULL,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                         " - a tool to print UBI information.";
 
 static const char optionsstr[] =
@@ -124,7 +123,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index 3085b66e6aa3b2f3719ab69eb2ab3ba018de9666..453494d3acad5902c3f9ff0dab3975f20454e834 100644 (file)
@@ -24,7 +24,6 @@
  *          Oliver Lohmann
  */
 
-#define PROGRAM_VERSION "1.2"
 #define PROGRAM_NAME    "ubinize"
 
 #include <sys/stat.h>
@@ -39,7 +38,7 @@
 #include "common.h"
 #include "ubiutils-common.h"
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
 " - a tool to generate UBI images. An UBI image may contain one or more UBI "
 "volumes which have to be defined in the input configuration ini-file. The "
 "ini file defines all the UBI volumes - their characteristics and the and the "
@@ -234,7 +233,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                default:
index 070e32ed1aa60d11365ce5da0ff70e650ed9d151..288475b37eba9df0dd087f518e560b78ce8fae67 100644 (file)
@@ -21,7 +21,6 @@
  * Author: Richard Titmuss
  */
 
-#define PROGRAM_VERSION "1.0"
 #define PROGRAM_NAME    "ubirename"
 
 #include <stdio.h>
index 5725d90a904c7481d99140dba2eccb9183e8e007..464f05d98dc6fac982c978d9fea7d9d962f3d94a 100644 (file)
@@ -23,7 +23,6 @@
  *          Frank Haverkamp <haver@vnet.ibm.com>
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "ubirmvol"
 
 #include <stdio.h>
@@ -46,7 +45,7 @@ static struct args args = {
        .vol_id = -1,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                                 " - a tool to remove UBI volumes.";
 
 static const char optionsstr[] =
@@ -117,7 +116,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index 65f579c0871efd8e234e685392e02bd2ec343942..c46906085e237df60a0da11cb5c2089a275744a8 100644 (file)
@@ -23,7 +23,6 @@
  *          Frank Haverkamp <haver@vnet.ibm.com>
  */
 
-#define PROGRAM_VERSION "1.1"
 #define PROGRAM_NAME    "ubirsvol"
 
 #include <stdio.h>
@@ -51,7 +50,7 @@ static struct args args = {
        .lebs = -1,
 };
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                                 " - a tool to resize UBI volumes.";
 
 static const char optionsstr[] =
@@ -146,7 +145,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':
index 24f38fef39ee128bc91b9429fc2f16371d7a5864..7fedb3c402c63526c035bb953844298c10b3e278 100644 (file)
@@ -24,7 +24,6 @@
  *          Artem Bityutskiy
  */
 
-#define PROGRAM_VERSION "1.2"
 #define PROGRAM_NAME    "ubiupdatevol"
 
 #include <fcntl.h>
@@ -52,7 +51,7 @@ struct args {
 
 static struct args args;
 
-static const char doc[] = PROGRAM_NAME " version " PROGRAM_VERSION
+static const char doc[] = PROGRAM_NAME " version " VERSION
                         " - a tool to write data to UBI volumes.";
 
 static const char optionsstr[] =
@@ -103,7 +102,7 @@ static int parse_opt(int argc, char * const argv[])
                        exit(EXIT_SUCCESS);
 
                case 'V':
-                       fprintf(stderr, "%s\n", PROGRAM_VERSION);
+                       common_print_version();
                        exit(EXIT_SUCCESS);
 
                case ':':