lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master b4d014c 3/6: Download 'lmi_setup_inc.sh' befo


From: Greg Chicares
Subject: [lmi-commits] [lmi] master b4d014c 3/6: Download 'lmi_setup_inc.sh' before sourcing it
Date: Thu, 5 Mar 2020 11:31:46 -0500 (EST)

branch: master
commit b4d014c464ee8de404e368475e0c2219cf30267f
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Download 'lmi_setup_inc.sh' before sourcing it
    
    'lmi_setup_inc.sh' no longer requires routine local customizations (such
    as insertion of actual UID and GID) before use, so it is appropriate to
    download it and then source it. (Previously, a possibly stale copy was
    sourced, then refreshed with wget (although the wget command had been
    commented out), then sourced again.)
    
    All 'lmi_setup_*' scripts are downloaded at the same time, because it
    seems more important to keep the similar wget commands together than to
    defer downloading the other scripts until just before they're invoked.
    
    Sourcing 'lmi_setup_inc.sh' changes shell options, so repeating
    'set -evx' immediately afterwards really is intentional.
---
 install_redhat.sh | 41 +++++++++++++++++++----------------------
 1 file changed, 19 insertions(+), 22 deletions(-)

diff --git a/install_redhat.sh b/install_redhat.sh
index a894541..04d4511 100755
--- a/install_redhat.sh
+++ b/install_redhat.sh
@@ -21,16 +21,11 @@
 # email: <address@hidden>
 # snail: Chicares, 186 Belle Woods Drive, Glastonbury CT 06033, USA
 
-. ./lmi_setup_inc.sh
-
 set -evx
 
 stamp0=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
 echo "Started: $stamp0"
 
-assert_su
-assert_not_chrooted
-
 # Override any too-restrictive corporate default (e.g., 077).
 umask 022
 
@@ -52,6 +47,25 @@ else
   GIT_URL_BASE=https://github.com/vadz/lmi/raw/master
 fi
 
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_10.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_11.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_20.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_21.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_30.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_40.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_41.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_42.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_43.sh
+wget -N -nv "${GIT_URL_BASE}"/lmi_setup_inc.sh
+chmod +x lmi_setup_*.sh
+
+. ./lmi_setup_inc.sh
+
+set -evx
+
+assert_su
+assert_not_chrooted
+
 # First, destroy any chroot left by a prior run.
 grep "${CHRTNAME}" /proc/mounts | cut -f2 -d" " | xargs umount || echo "None?"
 rm -rf /srv/chroot/"${CHRTNAME}"
@@ -132,23 +146,6 @@ mount --bind /srv/cache_for_lmi 
/srv/chroot/"${CHRTNAME}"/cache_for_lmi || echo
 mkdir -p /var/cache/"${CODENAME}"
 mount --bind /var/cache/"${CODENAME}" 
/srv/chroot/"${CHRTNAME}"/var/cache/apt/archives || echo "Oops."
 
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_10.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_11.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_20.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_21.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_30.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_40.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_41.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_42.sh
-wget -N -nv "${GIT_URL_BASE}"/lmi_setup_43.sh
-# Don't download this--it will have been customized locally.
-#wget -N -nv "${GIT_URL_BASE}"/lmi_setup_inc.sh
-chmod +x lmi_setup_*.sh
-
-. ./lmi_setup_inc.sh
-
-set -evx
-
 # ./lmi_setup_10.sh
 # ./lmi_setup_11.sh
 cp -a lmi_setup_*.sh /srv/chroot/${CHRTNAME}/tmp



reply via email to

[Prev in Thread] Current Thread [Next in Thread]