Print

Print


Commit in LCDetectors/detectors on MAIN
make_detector_zip.sh+33-161.3 -> 1.4
update_detector.sh+15-61.1 -> 1.2
+48-22
2 modified files
JM: Update detector build scripts.

LCDetectors/detectors
make_detector_zip.sh 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- make_detector_zip.sh	1 Sep 2006 14:33:52 -0000	1.3
+++ make_detector_zip.sh	5 Sep 2006 18:57:42 -0000	1.4
@@ -18,26 +18,43 @@
 
 d=$1
 
+z=$d.zip
+
 echo "Processing $d ..."
 
-if [ -e "${d}/compact.xml" ]; then
-(
-    if [ -e "${d}.zip" ]; then rm -v ${d}.zip; fi
-    cd $d
-    dd=`basename $d`
-    echo "name: $dd" > detector.properties
-    rm -rf $d
-    for f in `find . -print | grep -v CVS`; do
-	echo "adding $f"
-	zip $d $f
-    done
-)
+if [ -e "$z" ]; then
+    update=$(find $d -newer "$z" | grep -v "CVS")
 else
-  echo "ERROR: $d has no compact.xml file."
+    update=yes
 fi
 
-mv $d/$d.zip .
+if [ ! -z "$update" ]; then
+
+    echo Zip file for $d needs to be updated ...
+
+    if [ -e "${d}/compact.xml" ]; then
+	(
+	    if [ -e "${d}.zip" ]; then
+		rm $z
+	    fi
+
+	    cd $d
+
+	    for f in $(find . -print | grep -v CVS); do
+		zip $d $f &> /dev/null
+	    done
+	)
 
-ls -la $d.zip
+	mv $d/$d.zip .
 
-echo "Done with $d"
+	chmod 775 $d.zip
+
+	zipinfo $d.zip
+
+    else
+	echo "ERROR: $d has no compact.xml file."
+    fi
+
+else
+    echo Detector $d is up to date.
+fi

LCDetectors/detectors
update_detector.sh 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- update_detector.sh	29 Aug 2006 19:31:53 -0000	1.1
+++ update_detector.sh	5 Sep 2006 18:57:42 -0000	1.2
@@ -18,12 +18,21 @@
 
 z=$d.zip
 
-chk_local=$(md5sum $z | awk '{print $1}')
-chk_www=$(md5sum $PRJ_WWW/detectors/$z | awk '{print $1'})
+# Check the date.
+if [ $z -nt $PRJ_WWW/detectors/$z ]; then
+
+    # Check the checksum.
+    chk_local=$(md5sum $z | awk '{print $1}')
+    chk_www=$(md5sum $PRJ_WWW/detectors/$z | awk '{print $1'})
+
+    if [[ $chk_local != $chk_www ]]; then
+	echo Detector $d needs update ...
+	echo Copying $z to $PRJ_WWW/detectors ...
+	cp $z $PRJ_WWW/detectors
+    else
+	echo "$PRJ_WWW/detectors/$z is already up-to-date."
+    fi
 
-if [[ $chk_local != $chk_www ]]; then
-  cp $z $PRJ_WWW/detectors
-  #echo "$d needs update."
 else
-  echo "$PRJ_WWW/detectors/$z is already up-to-date."
+    echo Detector $d is up to date.
 fi
CVSspam 0.2.8