[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 8f1d240 2/3: Extract marked blocks into sub-s
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 8f1d240 2/3: Extract marked blocks into sub-scripts #09 --> #25 |
Date: |
Thu, 4 Jun 2020 19:43:25 -0400 (EDT) |
branch: master
commit 8f1d2406630b4c9ff72365b2da8b0e91e28dc956
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Extract marked blocks into sub-scripts #09 --> #25
Created a new step #25 to configure zsh and vim. These tools aren't
dependencies for any earlier steps, so the higher step number is okay.
---
lmi_setup_01c.sh | 35 ++---------------------------------
lmi_setup_21.sh | 34 ++--------------------------------
lmi_setup_01c.sh => lmi_setup_25.sh | 35 +++--------------------------------
3 files changed, 7 insertions(+), 97 deletions(-)
diff --git a/lmi_setup_01c.sh b/lmi_setup_01c.sh
index 3097599..702c746 100755
--- a/lmi_setup_01c.sh
+++ b/lmi_setup_01c.sh
@@ -31,43 +31,12 @@ assert_not_chrooted
./lmi_setup_05c.sh
./lmi_setup_07r.sh
-
-# BEGIN ./lmi_setup_09.sh
-# Configure zsh, for root and normal users.
-
-cp -a .zshrc ~
-cp -a ~/.zshrc /home/"${NORMAL_USER}"/.zshrc
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.zshrc
-
-# Configure vim. Rather than trying to split its contents between
-# '~/.vimrc' and '/etc/vim/vimrc.local', use '~/.vimrc' for all
-# customizations and copy that file for the normal user too.
-
-cp -a .vimrc ~
-cp -a ~/.vimrc /home/"${NORMAL_USER}"/.vimrc
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vimrc
-
-# Without this, 'zg' gives an error message; with it, vim creates a
-# spellfile the first time 'zg' is used, if none already exists.
-mkdir ~/.vim
-mkdir /home/"${NORMAL_USER}"/.vim
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vim
-# It's a much better idea to install a mature spellfile:
-mkdir ~/.vim/spell
-cp -a en.utf-8.add ~/.vim/spell/en.utf-8.add
-mkdir /home/"${NORMAL_USER}"/.vim/spell
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vim/spell
-cp -a ~/.vim/spell/en.utf-8.add /home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
-chown "${NORMAL_USER}":"${NORMAL_GROUP}"
/home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
-# and then (imperatively) run this command:
-vim -es -c ':mkspell! ~/.vim/spell/en.utf-8.add' -c ':q'
-# which will be repeated later for the normal user.
-# END ./lmi_setup_09.sh
-
./lmi_setup_10r.sh
./lmi_setup_11.sh
./lmi_setup_13.sh
+./lmi_setup_25.sh
+
cp -a /tmp/schroot_env /srv/chroot/"${CHRTNAME}"/tmp
cp -a lmi_setup_*.sh /srv/chroot/"${CHRTNAME}"/tmp
cp -a .zshrc /srv/chroot/"${CHRTNAME}"/tmp
diff --git a/lmi_setup_21.sh b/lmi_setup_21.sh
index ad1565e..e865ddb 100755
--- a/lmi_setup_21.sh
+++ b/lmi_setup_21.sh
@@ -73,6 +73,8 @@ chown "${NORMAL_USER}":"${NORMAL_GROUP}" /srv/cache_for_lmi
chsh -s /bin/zsh "${NORMAL_USER}"
+./lmi_setup_25.sh
+
# Repair /usr/share/libtool/.../ltmain.sh as indicated here:
# https://lists.gnu.org/archive/html/libtool-patches/2011-06/msg00001.html
# Do this as root because root owns the file.
@@ -94,38 +96,6 @@ EOF
patch --dry-run --strip=0 --directory=/
</home/"${NORMAL_USER}"/ltmain.sh.patch \
&& patch --strip=0 --directory=/ </home/"${NORMAL_USER}"/ltmain.sh.patch
-# BEGIN ./lmi_setup_09.sh
-# Configure zsh, for root and normal users.
-
-cp -a .zshrc ~
-cp -a ~/.zshrc /home/"${NORMAL_USER}"/.zshrc
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.zshrc
-
-# Configure vim. Rather than trying to split its contents between
-# '~/.vimrc' and '/etc/vim/vimrc.local', use '~/.vimrc' for all
-# customizations and copy that file for the normal user too.
-
-cp -a .vimrc ~
-cp -a ~/.vimrc /home/"${NORMAL_USER}"/.vimrc
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vimrc
-
-# Without this, 'zg' gives an error message; with it, vim creates a
-# spellfile the first time 'zg' is used, if none already exists.
-mkdir ~/.vim
-mkdir /home/"${NORMAL_USER}"/.vim
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vim
-# It's a much better idea to install a mature spellfile:
-mkdir ~/.vim/spell
-cp -a en.utf-8.add ~/.vim/spell/en.utf-8.add
-mkdir /home/"${NORMAL_USER}"/.vim/spell
-chown "${NORMAL_USER}":"${NORMAL_GROUP}" /home/"${NORMAL_USER}"/.vim/spell
-cp -a ~/.vim/spell/en.utf-8.add /home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
-chown "${NORMAL_USER}":"${NORMAL_GROUP}"
/home/"${NORMAL_USER}"/.vim/spell/en.utf-8.add
-# and then (imperatively) run this command:
-vim -es -c ':mkspell! ~/.vim/spell/en.utf-8.add' -c ':q'
-# which will be repeated later for the normal user.
-# END ./lmi_setup_09.sh
-
# Enable stable and security upgrades--see:
# https://www.debian.org/releases/stretch/amd64/apds03.html.en#idm4504
# for a 'stretch' example, and these messages:
diff --git a/lmi_setup_01c.sh b/lmi_setup_25.sh
similarity index 63%
copy from lmi_setup_01c.sh
copy to lmi_setup_25.sh
index 3097599..0b384ea 100755
--- a/lmi_setup_01c.sh
+++ b/lmi_setup_25.sh
@@ -24,15 +24,11 @@
. ./lmi_setup_inc.sh
. /tmp/schroot_env
-set -evx
+set -vx
assert_su
-assert_not_chrooted
+# doesn't matter whether chrooted or not
-./lmi_setup_05c.sh
-./lmi_setup_07r.sh
-
-# BEGIN ./lmi_setup_09.sh
# Configure zsh, for root and normal users.
cp -a .zshrc ~
@@ -62,31 +58,6 @@ chown "${NORMAL_USER}":"${NORMAL_GROUP}"
/home/"${NORMAL_USER}"/.vim/spell/en.ut
# and then (imperatively) run this command:
vim -es -c ':mkspell! ~/.vim/spell/en.utf-8.add' -c ':q'
# which will be repeated later for the normal user.
-# END ./lmi_setup_09.sh
-
-./lmi_setup_10r.sh
-./lmi_setup_11.sh
-./lmi_setup_13.sh
-
-cp -a /tmp/schroot_env /srv/chroot/"${CHRTNAME}"/tmp
-cp -a lmi_setup_*.sh /srv/chroot/"${CHRTNAME}"/tmp
-cp -a .zshrc /srv/chroot/"${CHRTNAME}"/tmp
-cp -a .vimrc /srv/chroot/"${CHRTNAME}"/tmp
-cp -a en.utf-8.add /srv/chroot/"${CHRTNAME}"/tmp
-cp -a install_msw.sh /srv/chroot/"${CHRTNAME}"/tmp
-
-schroot --chroot=${CHRTNAME} --user=root --directory=/tmp
./lmi_setup_20.sh
-schroot --chroot=${CHRTNAME} --user=root --directory=/tmp
./lmi_setup_21.sh
-# On a particular corporate server, root is not a sudoer.
-if sudo -l true; then
- sudo --user="${NORMAL_USER}"
./lmi_setup_30.sh
-else
- su "${NORMAL_USER}"
./lmi_setup_30.sh
-fi
-schroot --chroot=${CHRTNAME} --user="${NORMAL_USER}" --directory=/tmp
./lmi_setup_40.sh
-schroot --chroot=${CHRTNAME} --user="${NORMAL_USER}" --directory=/tmp
./lmi_setup_41.sh
-schroot --chroot=${CHRTNAME} --user="${NORMAL_USER}" --directory=/tmp
./lmi_setup_42.sh
-schroot --chroot=${CHRTNAME} --user="${NORMAL_USER}" --directory=/tmp
./lmi_setup_43.sh
stamp=$(date -u +'%Y%m%dT%H%M%SZ')
-echo "$stamp $0 [centos host]" | tee /dev/tty
+echo "$stamp $0: Configured zsh and vim." | tee /dev/tty