From e1edff3b9269759125c286f10c883282932dd932 Mon Sep 17 00:00:00 2001 From: George Boudreau Date: Wed, 15 Mar 2006 21:50:40 +0000 Subject: [PATCH] Added test for tar >1.15, ability to fetch/store packages from/to a local archive. --- common/common-functions | 21 +++++++++++++++++++++ common/config | 4 ++++ common/func_check_version.sh | 4 ++-- master.sh | 2 ++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/common/common-functions b/common/common-functions index 2f99c79..795b00e 100644 --- a/common/common-functions +++ b/common/common-functions @@ -720,6 +720,16 @@ download() { # Download file, write name to MISSING_FILES.DMP if # 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 @@ -753,6 +763,17 @@ download() { # Download file, write name to MISSING_FILES.DMP if 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 + } diff --git a/common/config b/common/config index 6a83e9d..ae6123e 100644 --- a/common/config +++ b/common/config @@ -11,6 +11,10 @@ declare -r LOG=000-masterscript.log #--- Mount point for the build BUILDDIR=/mnt/SourceFiles +#--- The local repository for packages/file +# Any downloaded files will be archived here +SRC_ARCHIVE=/mnt/SourceFiles/Source_Warehouse + #--- Download the source packages 0(no)/1(yes) HPKG=0 diff --git a/common/func_check_version.sh b/common/func_check_version.sh index 5fd7e4a..84e6936 100644 --- a/common/func_check_version.sh +++ b/common/func_check_version.sh @@ -41,8 +41,8 @@ inline_doc This script requires ${ref_version} or greater\n" exit 1 } - - echo -ne "$TXT:\t<${tst_version}>" + + echo -ne "$TXT:\t${L_arrow}${BOLD}${tst_version}${OFF}${R_arrow}" IFS=".-(" # Split up w.x.y.z as well as w.x.y-rc (catch release candidates) set -- $ref_version # set postional parameters to minimum ver values ref_major=$1; ref_minor=$2; ref_revision=$3 diff --git a/master.sh b/master.sh index a687b76..858935d 100755 --- a/master.sh +++ b/master.sh @@ -262,6 +262,8 @@ BOOK=${BOOK:=$PROGNAME-$LFSVRS} check_version "2.6.2" "`uname -r`" "KERNEL" check_version "3.0" "$BASH_VERSION" "BASH" check_version "3.0" "`gcc -dumpversion`" "GCC" +tarVer=`tar --version` +check_version "1.15.0" "${tarVer##* }" "TAR" echo "---------------${nl_}" validate_config 1 # 0/1 0-do not display values