[med-svn] r7210 - trunk/packages/mgltools/mgltools-external-get-orig-source
Steffen Möller
moeller at alioth.debian.org
Sun Jul 3 01:13:19 UTC 2011
Author: moeller
Date: 2011-07-03 01:13:19 +0000 (Sun, 03 Jul 2011)
New Revision: 7210
Modified:
trunk/packages/mgltools/mgltools-external-get-orig-source/get-orig-source
Log:
Nicer?
Modified: trunk/packages/mgltools/mgltools-external-get-orig-source/get-orig-source
===================================================================
--- trunk/packages/mgltools/mgltools-external-get-orig-source/get-orig-source 2011-07-03 00:36:18 UTC (rev 7209)
+++ trunk/packages/mgltools/mgltools-external-get-orig-source/get-orig-source 2011-07-03 01:13:19 UTC (rev 7210)
@@ -10,8 +10,10 @@
REMOTECVSROOT=:pserver:anonymous at mgl1.scripps.edu:2401/opt/cvs
CVS=/usr/bin/cvs
MGLTOOLSCVS=../../mgltools-cvs
-TARDIR=../tarfiles
+# Expected by svn-buildpackage as 'tarballs'
+TARDIR=../tarballs
+
PREFIX="mgltools-"
if [ "$package" == "AutoDockToolsDIST" ]; then
PREFIX=""
@@ -26,11 +28,11 @@
$CVS -d$REMOTECVSROOT login
fi
-if [ -d $MGLTOOLSCVS ]; then
+if [ -d "$MGLTOOLSCVS" ]; then
echo "I: cvs directory already available"
else
- echo "I: create directory $MGLTOOLSCVS to store new CVS checkout"
- mkdir $MGLTOOLSCVS
+ echo "I: create directory '$MGLTOOLSCVS' to store new CVS checkout"
+ mkdir "$MGLTOOLSCVS"
fi
if [ -d $MGLTOOLSCVS/$package ]; then
@@ -44,7 +46,7 @@
(cd $MGLTOOLSCVS/$package && $CVS -z3 update -d)
else
echo "I: ... now performing checkout"
- (cd $MGLTOOLSCVS && $CVS -z3 -d$REMOTECVSROOT co -r $branch $package)
+ (cd "$MGLTOOLSCVS" && $CVS -z3 -d$REMOTECVSROOT co -r $branch $package)
fi
version=`echo $branch|sed "s/rc-//g"|tr '-' '.'`
@@ -54,25 +56,33 @@
DATE=`cat $MGLTOOLSCVS/build-for-date`
fi
origFilename=${DEBPACKAGE}_${version}${rcversion}+cvs.${DATE}.orig.tar.gz
+origDirname=${DEBPACKAGE}-${version}${rcversion}+cvs.${DATE}
-echo "Filename of origFile: $origFilename"
+echo "I: Filename of origFile: $origFilename"
-cd $MGLTOOLSCVS
-if [ -d $TARDIR ]; then
- echo "directory for tar files already available"
+cd "$MGLTOOLSCVS"
+if [ -d "$TARDIR" ]; then
+ echo "I: directory for orig tarballs already available"
else
- echo "create directory $TARDIR"
- mkdir $TARDIR
+ echo "I: creating directory for irog tarballs: '$TARDIR'"
+ mkdir "$TARDIR"
fi
-if [ -f $TARDIR/$origFilename ]; then
- echo "delete old file $origFilename "
- rm $TARDIR/$origFilename
+if [ -f "$TARDIR"/"$origFilename" ]; then
+ echo "I: delete old file '$origFilename' "
+ rm "$TARDIR"/"$origFilename"
fi
-echo "Temporarily renaming and taring $package "
-echo " --> $TARDIR/$origFilename"
-mv $package $origFilename
-GZIP=-9 tar --exclude CVS -czvf "$TARDIR/$origFilename" $origFilename | wc -l
-mv $origFilename $package
-echo "done"
+if [ -n "$origDirname" -a -d "$origDirname" ]; then
+ echo "W: Amazingly, temporary directory name '$origDirname' is already existing. Stop this script if this shall not be removed -- within 3 seconds."
+ sleep 3
+ rm -r "$origDirname"
+fi
+echo "I: Temporarily renaming and taring $package "
+echo " --> $MGLTOOLSCVS/$TARDIR/$origFilename"
+mv "$package" "$origDirname"
+echo -n "I: Number of files in package: "
+GZIP=-9 tar --exclude CVS -czvf "$TARDIR/$origFilename" "$origDirname" | wc -l
+mv "$origDirname" "$package"
+echo "I: done"
+
More information about the debian-med-commit
mailing list