changeset 25:8b9d91963de7

more option passing to metacheck from archivemany via archiver
author casties
date Wed, 05 Oct 2005 15:35:12 +0200
parents 1dd183b95c61
children 24d9dd63ae93
files archivemany.sh archiver.pl
diffstat 2 files changed, 14 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/archivemany.sh	Tue Oct 04 16:36:32 2005 +0200
+++ b/archivemany.sh	Wed Oct 05 15:35:12 2005 +0200
@@ -14,7 +14,9 @@
 
 BASEDIR="$1"
 DIRLIST="$2"
-PARAM="$3"
+PARAM1="$3"
+PARAM2="$4"
+PARAM3="$5"
 CNT="1"
 
 if [ ! -d $BASEDIR ]
@@ -34,7 +36,7 @@
     if [ -d "$BASEDIR/$DIR" ]
     then
 	echo "archiving document $CNT: $DIR..."
-	if /usr/local/mpiwg/archive/archiver "$PARAM" "$BASEDIR/$DIR"
+	if /usr/local/mpiwg/archive/archiver "$PARAM1" "$PARAM2" "$PARAM3" "$BASEDIR/$DIR"
 	then
 	    echo "  done on `date`"
 	else
--- a/archiver.pl	Tue Oct 04 16:36:32 2005 +0200
+++ b/archiver.pl	Wed Oct 05 15:35:12 2005 +0200
@@ -16,7 +16,7 @@
 #
 
 # program version
-my $version = "0.7.1 (ROC 23.9.2005)";
+my $version = "0.7.2 (ROC 5.10.2005)";
 
 # short help
 my $help = "MPIWG archiver $version
@@ -25,6 +25,7 @@
   -debug  show debugging info
   -premigrate  don't delete archived files
   -force  archive even if already archived
+  -replace  rewrite index file
 ";
 
 # read command line parameters
@@ -40,6 +41,9 @@
 # force archiving
 my $force_archive = (exists $$args{'force'}) ? $$args{'force'} : 0;
 
+# rewrite index file
+my $rewrite_index = (exists $$args{'replace'}) ? $$args{'replace'} : 0;
+
 # rewrite XML file (necessary for archive date!)
 my $fix_xml = 1;
 my $xml_changed = 0;
@@ -372,7 +376,11 @@
 }
 
 # use metacheck first
-if (open CHECK, "$checkprog -add-files $docdir |") {
+my $check_opts="-add-files";
+if ($rewrite_index) {
+    $check_opts = "-replace";
+}
+if (open CHECK, "$checkprog $check_opts $docdir |") {
     my @errors;
     my $msg;
     while (<CHECK>) {