2001-01-15 05:23:30 +00:00
|
|
|
#!/bin/sh -x
|
|
|
|
|
#
|
|
|
|
|
# Simple script which does the following:
|
|
|
|
|
# o Generates a src tarball from a WORKAREA
|
|
|
|
|
# o Copies it over to ~/test and unpacks it
|
|
|
|
|
# o Generates a src tarball from src tarball
|
|
|
|
|
# o Compares the build status' ... reports problems
|
|
|
|
|
# o removes ~/test
|
|
|
|
|
#
|
|
|
|
|
|
2001-03-29 06:30:35 +00:00
|
|
|
package="$1"
|
2001-01-15 05:23:30 +00:00
|
|
|
tmpdir="$HOME/test"
|
|
|
|
|
|
2001-03-29 06:30:35 +00:00
|
|
|
if [ -z "$package" ]
|
|
|
|
|
then
|
|
|
|
|
echo "srctest requires one argument - package name"
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2001-01-15 05:23:30 +00:00
|
|
|
if [ -z "$WORKAREA" ]
|
|
|
|
|
then
|
|
|
|
|
echo "WORKAREA is not set -- aborting."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
if [ -d $tmpdir ]
|
|
|
|
|
then
|
|
|
|
|
echo "$tmpdir exists already -- aborting."
|
|
|
|
|
exit 1
|
|
|
|
|
else
|
|
|
|
|
mkdir $tmpdir
|
|
|
|
|
if [ ! -d $tmpdir ]
|
|
|
|
|
then
|
|
|
|
|
echo "Cannot create $tmpdir -- aborting."
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# Pleasantries are now out of the way, lets proceed.
|
|
|
|
|
# NB: If something goes wrong we'll leave the unpacked
|
|
|
|
|
# source alone for consumption by a human.
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
_cleanup()
|
|
|
|
|
{
|
|
|
|
|
if [ $status -eq 0 ]
|
|
|
|
|
then
|
|
|
|
|
rm -fr $tmpdir
|
|
|
|
|
else
|
|
|
|
|
echo "Problem? -- leaving $tmpdir for inspection"
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_buildme()
|
|
|
|
|
{
|
|
|
|
|
cd $1
|
|
|
|
|
|
|
|
|
|
if ./Makepkgs
|
|
|
|
|
then
|
|
|
|
|
:
|
|
|
|
|
else
|
|
|
|
|
echo Makepkgs thinks theres a problem in $1
|
|
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
|
2001-03-29 06:30:35 +00:00
|
|
|
if [ ! -f build/$package-*.src.tar.gz ]
|
2001-01-15 05:23:30 +00:00
|
|
|
then
|
2001-03-29 06:30:35 +00:00
|
|
|
echo Makepkgs failed to create build/package-*.src.tar.gz
|
2001-01-15 05:23:30 +00:00
|
|
|
exit 1
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
status=1
|
|
|
|
|
trap "_cleanup; exit \$status" 0 1 2 3 15
|
|
|
|
|
|
|
|
|
|
# first, build from the WORKAREA
|
2001-03-29 06:30:35 +00:00
|
|
|
_buildme $WORKAREA/cmd/$package
|
2001-01-15 05:23:30 +00:00
|
|
|
|
|
|
|
|
cd $tmpdir
|
2001-03-29 06:30:35 +00:00
|
|
|
gunzip < $WORKAREA/cmd/$package/build/$package-*.src.tar.gz | tar xf -
|
2001-01-15 05:23:30 +00:00
|
|
|
|
|
|
|
|
# now, cross check the src build
|
2001-03-29 06:30:35 +00:00
|
|
|
_buildme $tmpdir/$package-*
|
2001-01-15 05:23:30 +00:00
|
|
|
|
|
|
|
|
status=0
|