r3901 - in jhalfs/branches/new_features: CLFS LFS common/libs

pierre at higgs.linuxfromscratch.org pierre at higgs.linuxfromscratch.org
Sun Mar 5 00:35:09 PST 2017


Author: pierre
Date: Sun Mar  5 00:35:09 2017
New Revision: 3901

Log:
Fixes:
- when the user fstab and/or kernel config are the same as the ones in
$BUILDDIR/sources: avoid to cp on itself
- set SRC_ARCHIVE=/dev/null in BLFS tools download script if SRC_ARCHIVE is
empty

Modified:
   jhalfs/branches/new_features/CLFS/master.sh
   jhalfs/branches/new_features/LFS/master.sh
   jhalfs/branches/new_features/common/libs/func_install_blfs

Modified: jhalfs/branches/new_features/CLFS/master.sh
==============================================================================
--- jhalfs/branches/new_features/CLFS/master.sh	Sat Mar  4 03:58:31 2017	(r3900)
+++ jhalfs/branches/new_features/CLFS/master.sh	Sun Mar  5 00:35:09 2017	(r3901)
@@ -378,10 +378,13 @@
       *grub | *aboot | *colo | *silo | *arcload | *lilo | *introduction ) continue ;;
       *how-to-view*) continue  ;;
       *whatnext*) continue     ;;
-      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
+      *fstab)   [[ ! -z ${FSTAB} ]] &&
+                [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
+                cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *kernel)  # if there is no kernel config file do not build the kernel
-                [[ -z $CONFIG ]] && continue
+                [[ -z $BOOT_CONFIG ]] && continue
                   # Copy the config file to /sources with a standardized name
+                [[ ${BOOT_CONFIG} == $BUILDDIR/sources/bootkernel-config ]] ||
                 cp $BOOT_CONFIG $BUILDDIR/sources/bootkernel-config
           ;;
     esac
@@ -734,7 +737,9 @@
       *udev)     continue ;; # This is not a script but a commentary, we want udev-rules
       *console*) continue ;; # Use the files that came with the bootscripts
 # fstab is now here (for 3.x.y)
-      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
+      *fstab)  [[ ! -z ${FSTAB} ]] &&
+               [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
+               cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *)  ;;
     esac
 
@@ -907,10 +912,13 @@
     # A little housekeeping on the scripts
     case $this_script in
       *grub | *aboot | *colo | *silo | *arcload | *lilo | *reboot* )  continue ;;
-      *fstab)  [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
+      *fstab)  [[ ! -z ${FSTAB} ]] &&
+               [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
+               cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *kernel) # if there is no kernel config file do not build the kernel
                [[ -z $CONFIG ]] && continue
                  # Copy the config file to /sources with a standardized name
+               [[ $CONFIG == $BUILDDIR/sources/kernel-config ]] ||
                cp $CONFIG $BUILDDIR/sources/kernel-config
         ;;
     esac

Modified: jhalfs/branches/new_features/LFS/master.sh
==============================================================================
--- jhalfs/branches/new_features/LFS/master.sh	Sat Mar  4 03:58:31 2017	(r3900)
+++ jhalfs/branches/new_features/LFS/master.sh	Sun Mar  5 00:35:09 2017	(r3901)
@@ -312,8 +312,11 @@
     # If no .config file is supplied, the kernel build is skipped
     case ${this_script} in
       *grub)    continue ;;
-      *fstab)   [[ ! -z ${FSTAB} ]] && cp ${FSTAB} $BUILDDIR/sources/fstab ;;
+      *fstab)   [[ ! -z ${FSTAB} ]] &&
+                [[ ${FSTAB} == $BUILDDIR/sources/fstab ]] ||
+                cp ${FSTAB} $BUILDDIR/sources/fstab ;;
       *kernel)  [[ -z ${CONFIG} ]] && continue
+                [[ ${CONFIG} == $BUILDDIR/sources/kernel-config ]] ||
                 cp ${CONFIG} $BUILDDIR/sources/kernel-config  ;;
     esac
 

Modified: jhalfs/branches/new_features/common/libs/func_install_blfs
==============================================================================
--- jhalfs/branches/new_features/common/libs/func_install_blfs	Sat Mar  4 03:58:31 2017	(r3900)
+++ jhalfs/branches/new_features/common/libs/func_install_blfs	Sun Mar  5 00:35:09 2017	(r3901)
@@ -146,7 +146,7 @@
 sudo find . -name unpacked -exec rm \{\} \;
 if [ "$GETPKG" = "y" ]; then
     FTP_SERVER=$SERVER/pub/blfs/ \
-    SRC_ARCHIVE=$SRC_ARCHIVE     \
+    SRC_ARCHIVE=${SRC_ARCHIVE:-/dev/null}     \
     $BUILDDIR$BLFS_ROOT/download_script
 else # Save the download script in case the user wants to run it later
     cp $BUILDDIR$BLFS_ROOT/download_script .


More information about the alfs-log mailing list