Keeping sinchronized experimental branch with trunk.

This commit is contained in:
Manuel Canales Esparcia 2006-05-01 11:10:53 +00:00
parent c58f33028d
commit 3e7af380e3
12 changed files with 234 additions and 443 deletions

View file

@ -5,7 +5,6 @@
# $Id$
#
#####
declare -r FTP=ftp://ftp.linuxfromscratch.org/pub/lfs/conglomeration
#--- Which target architecture you want to build for,
# used to select proper book and set TARGETS
@ -58,7 +57,7 @@ BOOK=
# Don't edit it unless you know what you are doing
#--- Extra files that need be copied to $JHALFSDIR
FILES="patcheslist.xsl packageslist.xsl"
FILES=""
#--- Default stylesheet
XSL=clfs.xsl
@ -69,5 +68,3 @@ LFSVRS=development
#--- Name of the makefile
MKFILE=$JHALFSDIR/Makefile
#--- FTP/HTTP mirror used as fallback (full path)
SERVER=ftp://anduin.linuxfromscratch.org/LFS/conglomeration

View file

@ -1,26 +0,0 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!--$Id$ -->
<!-- Get list of packages from the CLFS Book -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="//ulink"/>
</xsl:template>
<xsl:template match="ulink">
<!-- Packages. If some package don't have the string ".tar." in their
name, the next test must be fixed to match it also. Skip possible
duplicated URLs due that may be splitted for PDF output -->
<xsl:if test="(contains(@url, '.tar.') or contains(@url, '.tgz'))
and not(ancestor-or-self::*/@condition = 'pdf')">
<xsl:value-of select="@url"/>
<xsl:text>&#x0a;</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View file

@ -1,25 +0,0 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!--$Id$ -->
<!-- Get list of patches from the CLFS Book -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<xsl:template match="/">
<xsl:apply-templates select="//ulink"/>
</xsl:template>
<xsl:template match="ulink">
<!-- Patches. Match only the patches and skip possible duplicated
URLs due that may be splitted for PDF output-->
<xsl:if test="contains(@url, '.patch')
and not(ancestor-or-self::*/@condition = 'pdf')">
<xsl:value-of select="@url"/>
<xsl:text>&#x0a;</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View file

@ -5,7 +5,6 @@
# $Id$
#
#####
declare -r FTP=ftp://ftp.linuxfromscratch.org/pub/lfs/conglomeration
#--- Which library model to use uclibc/glibc
MODEL=glibc
@ -28,7 +27,7 @@ BOOK=
# Don't edit it unless you know what you are doing
#--- Extra files that need be copied to $JHALFSDIR
FILES="patcheslist.xsl"
FILES=""
#--- Default stylesheet
XSL=hlfs.xsl
@ -38,6 +37,3 @@ LFSVRS=development
#--- Name of the makefile
MKFILE=$JHALFSDIR/Makefile
#--- FTP/HTTP mirror used as fallback (full path)
SERVER=ftp://anduin.linuxfromscratch.org/HLFS/conglomeration

View file

