Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main-src > by-pkgid > 1c4c24e15663085b2a11540262606a1d > files > 4

dmraid-1.0.0.rc13-9.el5.src.rpm

--- dmraid/1.0.0.rc13.orig/man/dmraid.8	2005-09-20 17:47:10.000000000 +0200
+++ dmraid/1.0.0.rc13/man/dmraid.8	2007-01-26 14:37:16.000000000 +0100
@@ -6,6 +6,7 @@
  {-a|--activate} {y|n|yes|no} 
  [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]
  [-f|--format FORMAT[,FORMAT...]]
+ [{-P|--partchar} CHAR]
  [-p|--no_partitions]
  [--separator SEPARATOR]
  [-t|--test]
@@ -214,7 +220,7 @@
 .br
 do
 .br
-	dd if=$f of=/dev/${f%%_*} \\
+	dd if=$f of=/dev/${f%%.dat} \\
 .br
 	seek=`cat ${f%%dat}offset` bs=1
 .br
--- dmraid/1.0.0.rc14/tools/commands.c	2006-03-21 10:49:28.000000000 +0100
+++ dmraid/1.0.0.rc15/tools/commands.c	2006-11-18 10:29:22.000000000 +0100
@@ -24,7 +24,7 @@
 /*
  * Command line options.
  */
-static char const *short_opts = "a:hip"
+static char const *short_opts = "a:hipP"
 #ifndef	DMRAID_MINI
 				"bc::dDEf:gl"
 #ifdef	DMRAID_NATIVE_LOG
@@ -38,6 +38,7 @@
 static struct option long_opts[] = {
 	{"activate", required_argument, NULL, 'a'},
 	{"format", required_argument, NULL, 'f'},
+	{"partchar", required_argument, NULL, 'P'},
 	{"no_partitions", no_argument, NULL, 'p'},
 # ifndef DMRAID_MINI
 	{"block_devices", no_argument, NULL, 'b'},
@@ -148,6 +149,14 @@
 }
 #endif
 
+/* Check and store option for partition separator. */
+static int check_part_separator(struct lib_context *lc, int arg)
+{
+	/* We're not actually checking that it's only one character... if
+	   somebody wants to use more, it shouldn't hurt anything. */
+	return lc_stralloc_opt(lc, LC_PARTCHAR, optarg) ? 1 : 0;
+}
+
 /* Display help information */
 static int help(struct lib_context *lc, int arg)
 {
@@ -158,6 +167,7 @@
 		  "[Early Boot Version]\n", c);
 	log_print(lc, "%s\t{-a|--activate} {y|n|yes|no} [-i|--ignorelocking]\n"
 		  "\t[-f|--format FORMAT[,FORMAT...]]\n"
+		  "\t[-P|--partchar CHAR]\n"
 		  "\t[-p|--no_partitions]\n"
 		  "\t[--separator SEPARATOR]\n"
 		  "\t[RAID-set...]\n", c);
@@ -168,6 +178,7 @@
 	log_print(lc, "* = [-d|--debug]... [-v|--verbose]... [-i|--ignorelocking]\n");
 	log_print(lc, "%s\t{-a|--activate} {y|n|yes|no} *\n"
 		  "\t[-f|--format FORMAT[,FORMAT...]]\n"
+		  "\t[-P|--partchar CHAR]\n"
 		  "\t[-p|--no_partitions]\n"
 		  "\t[--separator SEPARATOR]\n"
 		  "\t[-t|--test]\n"
@@ -249,6 +260,19 @@
 	  LC_FORMAT,
 	},
 
+	/* Partition separator. */
+	{ 'P',
+	  PARTCHAR,
+	  ACTIVATE|DEACTIVATE,
+	  FORMAT|HELP|IGNORELOCKING|SEPARATOR
+#ifndef DMRAID_MINI
+	  |DBG|TEST|VERBOSE
+#endif
+	  , ARGS,
+	  check_part_separator,
+	  0,
+	},
+
 	/* Partition option. */
 	{ 'p',
 	  NOPARTITIONS,
--- dmraid/1.0.0.rc14/tools/commands.h	2005-09-27 15:39:44.000000000 +0200
+++ dmraid/1.0.0.rc15/tools/commands.h	2006-11-18 10:29:22.000000000 +0100
@@ -46,6 +46,7 @@
 #endif
 	VERSION		= 0x100000,
 	IGNORELOCKING	= 0x200000,
+	PARTCHAR	= 0x400000,
 };
 
 #define	ALL_FLAGS	((enum action) -1)
--- dmraid/1.0.0.rc14/lib/format/partition/dos.c	2006-07-14 17:36:58.000000000 +0200
+++ dmraid/1.0.0.rc15/lib/format/partition/dos.c	2006-11-18 10:31:35.000000000 +0100
@@ -29,8 +29,11 @@
 		    unsigned short partition, char *str, size_t len,
 		    unsigned char type)
 {
-	return snprintf(str, len, type ? "%s%u" : "%s",
-			get_basename(lc, rd->di->path), partition);
+	const char *base = get_basename(lc, rd->di->path);
+
+	return type ? snprintf(str, len, "%s%s%u", base, OPT_STR_PARTCHAR(lc),
+			       partition) :
+		      snprintf(str, len, "%s", base);
 }
 
 static char *name(struct lib_context *lc, struct raid_dev *rd,
--- dmraid/1.0.0.rc13.orig/include/dmraid/lib_context.h	2005-09-21 13:46:53.000000000 +0200
+++ dmraid/1.0.0.rc13/include/dmraid/lib_context.h	2006-11-18 10:29:22.000000000 +0100
@@ -38,7 +38,8 @@
 	LC_VERBOSE,
 	LC_IGNORELOCKING,
 	LC_SEPARATOR,
-	LC_DEVICES,	  /* Add new options below this one ! */
+	LC_DEVICES,
+	LC_PARTCHAR,	  /* Add new options below this one ! */
 	LC_OPTIONS_SIZE,  /* Must be the last enumerator. */
 };
 
@@ -55,12 +56,14 @@
 #define	OPT_SETS(lc)		(lc_opt(lc, LC_SETS))
 #define	OPT_TEST(lc)		(lc_opt(lc, LC_TEST))
 #define	OPT_VERBOSE(lc)		(lc_opt(lc, LC_VERBOSE))
+#define	OPT_PARTCHAR(lc)	(lc_opt(lc, LC_PARTCHAR))
 
 /* Return option value. */
 #define	OPT_STR(lc, o)		(lc->options[o].arg.str)
 #define	OPT_STR_COLUMN(lc)	OPT_STR(lc, LC_COLUMN)
 #define	OPT_STR_FORMAT(lc)	OPT_STR(lc, LC_FORMAT)
 #define	OPT_STR_SEPARATOR(lc)	OPT_STR(lc, LC_SEPARATOR)
+#define	OPT_STR_PARTCHAR(lc)	OPT_STR(lc, LC_PARTCHAR)
 
 struct lib_version {
 	const char *text;