r1616 - in nALFS/nALFS/trunk/src: . handlers

jamie at linuxfromscratch.org jamie at linuxfromscratch.org
Wed Dec 1 13:06:51 PST 2004


Author: jamie
Date: 2004-12-01 14:06:51 -0700 (Wed, 01 Dec 2004)
New Revision: 1616

Modified:
   nALFS/nALFS/trunk/src/handlers/unpack.c
   nALFS/nALFS/trunk/src/init.c
   nALFS/nALFS/trunk/src/nalfs.c
   nALFS/nALFS/trunk/src/options.h
Log:
Option to disable digest checking from the command line.


Modified: nALFS/nALFS/trunk/src/handlers/unpack.c
===================================================================
--- nALFS/nALFS/trunk/src/handlers/unpack.c	2004-12-01 20:33:23 UTC (rev 1615)
+++ nALFS/nALFS/trunk/src/handlers/unpack.c	2004-12-01 21:06:51 UTC (rev 1616)
@@ -40,8 +40,8 @@
 #include "nprint.h"
 #include "parser.h"
 #include "backend.h"
+#include "options.h"
 
-
 #define El_unpack_archive(el) alloc_trimmed_param_value("archive", el)
 #define El_unpack_destination(el) alloc_trimmed_param_value("destination", el)
 
@@ -191,7 +191,8 @@
 	if (change_current_dir(destination))
 		goto free_all_and_return;
 
-	alloc_element_digest(el, &digest, &digest_type);
+	if (!*opt_disable_digest)
+		alloc_element_digest(el, &digest, &digest_type);
 
 	/* Check if archive exists. */
 	if ((stat(archive, &file_stat))) {

Modified: nALFS/nALFS/trunk/src/init.c
===================================================================
--- nALFS/nALFS/trunk/src/init.c	2004-12-01 20:33:23 UTC (rev 1615)
+++ nALFS/nALFS/trunk/src/init.c	2004-12-01 21:06:51 UTC (rev 1616)
@@ -304,6 +304,7 @@
 	LONG_OPTION_VERSION,
 	LONG_OPTION_HELP,
 	LONG_OPTION_GENERATE_STAMP,
+	LONG_OPTION_DISABLE_DIGEST,
 	LONG_OPTION_RCFILE,
 };
 
@@ -358,6 +359,7 @@
 "    -p, --prune <dirs>            Ignore <dirs> (separated with spaces) when\n"
 "                                  logging files.\n"
 "    -S, --generate-stamp          Toggle stamp mode.\n"
+"    -d, --disable-digest          Disable digest checking\n"
 "    --rcfile <file>               Use <file> as configuration file.\n"
 "    -v, --verbose                 Toggle verbosity (%s).\n"
 "    --version                     Display program's version.\n"
@@ -417,6 +419,8 @@
 	{"help", no_argument, NULL, LONG_OPTION_HELP},
 
 	{"generate-stamp", no_argument, NULL, LONG_OPTION_GENERATE_STAMP},
+	
+	{"disable-digest", no_argument, NULL, LONG_OPTION_DISABLE_DIGEST},	
 
 	{"rcfile", required_argument, NULL, LONG_OPTION_RCFILE},
 
@@ -425,7 +429,7 @@
 	};
 
 
-	while ((i = getopt_long(*argc, *argv, "lPfhisBSL:b:p:v", long_opts, NULL)) != -1) {
+	while ((i = getopt_long(*argc, *argv, "lPfhisBSdL:b:p:v", long_opts, NULL)) != -1) {
 		switch (i) {
 			case LONG_OPTION_DISPLAY_ALFS:
 				Toggle(*opt_display_alfs);
@@ -491,6 +495,11 @@
 				Toggle(*opt_stamp_packages);
 				break;
 
+			case 'd':
+			case LONG_OPTION_DISABLE_DIGEST:
+				Toggle(*opt_disable_digest);
+				break;
+
 			case LONG_OPTION_RCFILE:
 				parse_rc_file(optarg);
 				break;

Modified: nALFS/nALFS/trunk/src/nalfs.c
===================================================================
--- nALFS/nALFS/trunk/src/nalfs.c	2004-12-01 20:33:23 UTC (rev 1615)
+++ nALFS/nALFS/trunk/src/nalfs.c	2004-12-01 21:06:51 UTC (rev 1616)
@@ -1888,6 +1888,17 @@
 }
 #endif
 
+static INLINE void toggle_disable_digest(void)
+{
+	if (*opt_disable_digest) {
+		Nprint("Digest checking now enabled.");
+		*opt_disable_digest = 0;
+	} else {
+		Nprint("Digest checking now disabled.");
+		*opt_disable_digest = 1;
+	}
+}
+
 static INLINE void toggle_system_output(void)
 {
 	if (Backend_exists) {

Modified: nALFS/nALFS/trunk/src/options.h
===================================================================
--- nALFS/nALFS/trunk/src/options.h	2004-12-01 20:33:23 UTC (rev 1615)
+++ nALFS/nALFS/trunk/src/options.h	2004-12-01 21:06:51 UTC (rev 1616)
@@ -58,6 +58,7 @@
 BOOL_OPTION(log_backend, 1, NULL, NULL);
 BOOL_OPTION(stamp_packages, 0, NULL, NULL);
 STRING_OPTION(stamp_directory, "stamps", NULL, NULL);
+BOOL_OPTION(disable_digest, 0, NULL, NULL);
 BOOL_OPTION(display_stage_header, 0, NULL, NULL);
 STRING_OPTION(find_base, "/", NULL, NULL);
 STRING_OPTION(find_prunes, "", NULL, NULL);




More information about the alfs-log mailing list