summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbill-auger <mr.j.spam.me@gmail.com>2019-12-29 01:24:59 -0500
committerbill-auger <mr.j.spam.me@gmail.com>2020-03-27 19:32:36 -0400
commit96b03cc814b6930421c472f96ec41d4ed3aa904c (patch)
treedb8727d9be937287ac6a8fc172f3d7be24d4c8d4
parent321db4ea8292b6c8575e4e2d06c22f411acf4ce5 (diff)
bugfix '-C' CLI option semantics
-rwxr-xr-xconfigs/profile/build.sh30
1 files changed, 17 insertions, 13 deletions
diff --git a/configs/profile/build.sh b/configs/profile/build.sh
index c6bc66c..578681f 100755
--- a/configs/profile/build.sh
+++ b/configs/profile/build.sh
@@ -14,6 +14,13 @@ declare -ar VALID_INITS=('openrc' 'systemd')
declare -ar VALID_GUIS=('cli' 'lxde' 'mate')
iso_title="Parabola GNU/Linux-libre Live" # $iso_edition and $iso_version appended
+# environment
+data_dir=/usr/share/parabolaiso/data
+releng_dir=$(readlink -f ${0%/*})
+initcpio_dir=${releng_dir}/../../parabolaiso/initcpio
+packages_dir=${releng_dir}/packages
+[ "`which mkparabolaiso 2> /dev/null`" ] || export PATH=$PATH:"${releng_dir}/../../parabolaiso"
+
# CLI option defaults
iso_edition="SystemD/CLI"
iso_arch='dual'
@@ -23,25 +30,19 @@ iso_dirname='parabola'
enable_offline_install='false'
offline_switch=''
enable_tts_brltty='false'
-pacman_conf=${work_dir}/pacman.conf
+pacman_conf_in=${releng_dir}/pacman.conf
work_dir=./work
out_dir=./out
verbose=''
-# computed params, per CLI args
+# computed params, per CLI options
archs='' # deferred
iso_filename='' # deferred
iso_init='' # deferred
iso_gui='' # deferred
base_pkgs='' # deferred
arch='' # deferred
-
-# environment
-data_dir=/usr/share/parabolaiso/data
-releng_dir=$(readlink -f ${0%/*})
-initcpio_dir=${releng_dir}/../../parabolaiso/initcpio
-packages_dir=${releng_dir}/packages
-[ "`which mkparabolaiso 2> /dev/null`" ] || export PATH=$PATH:"${releng_dir}/../../parabolaiso"
+pacman_conf='' # deferred
_usage ()
@@ -64,7 +65,7 @@ _usage ()
echo " -S Enable speech and braille."
echo " Default: '${enable_tts_brltty}'"
echo " -C Specify the pacman.conf file used for chroot install."
- echo " Default: '${pacman_conf}'"
+ echo " Default: '${pacman_conf_in}'"
echo " -w <work_dir> Set the working directory"
echo " Default: ${work_dir}"
echo " -o <out_dir> Set the output directory"
@@ -101,8 +102,10 @@ make_pacman_conf() {
mv ${stash_dir}/* ${isorepo_dir} || true
fi
+ cp ${pacman_conf_in} ${pacman_conf}
+
# enable [isorepo]
- sed --regexp-extended 's|^#?\s*CacheDir.+|CacheDir = '${isorepo_dir}'|g' ${releng_dir}/pacman.conf > ${pacman_conf}
+ sed -i -E 's|^#?\s*CacheDir.+|CacheDir = '${isorepo_dir}'|g' ${pacman_conf}
# enable [nonsystemd] for openrc ISOs
if [[ "${iso_init}" == 'openrc' ]]
@@ -388,7 +391,7 @@ while getopts 'E:T:V:L:D:OSC:w:o:vh' arg; do
D) iso_dirname="${OPTARG}" ;;
O) enable_offline_install='true' offline_switch='-O' ;;
S) enable_tts_brltty='true' ;;
- C) pacman_conf="${OPTARG}" ;;
+ C) pacman_conf_in="${OPTARG}" ;;
w) work_dir="${OPTARG}" ;;
o) out_dir="${OPTARG}" ;;
v) verbose="-v" ;;
@@ -400,7 +403,7 @@ while getopts 'E:T:V:L:D:OSC:w:o:vh' arg; do
esac
done
-# set target arch, GRUB title, and ISO filename
+# set target arch, GRUB title, ISO filename, and pacman.conf sources
case "${iso_arch}" in
'i686'|'x86_64')
archs=${iso_arch}
@@ -428,6 +431,7 @@ iso_init=$( echo ${iso_edition} | cut -d '/' -f 1 | tr '[:upper:]' '[:
iso_gui=$( echo ${iso_edition} | cut -d '/' -f 2 | tr '[:upper:]' '[:lower:]' )
[[ "${iso_init}" == 'openrc' ]] && base_group='base-openrc' || base_group='base'
[[ "${archs}" == 'i686' ]] && arch='i686' || arch='x86_64'
+pacman_conf=${work_dir}/pacman.conf
## sanity checks ##