]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
make clean before proceeding to do a build to ensure no leftovers
authorNathan Scott <nathans@sgi.com>
Thu, 29 Mar 2001 06:30:35 +0000 (06:30 +0000)
committerNathan Scott <nathans@sgi.com>
Thu, 29 Mar 2001 06:30:35 +0000 (06:30 +0000)
corrupt subsequent invocations (for rpm builds).

Makepkgs

index cf0e6d5708fb5b27f6fbca4381a2c4b4f036b561..731cfb0ac61166cfa9ada43c7a8ac8365890d59a 100755 (executable)
--- a/Makepkgs
+++ b/Makepkgs
@@ -1,11 +1,11 @@
 #! /bin/sh
-#
-# Make whichever packages the system supports
+# 
+#      Make whichever packages have been requested.
+#      Defaults to RPMs.
 #
 LOGDIR=Logs
 
-clean=false
-debian=false
+type=rpm
 verbose=false
 
 MAKE=${MAKE:-make}
@@ -13,21 +13,18 @@ test ! -z "$MAKE" && make=$MAKE
 
 for opt in $*
 do
-    case "$opt" in
-    clean)
-       clean=true
-       ;;
-    debian)
-       debian=true
-       ;;
-    verbose)
-       verbose=true
-       ;;
-    *)
-       echo "Usage: Makepkgs [clean] [verbose] [debian]"
-       exit 1
-       ;;
-    esac
+       case "$opt" in
+       clean)
+               ;; # ignored, kept for backward compatibility
+       rpm)
+               type=rpm ;;
+       debian)
+               type=debian ;;
+       verbose)
+               verbose=true ;;
+       *)
+               echo "Usage: Makepkgs [verbose] [debian|rpm]"; exit 1 ;;
+       esac
 done
 
 # start with a clean manifest
@@ -37,76 +34,76 @@ test -f filesdevel.rpm && rm -f filesdevel.rpm
 test ! -d $LOGDIR && mkdir $LOGDIR
 rm -rf $LOGDIR/* > /dev/null 2>&1
 
-if $clean ; then
-    echo "== clean, log is $LOGDIR/clean"
+# build Debian packages, cleans itself before starting
+SUDO=${SUDO:-sudo}
+test ! -z "$SUDO" && sudo=$SUDO
+if [ $type = debian ] ; then
+       LOGDEB=`pwd`
+       LOGDEB=../`basename $LOGDEB`.log
+       echo "== Debian build, log is $LOGDEB"; echo
        if $verbose ; then
-       $MAKE clean 2>&1 | tee $LOGDIR/clean
+               dpkg-buildpackage -r$SUDO | tee $LOGDEB
        else
-    $MAKE clean > $LOGDIR/clean 2>&1 
+               dpkg-buildpackage -r$SUDO > $LOGDEB
        fi
-    if [ $? -ne 0 ] ; then
-       echo \"$MAKE clean\" failed, see log in $LOGDIR/clean
-       tail $LOGDIR/clean
-       exit 1
-    fi
+       exit 0
 fi
 
-SUDO=${SUDO:-sudo}
-test ! -z "$SUDO" && sudo=$SUDO
-if $debian ; then
-    LOGDEB=`pwd`
-    LOGDEB=../`basename $LOGDEB`.log
-    echo "== Debian build, log is $LOGDEB"; echo
-    if $verbose ; then
-       dpkg-buildpackage -r$SUDO | tee $LOGDEB
-    else
-       dpkg-buildpackage -r$SUDO > $LOGDEB
-    fi
-    exit 0
+# build RPM packages - manual clean before starting
+echo "== clean, log is $LOGDIR/clean"
+if $verbose ; then
+       $MAKE clean 2>&1 | tee $LOGDIR/clean
+else
+       $MAKE clean > $LOGDIR/clean 2>&1 
+fi
+if [ $? -ne 0 ] ; then
+       echo \"$MAKE clean\" failed, see log in $LOGDIR/clean
+       tail $LOGDIR/clean
+       exit 1
 fi
 
 echo
 echo "== configure, log is $LOGDIR/configure"
 if $verbose ; then
-    autoconf 2>&1 | tee $LOGDIR/configure
-    ./configure 2>&1 | tee -a $LOGDIR/configure
+       autoconf 2>&1 | tee $LOGDIR/configure
+       ./configure 2>&1 | tee -a $LOGDIR/configure
 else
-    autoconf > $LOGDIR/configure 2>&1 
-    ./configure >> $LOGDIR/configure 2>&1 
+       autoconf > $LOGDIR/configure 2>&1 
+       ./configure >> $LOGDIR/configure 2>&1 
 fi
 if [ $? -ne 0 ] ; then
-   echo \"configure\" failed, see log in $LOGDIR/configure
-   tail $LOGDIR/configure
-   exit 1
+       echo \"configure\" failed, see log in $LOGDIR/configure
+       tail $LOGDIR/configure
+       exit 1
 fi
 
 echo
 echo "== default, log is $LOGDIR/default"
 if $verbose ; then
-    $MAKE default 2>&1 | tee $LOGDIR/default
+       $MAKE default 2>&1 | tee $LOGDIR/default
 else
-    $MAKE default > $LOGDIR/default 2>&1 
+       $MAKE default > $LOGDIR/default 2>&1 
 fi
 if [ $? -ne 0 ] ; then
-   echo \"$MAKE default\" failed, see log in $LOGDIR/default
-   tail $LOGDIR/default
-   exit 1
+       echo \"$MAKE default\" failed, see log in $LOGDIR/default
+       tail $LOGDIR/default
+       exit 1
 fi
 
 echo
 echo "== dist, log is $LOGDIR/dist"
 [ ! -f .census ] && touch .census
 if $verbose ; then
-    $MAKE -C build dist 2>&1 | tee $LOGDIR/dist
+       $MAKE -C build dist 2>&1 | tee $LOGDIR/dist
 else
-    $MAKE -C build dist  > $LOGDIR/dist 2>&1
+       $MAKE -C build dist > $LOGDIR/dist 2>&1
 fi
 if [ $? -ne 0 ] ; then
-   echo $MAKE dist failed, see log in $LOGDIR/dist
-   tail $LOGDIR/dist
-   exit 1
+       echo $MAKE dist failed, see log in $LOGDIR/dist
+       tail $LOGDIR/dist
+       exit 1
 else
-   grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///'
+       grep '^Wrote:' $LOGDIR/dist | sed -e 's/\.\.\/\.\.\///'
 fi
 
 exit 0