]> Zhao Yanbai Git Server - minix.git/commitdiff
package/release tweaks
authorBen Gras <ben@minix3.org>
Sun, 26 Mar 2006 18:01:39 +0000 (18:01 +0000)
committerBen Gras <ben@minix3.org>
Sun, 26 Mar 2006 18:01:39 +0000 (18:01 +0000)
commands/scripts/packman.sh
tools/release.sh

index 0e82669574ec9e74f8ce018bcfa96bb01a72fcd2..5b58d7bee457c972e5b08596aaab198334ea2586 100644 (file)
@@ -45,19 +45,71 @@ then        pack=${cddrive}p2
 else   echo "Don't know where the install CD is. You can set it in $RC."
 fi
 
+# For local testing
+cdpackages=/usr/bigports/Packages/List
+CDPACK=/usr/bigports/Packages
+CDSRC=/usr/bigports/Sources
+
 if [ "$cdpackages" = "" ]
 then   echo "Skipping CD packages."
+else   cont=y
+       while [ $cont = y ]
+       do      n="`wc -l $cdpackages | awk '{ print $1 }'`"
+               sourcef=$CDSRC/SizeMB
+               if [ -f $sourcef ]
+               then    sourcesize=" (`cat $sourcef` MB uncompressed)"
+               else    sourcesize=""
+               fi
+               binf=$CDPACK/SizeMB
+               if [ -f $binf ]
+               then    binsize=" (`cat $binf` MB uncompressed)"
+               else    binsize=""
+               fi
+
+               echo "There are $n CD packages."
+               echo "Please choose:"
+               echo " 1  Install all $n binary packages$binsize from CD"
+               echo " 2  Install all $n binary packages + sources from CD$sourcesize"
+               echo " 3  Display the list of packages on CD"
+               echo " 4  Let me select individual packages to install from CD"
+               echo -n "Choice: [4] "
+               read in
+               case "$in" in
+               1|2)
+                       cd $CDPACK || exit
+                       echo " * Installing binaries .."
+                       for f in *.tar.bz2
+                       do      echo "Installing $f binaries .."
+                               packit $f && echo Installed $f
+                       done
+                       if [ "$in" = 2 ]
+                       then
+                               cd $SRC || exit
+                               echo " * Installing sources .."
+                               for f in $CDSRC/*.tar.bz2
+                               do      echo "Installing $f in $SRC .."
+                                       smallbunzip2 -dc $f | tar xf - 
+                               done
+                       fi
+                       ;;
+               3)
+                       ( echo "Displaying list; press q to leave it, space for more."
+                         cat "$CDPACK/List" | awk -F'|' '{ printf "%-20s %s\n", $1, $2 }'
+                       ) | more
+                       ;;
+               ""|4)
+                       echo "Ok, showing packages to install." ; echo
+                       cont=n
+               esac
+       done
+       echo -n "Press RETURN to continue .. "
+       read xyzzy
 fi
 
 TMPF=$TMPDIR/.list.$$
 rm -f $TMPF
 rm -f $TMPDIR/.*       # Remove any remaining .postinstall script or .list*
 
-# For local testing
-#cdpackages=/usr/bigports/Packages/List
-#CDPACK=/usr/bigports/Packages
-#CDSRC=/usr/bigports/Sources
-
 netpackages=""
 if </dev/tcp
 then   if [ -f $LISTFILE ]
index eef9cc2bc2b6d0e17dc67e6a33cc6c7c89022373..f3e010f9e551cb36b3a914c54e5ae75a89454737 100755 (executable)
@@ -247,19 +247,32 @@ echo " * Transfering $COPYITEMS to $RELEASEDIR"
 
 if [ -d $PACKAGEDIR -a -d $PACKAGESOURCEDIR ]
 then   echo " * Indexing packages"
+       bintotal=0
        ( cd $PACKAGEDIR
          for p in *.tar.bz2
-         do    p="`echo $p | sed 's/.tar.bz2//'`"
+         do    echo $p >&2
+               p="`echo $p | sed 's/.tar.bz2//'`"
                descr="../$p/.descr"
                if [ -f "$descr" ]
                then    echo "$p|`cat $descr`"
                fi
          done >List
        )
+       for d in $PACKAGEDIR $PACKAGESOURCEDIR
+       do      echo Counting size of $d
+               f=$d/SizeMB
+               if [ ! -f $f ]
+               then
+                       b="`bzip2 -dc $d/*.bz2 | wc -c`"
+                       echo "`expr 1 + $b / 1024 / 1024`" >$f
+               fi
+               echo "`cat $f` MB."
+       done
        echo " * Transfering $PACKAGEDIR to $RELEASEPACKAGE"
        cp $PACKAGEDIR/* $RELEASEPACKAGE/
        echo " * Transfering $PACKAGESOURCEDIR to $RELEASEPACKAGESOURCES"
        cp $PACKAGESOURCEDIR/* $RELEASEPACKAGESOURCES/
+
 fi
 
 # Make sure compilers and libraries are bin-owned