@ -8,95 +8,6 @@ set -e # Enable error trapping
###################################
#----------------------------#
get_sources() { #
#----------------------------#
local IFS
# Test if the packages must be downloaded
if [ ! "$HPKG" = "1" ] ; then
return
fi
# Modify the 'internal field separator' to break on 'LF' only
IFS=$'\x0A'
if [ ! -d $BUILDDIR/sources ] ; then mkdir $BUILDDIR/sources ; fi
cd $BUILDDIR/sources
> MISSING_FILES.DMP # Files not in md5sum end up here
if [ -f MD5SUMS ] ; then rm MD5SUMS ; fi
if [ -f MD5SUMS-$VERSION ] ; then rm MD5SUMS-$VERSION ; fi
# Retrieve the master md5sum file
download "" MD5SUMS
# Iterate through each package and grab it, along with any patches it needs.
for i in `cat $JHALFSDIR/packages` ; do
PKG=`echo $i | sed -e 's/-version.*//' \
-e 's/uclibc/uClibc/' `
#
# How to deal with orphan packages..??
#
VRS=`echo $i | sed -e 's/.* //' -e 's/"//g'`
case "$PKG" in
"gcc" )
download $PKG "gcc-core-$VRS.tar.bz2"
download $PKG "gcc-g++-$VRS.tar.bz2"
if [ ! "$TEST" = "0" ] ; then
download $PKG "gcc-testsuite-$VRS.tar.bz2" ;
fi
;;
"glibc")
if [ "$MODEL" = "glibc" ] ; then
download $PKG "$PKG-$VRS.tar.bz2"
download $PKG "$PKG-libidn-$VRS.tar.bz2"
fi
;;
"tcl" )
FILE="$PKG$VRS-src.tar.bz2" ; download $PKG $FILE ;;
"uclibc" )
if [ "$MODEL" = "uclibc" ] ; then
download $PKG "$PKG-$VRS.tar.bz2"
fi
;;
"uClibc-locale" )
if [ "$MODEL" = "uclibc" ] ; then
FILE="$PKG-$VRS.tgz" ; PKG="uClibc"
download $PKG $FILE
# There can be no patches for this file
continue
fi
;;
"uClibc-patch" ) continue ;;
* )
FILE="$PKG-$VRS.tar.bz2" ; download $PKG $FILE ;;
esac
for patch in `grep "$PKG-&$PKG" $JHALFSDIR/patches` ; do
PATCH=`echo $patch | sed 's@&'$PKG'-version;@'$VRS'@'`
download $PKG $PATCH
done
done
# .... U G L Y .... what to do with the grsecurity patch to the kernel..
download grsecurity `grep grsecurity $JHALFSDIR/patches`
if [[ -s $BUILDDIR/sources/MISSING_FILES.DMP ]]; then
echo -e "\n\n${tab_}${RED} One or more files were not retrieved.\n${tab_} Check <MISSING_FILES.DMP> for names ${OFF}\n\n"
fi
}
#----------------------------#
chapter3_Makefiles() { # Initialization of the system
#----------------------------#

View file

@ -1,30 +0,0 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!-- $Id$ -->
<!-- Get list of patches from the HLFS Book -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<!-- What libc implentation must be used? -->
<xsl:param name="model" select="glibc"/>
<!-- No text needed -->
<xsl:template match="//text()">
<xsl:text/>
</xsl:template>
<!-- Just grab the url from the patches.xml file. Skip possible
duplicated URLs due that may be splitted for PDF output -->
<xsl:template match="//ulink">
<xsl:if test="(ancestor::varlistentry[@condition=$model]
or not(ancestor::varlistentry[@condition]))
and not(ancestor-or-self::*/@condition = 'pdf')">
<xsl:value-of select="@url"/>
<xsl:text>&#x0a;</xsl:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View file

@ -5,7 +5,6 @@
# $Id$
#
#####
declare -r FTP=ftp://ftp.linuxfromscratch.org/pub/lfs/conglomeration
#--- Location of fstab file (if empty, a template is created)
FSTAB=
@ -32,6 +31,3 @@ LFSVRS=development
#--- Name of the makefile
MKFILE=$JHALFSDIR/Makefile
#--- FTP/HTTP mirror used as fallback (full path)
SERVER=ftp://anduin.linuxfromscratch.org/LFS/conglomeration

View file

