X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=make-dist;h=bffc6922975b3c4e1441588fa6d111b257700b51;hb=4efcc7e9c537b0835dfa3c3cddb6ca6b1b1395e5;hp=6a3ef5e2686cfe5faebfefc5b4d689a3161b9b3d;hpb=43ee5913c70df53978d2964d07c1a5beaaff74b3;p=matthijs%2Fupstream%2Fblosxom-plugins.git diff --git a/make-dist b/make-dist index 6a3ef5e..bffc692 100755 --- a/make-dist +++ b/make-dist @@ -3,39 +3,55 @@ # Quick script to make a flattened tarball (unix) # -die() { - echo $* - exit 1 -} - cd `dirname $0` NAME=blosxom-plugins VERSION=`cat VERSION` -test -d $NAME-$VERSION && rm -rf $NAME-$VERSION -mkdir $NAME-$VERSION - -find * \( -name $NAME-$VERSION -o -name CVS \) -prune -o -type f -exec cp -p {} $NAME-$VERSION \; - -# Prune unwanted files -for i in make-dist README.cvs; do - rm -f $NAME-$VERSION/$i +for SIZE in large medium small; do + TARBALL="$NAME-$SIZE-$VERSION" + test -d $TARBALL && rm -rf $TARBALL + mkdir $TARBALL + + # Small/Medium + if [ -f MANIFEST.$SIZE ]; then + for i in `cat MANIFEST.$SIZE`; do + if [ -f $i ]; then + cp -p $i $TARBALL + elif [ -f $NAME-large-$VERSION/$i ]; then + cp -p $NAME-large-$VERSION/$i $TARBALL + else + echo "Warning: cannot find plugin '$i' (MANIFEST.$SIZE)" + fi + done + + # Large + else + # Copy everything + find * \( -name $TARBALL -o -name CVS \) -prune -o -type f -exec cp -p {} $TARBALL \; + + # Prune unwanted files + for i in make-dist README.cvs blosxom-plugins-medium.spec; do + rm -f $TARBALL/$i + done + fi + + # Create tarball + which tar >/dev/null 2>&1 + if [ $? == 0 ]; then + echo "Creating $TARBALL.tar.gz" + tar -zcf $TARBALL.tar.gz $TARBALL + fi + + # Create zip file + which zip >/dev/null 2>&1 + if [ $? == 0 ]; then + echo "Creating $TARBALL.zip" + zip -q -r $TARBALL.zip $TARBALL + fi done -# Create tarball -which tar >/dev/null 2>&1 -if [ $? == 0 ]; then - echo "Creating $NAME-$VERSION.tar.gz" - tar -zcf $NAME-$VERSION.tar.gz $NAME-$VERSION -fi - -# Create zip file -which zip >/dev/null 2>&1 -if [ $? == 0 ]; then - echo "Creating $NAME-$VERSION.zip" - zip -q -r $NAME-$VERSION.zip $NAME-$VERSION -fi - -test -d $NAME-$VERSION && rm -rf $NAME-$VERSION - +for SIZE in large medium small; do + TARBALL="$NAME-$SIZE-$VERSION" + test -d $TARBALL && rm -rf $TARBALL +done