From 4954fdff0147232fb4f691a46b8369e81a2590fa Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Thu, 29 Jun 2017 08:22:13 +0000 Subject: [PATCH] Use BUILD_DIR and SRC_DIR in bootscripts/systemd-units download instructions --- BLFS/xsl/scripts.xsl | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/BLFS/xsl/scripts.xsl b/BLFS/xsl/scripts.xsl index 609b107..8fabd90 100644 --- a/BLFS/xsl/scripts.xsl +++ b/BLFS/xsl/scripts.xsl @@ -426,39 +426,37 @@ fi - [[ ! -d $SRC_DIR/blfs- - - ]] && mkdir $SRC_DIR/blfs- - - -pushd $SRC_DIR/blfs- + BOOTPKG_DIR=blfs- +BOOTSRC_DIR=${SRC_ARCHIVE}${SRC_SUBDIRS:+/${BOOTPKG_DIR}} +BOOTBUILD_DIR=${BUILD_ROOT}${BUILD_SUBDIRS:+/${BOOTPKG_DIR}} +mkdir -p $BOOTSRC_DIR +mkdir -p $BOOTBUILD_DIR + +pushd $BOOTSRC_DIR URL= BOOTPACKG=$(basename $URL) if [[ ! -f $BOOTPACKG ]] ; then - if [[ -f $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG ]] ; then - cp $SRC_ARCHIVE/$PKG_DIR/$BOOTPACKG $BOOTPACKG - elif [[ -f $SRC_ARCHIVE/$BOOTPACKG ]] ; then + if [[ -f $SRC_ARCHIVE/$BOOTPACKG ]] ; then cp $SRC_ARCHIVE/$BOOTPACKG $BOOTPACKG else wget -T 30 -t 5 $URL - cp $BOOTPACKG $SRC_ARCHIVE fi - rm -f unpacked + rm -f $BOOTBUILD_DIR/unpacked fi +cd $BOOTBUILD_DIR if [[ -e unpacked ]] ; then BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` if ! [[ -d $BOOTUNPACKDIR ]]; then - rm unpacked - tar -xvf $BOOTPACKG > unpacked + tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` fi else - tar -xvf $BOOTPACKG > unpacked + tar -xvf $BOOTSRC_DIR/$BOOTPACKG > unpacked BOOTUNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` fi cd $BOOTUNPACKDIR