@ -505,10 +505,6 @@ get_book() {
case $LFSVRS in
development)
svn co $SVN/${svn_root}/trunk/BOOK ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1 ;;
alphabetical)
svn co $SVN/${svn_root}/branches/$LFSVRS/BOOK ${PROGNAME}-$LFSVRS >>$LOGDIR/$LOG 2>&1 ;;
udev_update)
svn co $SVN/LFS/branches/$LFSVRS/BOOK lfs-$LFSVRS >>$LOGDIR/$LOG 2>&1 ;;
esac
echo -ne "done\n"
# Set the canonical book version
@ -525,69 +521,9 @@ get_book() {
fi
}
#----------------------------#
build_patches_file() { # Supply a suitably formated list of patches.
#----------------------------#
local saveIFS=$IFS
local IFS
rm -f patches
LOC_add_patches_entry() {
for f in `grep "/$1-" patcheslist_.wget`; do
basename $f | sed "s|${2}|\&${1}-version;|" >> patches
done
}
case ${PROGNAME} in
hlfs)
echo -n "Creating the HLFS ${L_arrow}${BOLD}$MODEL${R_arrow} specific patches file"
xsltproc --nonet \
--xinclude \
--stringparam model $MODEL \
-o patcheslist_.wget \
patcheslist.xsl \
$BOOK/chapter04/patches.xml
#> /dev/null 2>&1
# .... U G L Y .... what to do with the grsecurity patch to the kernel..
for f in `grep "/grsecurity-" patcheslist_.wget`; do
basename $f >> patches
done
;;
clfs) # Pull out a list of arch specific patches
echo -n "Creating CLFS ${L_arrow}${BOLD}$ARCH${R_arrow} specific patches file"
xsltproc -xinclude \
-o patcheslist_.wget \
patcheslist.xsl \
$BOOK/materials/${ARCH}-chapter.xml
;;
*) return
esac
IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
for f in `cat packages`; do
IFS=$saveIFS # Restore the system defaults
LOC_add_patches_entry \
`echo $f | sed -e 's/-version//' \
-e 's/-file.*//' \
-e 's/"//g' \
-e 's/uclibc/uClibc/'`
done
rm -f patcheslist_.wget
echo " ...OK"
}
#----------------------------#
extract_commands() { #
#----------------------------#
local saveIFS=$IFS
# Check for libxslt instead of just letting the script hit 'xsltproc' and fail.
test `type -p xsltproc` || eval "echo \"This feature requires libxslt.\"
@ -651,7 +587,7 @@ extract_commands() { #
--stringparam server $SERVER \
-o ./${PROGNAME}-commands/ $XSL $BOOK/index.xml >>$LOGDIR/$LOG 2>&1
;;
*) exit 1
*) exit 1 ;;
esac
echo " ...OK"
@ -659,62 +595,14 @@ extract_commands() { #
# Make the scripts executable.
chmod -R +x $JHALFSDIR/${PROGNAME}-commands
# Grab the patches and package names.
for i in patches packages ; do
rm -f $i
done
#
# Create the packages file. We need it for proper Makefile creation
rm -f packages
case "${PROGNAME}" in
clfs)
################################
# A LOCAL function
# xx_.wget contains arch specific files but in URL format
# Build a file with only arch specific files.. small ugly..
LOC_add_packages_entry() {
local fileMATCH aFILE
# Deal with a non-standard format
if [[ "$1" = "clfs-bootscripts" ]]; then
set -- "bootscripts-cross-lfs" $2
fi
fileMATCH="/$1"
# format.. Filename-Version or FilenameVersion
for aFILE in `grep ${fileMATCH}-*[[:digit:]] packageslist_.wget`; do
# Block vim-x.x-lang file, will add it later based on config flag
if [[ ! "${aFILE}" =~ "vim-$2-lang" ]]; then
echo "$1-version \"$2\"" >> packages
fi
done
}
#################################
# We only want a list arch specific files..
# Unfortunately this script produces URL's which must be converted to a std format
echo -n "Creating CLFS ${L_arrow}${BOLD}${ARCH}${R_arrow} specific packages file"
xsltproc -xinclude \
-o packageslist_.wget \
packageslist.xsl \
$BOOK/materials/${ARCH}-chapter.xml
# This has the correct format but contains packages from every book
echo -n "Creating <${PROGNAME}> specific packages file"
grep "\-version " $BOOK/packages.ent | sed -e 's@<!ENTITY @@' \
-e 's@">@"@' \
-e '/generic/d' > packages.tmp
# This variable is necessary to make sure the `cat $JHALFSDIR/packages`
# separates each iteration by lines.
# Modify the 'internal field separator' to break on 'LF' only
IFS=$'\x0A'
for f in `cat packages.tmp`; do
IFS=$saveIFS # Restore the system defaults
LOC_add_packages_entry \
`echo $f | sed -e 's/-version//' \
-e 's/-file.*//' \
-e 's/"//g'`
done
rm -f packageslist_.wget packages.tmp
-e '/generic/d' > packages
echo " ...OK"
;;
@ -731,150 +619,138 @@ extract_commands() { #
grep "\-version" $BOOK/general.ent | sed -e 's@<!ENTITY @@' \
-e 's@">@"@' \
-e '/generic/d' >> packages
echo `grep "glibc" packages | sed 's@glibc@glibc-libidn@'` >> packages
echo `grep "udev-config-file" $BOOK/general.ent | sed -e 's@<!ENTITY @@' -e 's@">@"@'` >> packages
echo " ...OK"
;;
esac
# Download the vim-lang package if it must be installed
if [ "$VIMLANG" = "1" ] && [ ! "$PROGNAME" = "hlfs" ] ; then
echo `grep "vim" packages | sed 's@vim@&-lang@'` >> packages
fi
# Create the patches file
case "${PROGNAME}" in
hlfs)
build_patches_file ;;
clfs )
build_patches_file ;;
lfs)
grep "^<\!ENTITY" $BOOK/patches.ent | sed -e 's/.* "//' -e 's/">//' >> patches
;;
blfs) ;;
*) exit 1
esac
# Done. Moving on...
get_sources
}
#----------------------------#
download() { # Download file, write name to MISSING_FILES.DMP if an error
#----------------------------#
cd $BUILDDIR/sources
# Hackish fix for the bash-doc, glibc-{linuxthreads,libidn}
# that don't conform to norms in the URL scheme.
DIR=`echo $1 | sed 's@-doc@@;s@-linuxthreads@@;s@-libidn@@;s@-testsuite@@'`
# If the file exists in the archive copy it to the $BUILDDIR/sources dir
# MD5SUM is assumed to be correct from previous download
if [ ! -z ${SRC_ARCHIVE} ] &&
[ -d ${SRC_ARCHIVE} ] &&
[ -f ${SRC_ARCHIVE}/$2 ]; then
cp ${SRC_ARCHIVE}/$2 .
echo "$2: -- ok"
return
fi
# Find the md5 sum for this package.
if [ $2 != MD5SUMS ] ; then
set +e
MD5=`grep " $2" MD5SUMS`
if [ $? -ne 0 ]; then
set -e
echo "${RED}$2 not found in MD5SUMS${OFF}"
echo "$2 not found in MD5SUMS" >> MISSING_FILES.DMP
return
fi
set -e
fi
if [ ! -f $2 ] ; then
case $DL in
wgetFTP ) wget --passive $FTP/$DIR/$2 ;;
wget ) wget $HTTP/$DIR/$2 ;;
curl ) `curl -# $FTP/$DIR/$2 -o $2` ;;
* ) echo "$DL not supported at this time." ;;
esac
elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
case $DL in
wgetFTP ) wget --passive -c $FTP/$DIR/$2 ;;
wget ) wget -c $HTTP/$DIR/$2 ;;
curl ) `curl -# -C - $FTP/$DIR/$2 -o $2` ;;
* ) echo "$DL not supported at this time." ;;
esac
fi
if [ $2 != MD5SUMS ] && ! echo "$MD5" | md5sum -c - ; then
exit 1
fi
if [ $2 != MD5SUMS ] ; then
echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION
fi
# If we make it this far we should copy the freshly downloaded file
# to the source archive.
if [ ! -z ${SRC_ARCHIVE} ] &&
[ -d ${SRC_ARCHIVE} ] &&
[ -w ${SRC_ARCHIVE} ] &&
[ $2 != MD5SUMS ]; then
echo "Store file:<$2> in package archive"
cp -v $2 ${SRC_ARCHIVE}
fi
}
#----------------------------#
get_sources() {
get_sources() { # Download file, write name to MISSING_FILES.DMP if an error
#----------------------------#
local saveIFS=$IFS
local IFS line URL1 URL2 FILE MD5
# Test if the packages must be downloaded
if [ "$HPKG" = "1" ] ; then
if [ "$GETPKG" = "1" ] ; then
# This variable is necessary to make sure the `cat $JHALFSDIR/packages`
# separates each iteration by lines.
# Modify the 'internal field separator' to break on 'LF' only
IFS=$'\x0A'
if [ ! -d $BUILDDIR/sources ] ; then mkdir $BUILDDIR/sources ; fi
[[ ! -d $BUILDDIR/sources ]] && mkdir $BUILDDIR/sources
cd $BUILDDIR/sources
if [ -f MD5SUMS ] ; then rm MD5SUMS ; fi
if [ -f MD5SUMS-$VERSION ] ; then rm MD5SUMS-$VERSION ; fi
if [ -f MISSING_FILES.DMP ] ; then rm MISSING_FILES.DMP ; fi
[[ -f MD5SUMS ]] && rm MD5SUMS
[[ -f MD5SUMS-$VERSION ]] && rm MD5SUMS-$VERSION
[[ -f MISSING_FILES.DMP ]] && rm MISSING_FILES.DMP
[[ -f urls.lst ]] && rm urls.lst
download "" MD5SUMS
# Download a fresh MD5SUMS file
wget $SERVER/pub/lfs/conglomeration/MD5SUMS
# Iterate through each package and grab it, along with any patches it needs.
for i in `cat $JHALFSDIR/packages` ; do
PKG=`echo $i | sed -e 's/-version.*//' -e 's/-file.*//'`
# Generate URLs file
create_urls
# There are some entities that aren't valid packages.
if [ "$PKG" = "expect-lib" -o "$PKG" = "linux-dl" ] ; then continue ; fi
IFS=$'\x0A' # Modify the 'internal field separator' to break on 'LF' only
for line in `cat urls.lst`; do
IFS=$saveIFS # Restore the system defaults
VRS=`echo $i | sed -e 's/.* //' -e 's/"//g'`
case $PKG in
tcl) FILE="$PKG$VRS-src.tar.bz2" ;;
vim-lang) PKG="vim"
FILE="vim-$VRS-lang.tar.bz2" ;;
udev-config) PKG="udev"
FILE="$VRS" ;;
*) FILE="$PKG-$VRS.tar.bz2" ;;
# Skip some packages if they aren't needed
case $line in
*/tcl* | */expect* | */dejagnu* | */tree* | */gcc-testsuite* )
[[ "$TEST" = "0" ]] && continue
;;
*/vim-*-lang* )
[[ "$VIMLANG" = "0" ]] && continue
;;
esac
download $PKG $FILE
# Download any associated patches
for patch in `grep "&$PKG-version" $JHALFSDIR/patches` ; do
PATCH=`echo $patch | sed 's@&'$PKG'-version;@'$VRS'@'`
download $PKG $PATCH
done
URL1=`echo $line | cut -d" " -f1` # Upstream URL
URL2=`echo $line | cut -d" " -f2` # Fallback URL
FILE=`basename $URL2` # File name
# If the file exists in the archive copy it to the $BUILDDIR/sources dir
# MD5SUM is assumed to be correct from previous download
if [ ! -z ${SRC_ARCHIVE} ] &&
[ -d ${SRC_ARCHIVE} ] &&
[ -f ${SRC_ARCHIVE}/$FILE ]; then
cp ${SRC_ARCHIVE}/$FILE .
echo "$FILE: -- copied from $SRC_ARCHIVE"
fi
# Find the md5 sum for this package.
set +e
MD5=`grep " $FILE" MD5SUMS`
if [ $? -ne 0 ]; then
set -e
echo "${RED}$FILE not found in MD5SUMS${OFF}"
echo "$FILE not found in MD5SUMS" >> MISSING_FILES.DMP
fi
set -e
if [ ! -f $FILE ] ; then
wget $URL1 || wget $URL2
elif ! echo "$MD5" | md5sum -c - >/dev/null 2>/dev/null ; then
wget -N $URL1 || wget -N $URL2
fi
if ! echo "$MD5" | md5sum -c - ; then
echo "${RED}$FILE not match MD5SUMS value${OFF}"
echo "$FILE not match MD5SUMS value" >> MISSING_FILES.DMP
fi
echo `grep "$MD5" MD5SUMS` >> MD5SUMS-$VERSION
# Copy the freshly downloaded file
# to the source archive.
if [ ! -z ${SRC_ARCHIVE} ] &&
[ -d ${SRC_ARCHIVE} ] &&
[ -w ${SRC_ARCHIVE} ] &&
[ ! -f ${SRC_ARCHIVE}/$FILE ] ; then
echo "Store file:<$FILE> in package archive"
cp -v $FILE ${SRC_ARCHIVE}
fi
done
if [[ -s $BUILDDIR/sources/MISSING_FILES.DMP ]]; then
echo -e "\n\n${tab_}${RED} One or more files were not retrieved.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n\n"
if [[ -s MISSING_FILES.DMP ]]; then
echo -e "\n\n${tab_}${RED} One or more files were not retrieved or have a bad MD5SUMS chechsum.\n${tab_} Check ${L_arrow}$BUILDDIR/sources/MISSING_FILES.DMP${R_arrow} for names ${OFF}\n\n"
fi
fi
}
#----------------------------#
create_urls() { #
#----------------------------#
cd $JHALFSDIR
case ${PROGNAME} in
clfs)
echo -n "Creating CLFS <${ARCH}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
-o $BUILDDIR/sources/urls.lst urls.xsl \
$BOOK/materials/$ARCH-chapter.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
hlfs)
echo -n "Creating HLFS <${MODEL}> specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
--stringparam model $MODEL \
-o $BUILDDIR/sources/urls.lst urls.xsl \
$BOOK/chapter04/chapter04.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
lfs)
echo -n "Creating LFS specific URLs file"
xsltproc --nonet --xinclude \
--stringparam server $SERVER \
-o ../sources/urls.lst urls.xsl \
$BOOK/chapter03/chapter03.xml >>$LOGDIR/$LOG 2>&1
echo " ...OK"
;;
esac
cd $BUILDDIR/sources
}

