Added support for local book's sources.
This commit is contained in:
parent
6299c11068
commit
24530379e6
1 changed files with 50 additions and 23 deletions
41
jhalfs
41
jhalfs
|
@ -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,6 +157,11 @@ 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
|
||||||
|
|
||||||
|
# Set the book's soures directory
|
||||||
|
if [ -z $BOOK ] ; then BOOK=lfs-$LFSVRS ; fi
|
||||||
|
|
||||||
|
if [ -z $WC ] ; then
|
||||||
echo -n "Downloading the LFS Book, version $LFSVRS... "
|
echo -n "Downloading the LFS Book, version $LFSVRS... "
|
||||||
|
|
||||||
# Grab the LFS book fresh if it's missing, otherwise, update it from the
|
# Grab the LFS book fresh if it's missing, otherwise, update it from the
|
||||||
|
@ -163,6 +186,10 @@ get_book() {
|
||||||
echo -ne "done\n"
|
echo -ne "done\n"
|
||||||
extract_commands
|
extract_commands
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo -ne "Using $BOOK as book's sources ...\n"
|
||||||
|
extract_commands
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
extract_commands() {
|
extract_commands() {
|
||||||
|
@ -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"
|
||||||
|
|
Reference in a new issue