diff --git a/BLFS/libs/scripts.xsl b/BLFS/libs/scripts.xsl index ebbfa17..da6391c 100644 --- a/BLFS/libs/scripts.xsl +++ b/BLFS/libs/scripts.xsl @@ -74,15 +74,25 @@ #!/bin/sh set -e + + + SRC_ARCHIVE=$SRC_ARCHIVE + FTP_SERVER=$FTP_SERVER PACKAGE= + + PKG_DIR= + + + - cd ~/sources/ - - rm -rf $UNPACKDIR + + cd ~/sources/$PKG_DIR + rm -rf $UNPACKDIR + @@ -100,11 +110,8 @@ - mkdir -p ~/sources/ - - cd ~/sources/ - - + mkdir -p ~/sources/$PKG_DIR + cd ~/sources/$PKG_DIR @@ -112,10 +119,8 @@ - tar -xvf - - > /tmp/unpacked - UNPACKDIR=`head -n1 /tmp/unpacked | sed 's@^./@@;s@/.*@@'` + tar -xvf $PACKAGE > unpacked + UNPACKDIR=`head -n1 unpacked | sed 's@^./@@;s@/.*@@'` cd $UNPACKDIR @@ -124,7 +129,6 @@ - @@ -190,39 +194,31 @@ + + if [[ ! -f $PACKAGE ]] ; then - cp $SRC_ARCHIVE/ - - / - - || \ - cp $SRC_ARCHIVE/ - - || \ + if [[ -f $SRC_ARCHIVE/$PKG_DIR/$PACKAGE ]] ; then + cp $SRC_ARCHIVE/$PKG_DIR/$PACKAGE $PACKAGE + elif [[ -f $SRC_ARCHIVE/$PACKAGE ]] ; then + cp $SRC_ARCHIVE/$PACKAGE $PACKAGE else - wget $FTP_SERVER/BLFS/conglomeration/ - - / - - || \ + wget $FTP_SERVER/BLFS/conglomeration/$PKG_DIR/$PACKAGE || \ - wget + wget || \ - wget + wget - + fi fi echo " - - - " | md5sum -c - + $PACKAGE" | md5sum -c - @@ -230,7 +226,6 @@ -