Added support for local book's sources.

This commit is contained in:
Manuel Canales Esparcia 2005-10-02 14:06:01 +00:00
parent 6299c11068
commit 24530379e6

73
jhalfs
View file

@ -15,15 +15,25 @@ Usage: $0 [OPTION]
Options: Options:
-h, --help print this help, then exit -h, --help print this help, then exit
-V, --version print version number, then exit -V, --version print version number, then exit
-L, --LFS-version=VER use VER version of the LFS book
-d --directory=DIR use DIR directory for building LFS; all files -d --directory=DIR use DIR directory for building LFS; all files
jhalfs produces will be in the directory jhalfs produces will be in the directory
DIR/jhalfs DIR/jhalfs
-P, --get-packages download the packages and patches
-D, --download-client=CLIENT use CLIENT as the program for retrieving -D, --download-client=CLIENT use CLIENT as the program for retrieving
packages packages (for use in conjunction with -P)
-T, --testsuites run the optional testsuites
-P, --get-packages download the packages -W, --working-copy=DIR use the local working copy placed in DIR
as the LFS book
-L, --LFS-version=VER ckeckout VER version of the LFS book
-T, --testsuites add support to run the optional testsuites
-M, --run-make run make on the generated Makefile -M, --run-make run make on the generated Makefile
" "
@ -80,6 +90,14 @@ while test $# -gt 0 ; do
shift shift
;; ;;
--working-copy | -W )
test $# = 1 && eval "$exit_missing_arg"
shift
WC=1
BOOK=$1
shift
;;
--testsuites | -T ) --testsuites | -T )
TEST=1 TEST=1
shift shift
@ -139,28 +157,37 @@ get_book() {
# Test to make sure the LFS version is set # Test to make sure the LFS version is set
if [ -z $LFSVRS ] ; then LFSVRS=development ; fi if [ -z $LFSVRS ] ; then LFSVRS=development ; fi
echo -n "Downloading the LFS Book, version $LFSVRS... "
# Grab the LFS book fresh if it's missing, otherwise, update it from the # Set the book's soures directory
# repo. If we've already extracted the commands, move on to getting the if [ -z $BOOK ] ; then BOOK=lfs-$LFSVRS ; fi
# sources.
if [ -d lfs-$LFSVRS ] ; then if [ -z $WC ] ; then
cd lfs-$LFSVRS echo -n "Downloading the LFS Book, version $LFSVRS... "
if svn up | grep -q At && test -d $JHALFSDIR/commands && \
test -f $JHALFSDIR/packages && test -f $JHALFSDIR/patches ; then # Grab the LFS book fresh if it's missing, otherwise, update it from the
echo -ne "done\n" # repo. If we've already extracted the commands, move on to getting the
get_sources # sources.
if [ -d lfs-$LFSVRS ] ; then
cd lfs-$LFSVRS
if svn up | grep -q At && test -d $JHALFSDIR/commands && \
test -f $JHALFSDIR/packages && test -f $JHALFSDIR/patches ; then
echo -ne "done\n"
get_sources
else
echo -ne "done\n"
extract_commands
fi
else else
if [ $LFSVRS = development ] ; then
svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
else
svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
fi
echo -ne "done\n" echo -ne "done\n"
extract_commands extract_commands
fi fi
else else
if [ $LFSVRS = development ] ; then echo -ne "Using $BOOK as book's sources ...\n"
svn co $SVN/LFS/trunk/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
else
svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$BUILDDIR$LOGDIR/$LOG 2>&1
fi
echo -ne "done\n"
extract_commands extract_commands
fi fi
} }
@ -177,14 +204,14 @@ extract_commands() {
# Dump the commands in shell script form from the LFS book. # Dump the commands in shell script form from the LFS book.
xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \ xsltproc --nonet --xinclude --stringparam testsuite $TEST -o ./commands/ \
$XSL lfs-$LFSVRS/index.xml >>$BUILDDIR$LOGDIR/$LOG 2>&1 $XSL $BOOK/index.xml >>$BUILDDIR$LOGDIR/$LOG 2>&1
# Grab the patches and package names. # Grab the patches and package names.
cd $JHALFSDIR cd $JHALFSDIR
for i in patches packages ; do rm -f $i ; done for i in patches packages ; do rm -f $i ; done
grep "\-version" lfs-$LFSVRS/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@' \ grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@' \
-e '/generic/d' >> packages -e '/generic/d' >> packages
grep "ENTITY" lfs-$LFSVRS/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches grep "ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
# Done. Moving on... # Done. Moving on...
echo -ne "done\n" echo -ne "done\n"