View file

@ -7,20 +7,25 @@
declare -r SVN="svn://svn.linuxfromscratch.org"
declare -r LOG=000-masterscript.log
declare -r HTTP=http://ftp.lfs-matrix.net/pub/lfs/conglomeration
#--- Mount point for the build
BUILDDIR=/mnt/build_dir
#=== Getting packages ===
#--- Download the source packages 0(no)/1(yes)
GETPKG=0
#--- The local repository for packages/file
# Used only if HPKG = 1
# Used only if GETPKG = 1
# Any missing file will be downloaded and archived here,
# if the user has the right priviledges.
SRC_ARCHIVE=$SRC_ARCHIVE
#--- Download the source packages 0(no)/1(yes)
HPKG=0
# --- Server used as fallback if the file isn't found in
# SRC_ARCHIVE and/or can't be dowloaded from upstream
SERVER=ftp://ftp.lfs-matrix.net
#=== Build options ===
#--- Run the makefile at the end 0(no)/1(yes)
# In BLFS the Makefile can't be run automatically
RUNMAKE=0

View file

@ -84,10 +84,10 @@ validate_config() { # Are the config values sane (within reason)
inline_doc
# First internal variables, then the ones that change the book's flavour, and lastly system configuration variables
local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG DEPEND TEST"
local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE MODEL GRSECURITY_HOST TEST REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG KEYMAP PAGE TIMEZONE LANG LC_ALL"
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE METHOD ARCH TARGET TEST REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE HPKG RUNMAKE TEST REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG VIMLANG PAGE TIMEZONE LANG"
local -r blfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG DEPEND TEST"
local -r hlfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE MODEL GRSECURITY_HOST TEST REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG KEYMAP PAGE TIMEZONE LANG LC_ALL"
local -r clfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE METHOD ARCH TARGET TEST REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB BOOT_CONFIG CONFIG KEYMAP VIMLANG PAGE TIMEZONE LANG"
local -r lfs_PARAM_LIST="BOOK BUILDDIR SRC_ARCHIVE GETPKG RUNMAKE TEST REPORT COMPARE RUN_ICA RUN_FARCE ITERATIONS STRIP FSTAB CONFIG VIMLANG PAGE TIMEZONE LANG"
local -r ERROR_MSG_pt1='The variable \"${L_arrow}${config_param}${R_arrow}\" value ${L_arrow}${BOLD}${!config_param}${R_arrow} is invalid,'
local -r ERROR_MSG_pt2=' check the config file ${BOLD}${GREEN}\<$(echo $PROGNAME | tr [a-z] [A-Z])/config\> or \<common/config\>${OFF}'
@ -177,7 +177,7 @@ inline_doc
TIMEZONE) echo -e "`eval echo $PARAM_VALS`" ;;
# Validate general parameters..
HPKG) validate_against_str "x0x x1x" ;;
GETPKG) validate_against_str "x0x x1x" ;;
RUNMAKE) validate_against_str "x0x x1x" ;;
REPORT) validate_against_str "x0x x1x"
if [[ "${!config_param}" = "1" ]]; then

