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>
*/
#define PROGRAM_NAME "jffs2dump"
-#define VERSION "$Revision: 1.10 $"
#include <errno.h>
#include <stdint.h>
#include <getopt.h>
#include <crc32.h>
#include "summary.h"
+#include "common.h"
#define PAD(x) (((x)+3)&~3)
#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
verbose = 1;
break;
case 'V':
- printf("Version " PROGRAM_VERSION "\n");
+ common_print_version();
exit(0);
case 'g':
debug_level = strtol(optarg, &endp, 0);
* Author: Artem Bityutskiy
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "mtdinfo"
#include <stdint.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- printf("%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
* Author: Artem Bityutskiy
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "ubiattach"
#include <stdio.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
* Author: Oliver Lohmann
*/
-#define PROGRAM_VERSION "1.0"
#define PROGRAM_NAME "ubicrc32"
#include <stdio.h>
#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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
* Author: Artem Bityutskiy
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "ubidetach"
#include <stdio.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
*/
#define MAX_CONSECUTIVE_BAD_BLOCKS 4
-#define PROGRAM_VERSION "1.5"
#define PROGRAM_NAME "ubiformat"
#include <sys/stat.h>
.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[] =
break;
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case 'h':
* Frank Haverkamp <haver@vnet.ibm.com>
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "ubimkvol"
#include <stdio.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case 'm':
* Author: Artem Bityutskiy
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "ubinfo"
#include <stdint.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
* Oliver Lohmann
*/
-#define PROGRAM_VERSION "1.2"
#define PROGRAM_NAME "ubinize"
#include <sys/stat.h>
#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 "
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
default:
* Author: Richard Titmuss
*/
-#define PROGRAM_VERSION "1.0"
#define PROGRAM_NAME "ubirename"
#include <stdio.h>
* Frank Haverkamp <haver@vnet.ibm.com>
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "ubirmvol"
#include <stdio.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
* Frank Haverkamp <haver@vnet.ibm.com>
*/
-#define PROGRAM_VERSION "1.1"
#define PROGRAM_NAME "ubirsvol"
#include <stdio.h>
.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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':
* Artem Bityutskiy
*/
-#define PROGRAM_VERSION "1.2"
#define PROGRAM_NAME "ubiupdatevol"
#include <fcntl.h>
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[] =
exit(EXIT_SUCCESS);
case 'V':
- fprintf(stderr, "%s\n", PROGRAM_VERSION);
+ common_print_version();
exit(EXIT_SUCCESS);
case ':':