. rotate uses bzip2 instead of gzip

. binpackages runs a binpackage batch
. easypack does binsizes big first
This commit is contained in:
Ben Gras 2006-02-02 17:12:16 +00:00
parent 087c550186
commit ac71ad109e
5 changed files with 38 additions and 13 deletions

View file

@ -17,6 +17,7 @@ usr: \
/usr/bin/bigmake \
/usr/bin/adduser \
/usr/bin/binpackage \
/usr/bin/binpackages \
/usr/bin/cd \
/usr/bin/[ \
/usr/bin/command \
@ -86,6 +87,9 @@ clean:
/usr/bin/binpackage: binpackage.sh
install -m 755 -c -o bin $? $@
/usr/bin/binpackages: binpackages.sh
install -m 755 -c -o bin $? $@
/usr/bin/adduser: adduser.sh
install -m 755 -c -o bin $? $@

View file

@ -2,10 +2,12 @@
set -e
dir=$1
# No trailing slashes in the directory, because we want to base the
# package filename on it.
dir=`echo "$1" | sed 's/\/*$//'`
if [ $# -lt 1 ]
then echo "Usage: $0 packagedir"
if [ $# -ne 2 ]
then echo "Usage: $0 sourcedir packagedir"
exit 1
fi
@ -20,8 +22,10 @@ packagestart=$srcdir/now
findlist=$srcdir/findlist
tarfile=${dir}.tar
tar=$srcdir/$tarfile
targz=$tarfile.gz
tarbz=$tar.bz
pdir="$2"
mkdir $pdir 2>/dev/null || true
binsizes big
touch $packagestart
sleep 1
@ -32,13 +36,11 @@ then echo "Error: No build script in $dir."
exit 1
fi
sh build
sh -e build
cd /
echo " * Making file index, writing $targz"
find / -cnewer $packagestart | grep -v "^$srcdir" | grep -v "^/dev" | grep -v "^/tmp" | grep -v "^/usr/tmp" | pax -w -d -z >$targz
echo " * Ok. Cleanup.."
echo " * Building package"
find / -cnewer $packagestart | grep -v "^$srcdir" | grep -v "^/dev" | grep -v "^/tmp" | grep -v "^/usr/tmp" | grep -v "^/usr/log" | grep -v "^/usr/adm" | grep -v "^/etc/utmp" | grep -v "^/usr/src" | pax -w -d | bzip2 >$tarbz
rm -f $packagestart $findlist $tarcmd
binsizes normal
mv $targz $here
ls -al $here/$targz
mv $tarbz $here/$pdir
exit 0

View file

@ -0,0 +1,13 @@
#!/bin/sh
pdir=Packages
for d in */build
do
dir="`echo $d | sed 's/\/build$//'`"
if [ ! -f $pdir/$dir.tar.gz ]
then
echo " * $dir"
binpackage $dir $pdir
fi
done

View file

@ -95,10 +95,12 @@ do # Check to see if it exists. Don't overwrite unless -o given
# It is now unpacked. Build it
cd $i
binsizes big
if sh build >>$ORIG_DIR/Log 2>&1
then echo Package $i installed
else echo Package $i failed to install, see Log
fi
binsizes normal
# Clean up
cd ..

View file

@ -1,5 +1,5 @@
#!/bin/sh
BZIP=/usr/local/bin/bzip2
RM="rm -f"
MV="mv -f"
@ -12,6 +12,10 @@ if [ ! -f "$1" ]
then exit 1
fi
if [ ! -x "$BZIP" ]
then exit 1
fi
if [ "$2" -le 0 ]
then echo "Keep at least 1 copy please."
exit 1
@ -21,7 +25,7 @@ k="$2"
$RM "$1.$k" 2>/dev/null || exit 1
while [ "$k" -ge 2 ]
do prev="`expr $k - 1`"
$MV $1.$prev.gz $1.$k.gz 2>/dev/null
$MV $1.$prev.bz $1.$k.bz 2>/dev/null
k=$prev
done
gzip -c $1 >$1.1.gz && : >$1
$BZIP -c $1 >$1.1.bz && : >$1