102
common/urls.xsl Normal file
View file

@ -0,0 +1,102 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="text"/>
<!-- The FTP server used as fallback -->
<xsl:param name="server">ftp://ftp.osuosl.org</xsl:param>
<!-- The libc model used for HLFS -->
<xsl:param name="model" select="glibc"/>
<xsl:template match="/">
<xsl:apply-templates select="//ulink"/>
</xsl:template>
<xsl:template match="ulink">
<!-- If some package don't have the predefined strings in their
name, the next test must be fixed to match it also. Skip possible
duplicated URLs due that may be splitted for PDF output -->
<xsl:if test="(ancestor::varlistentry[@condition=$model]
or not(ancestor::varlistentry[@condition])) and
(contains(@url, '.tar.') or contains(@url, '.tgz')
or contains(@url, '.patch') or contains(@url, '.rules')) and
not(ancestor-or-self::*/@condition = 'pdf')">
<!-- Extract the package name -->
<xsl:variable name="package">
<xsl:call-template name="package.name">
<xsl:with-param name="url" select="@url"/>
</xsl:call-template>
</xsl:variable>
<!-- Extract the directory for that package -->
<xsl:variable name="cut"
select="translate(substring-after($package, '-'),
'0123456789', '0000000000')"/>
<xsl:variable name="package2">
<xsl:value-of select="substring-before($package, '-')"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="$cut"/>
</xsl:variable>
<xsl:variable name="dirname" select="substring-before($package2, '-0')"/>
<!-- Write the upstream URLs, except the redirected ones -->
<xsl:if test="not(contains(@url,'?'))">
<xsl:value-of select="@url"/>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:value-of select="$server"/>
<xsl:text>/pub/lfs/conglomeration/</xsl:text>
<xsl:choose>
<!-- Fix some directories. Test against package2 to be sure that we
are matching the start of a package name, not a string in a patch name -->
<xsl:when test="contains($package2, 'bash')">
<xsl:text>bash/</xsl:text>
</xsl:when>
<xsl:when test="contains($package2, 'gcc')">
<xsl:text>gcc/</xsl:text>
</xsl:when>
<xsl:when test="contains($package2, 'glibc')">
<xsl:text>glibc/</xsl:text>
</xsl:when>
<xsl:when test="contains($package2, 'tcl')">
<xsl:text>tcl/</xsl:text>
</xsl:when>
<xsl:when test="contains($package2, 'uClibc')">
<xsl:text>uClibc/</xsl:text>
</xsl:when>
<xsl:when test="contains($package2, 'udev')">
<xsl:text>udev/</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$dirname"/>
<xsl:text>/</xsl:text>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="$package"/>
<xsl:text>&#x0a;</xsl:text>
</xsl:if>
</xsl:template>
<xsl:template name="package.name">
<xsl:param name="url"/>
<xsl:choose>
<xsl:when test="contains($url, '/')">
<xsl:call-template name="package.name">
<xsl:with-param name="url" select="substring-after($url, '/')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="contains($url, '?')">
<xsl:value-of select="substring-before($url, '?')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View file

@ -148,7 +148,7 @@ while test $# -gt 0 ; do
esac
;;
--get-packages | -G ) HPKG=1 ;;
--get-packages | -G ) GETPKG=1 ;;
--help | -h ) usage | more && exit ;;
@ -411,18 +411,6 @@ while test $# -gt 0 ; do
shift
done
# Find the download client to use, if not already specified.
if [ -z $DL ] ; then
if [ `type -p wget` ] ; then
DL=wget
elif [ `type -p curl` ] ; then
DL=curl
else
eval "$no_dl_client"
fi
fi
#===================================================
# Set the document location...
# BOOK is either defined in
@ -491,6 +479,7 @@ if [[ "$PWD" != "$JHALFSDIR" ]]; then
popd 1> /dev/null
fi
[[ "$REPORT" = "1" ]] && cp $COMMON_DIR/create-sbu_du-report.sh $JHALFSDIR/
[[ "$GETPKG" = "1" ]] && cp $COMMON_DIR/urls.xsl $JHALFSDIR/
sed 's,FAKEDIR,'$BOOK',' $PACKAGE_DIR/$XSL > $JHALFSDIR/${XSL}
export XSL=$JHALFSDIR/${XSL}
fi