diff --git a/bin/basestrap.in b/bin/basestrap.in index df65064..5dcd947 100644 --- a/bin/basestrap.in +++ b/bin/basestrap.in @@ -48,6 +48,7 @@ usage() { # exit $(( $# ? 0 : 1 )) # fi # +orig_argv=("$0" "$@") opts=':C:cdGiM' diff --git a/bin/buildiso.in b/bin/buildiso.in index d7b6706..bad9b9b 100755 --- a/bin/buildiso.in +++ b/bin/buildiso.in @@ -135,6 +135,8 @@ usage() { exit $1 } +orig_argv=("$0" "$@") + opts='p:a:b:r:t:k:i:g:czxmvqh' while getopts "${opts}" arg; do diff --git a/bin/buildpkg.in b/bin/buildpkg.in index c023833..8d65a43 100644 --- a/bin/buildpkg.in +++ b/bin/buildpkg.in @@ -103,6 +103,8 @@ usage() { exit $1 } +orig_argv=("$0" "$@") + opts='p:a:b:r:i:cwnsuqh' while getopts "${opts}" arg; do diff --git a/bin/buildtree.in b/bin/buildtree.in index 4e5b96f..b6a7df3 100644 --- a/bin/buildtree.in +++ b/bin/buildtree.in @@ -55,6 +55,8 @@ usage() { exit $1 } +orig_argv=("$0" "$@") + opts='sacqh' while getopts "${opts}" arg; do diff --git a/bin/check-yaml.in b/bin/check-yaml.in index b5284d5..c1fb0e7 100644 --- a/bin/check-yaml.in +++ b/bin/check-yaml.in @@ -112,6 +112,8 @@ usage() { exit $1 } +orig_argv=("$0" "$@") + opts='p:a:i:k:gcvqh' while getopts "${opts}" arg; do diff --git a/bin/chroot-run.in b/bin/chroot-run.in index 9c8439f..0ec555d 100644 --- a/bin/chroot-run.in +++ b/bin/chroot-run.in @@ -43,6 +43,8 @@ usage() { exit 1 } +orig_argv=("$0" "$@") + opts='hKC:M:S:c:r:w:B:f:s' while getopts ${opts} arg; do diff --git a/bin/manjaro-chroot.in b/bin/manjaro-chroot.in index 0633340..c6769da 100644 --- a/bin/manjaro-chroot.in +++ b/bin/manjaro-chroot.in @@ -55,6 +55,8 @@ usage() { exit $1 } +orig_argv=("$0" "$@") + opts=':haq' while getopts ${opts} arg; do diff --git a/bin/mkchroot.in b/bin/mkchroot.in index 36efee1..22528d3 100644 --- a/bin/mkchroot.in +++ b/bin/mkchroot.in @@ -42,6 +42,8 @@ usage() { exit 1 } +orig_argv=("$0" "$@") + opts='hLKC:M:S:c:B:f:s' while getopts ${opts} arg; do diff --git a/bin/mkchrootpkg.in b/bin/mkchrootpkg.in index e96b6f5..1ad3a3c 100644 --- a/bin/mkchrootpkg.in +++ b/bin/mkchrootpkg.in @@ -151,7 +151,7 @@ install_packages() { pkgnames=("${install_pkgs[@]##*/}") cp -- "${install_pkgs[@]}" "$copydir/root/" - chroot-run -r "${bindmounts_ro[@]}" -w "${bindmounts_rw[@]}" "$copydir" \ + chroot-run -r "${bindmounts_ro[*]}" -w "${bindmounts_rw[*]}" "$copydir" \ pacman -U --noconfirm -- "${pkgnames[@]/#//root/}" ret=$? rm -- "${pkgnames[@]/#/$copydir/root/}" @@ -293,6 +293,8 @@ move_products() { # }}} +orig_argv=("$0" "$@") + main() { init_variables @@ -364,11 +366,8 @@ main() { sync_chroot "$chrootdir" "$copy" fi - $update_first && chroot-run \ - -r "${bindmounts_ro[@]}" \ - -w "${bindmounts_rw[@]}" \ - "$copydir" \ - pacman -Syu --noconfirm + $update_first && chroot-run -r "${bindmounts_ro[*]}" -w "${bindmounts_rw[*]}" "$copydir" \ + pacman -Syu --noconfirm if [[ -n ${install_pkgs[*]:-} ]]; then install_packages "$copydir" "${install_pkgs[@]}" @@ -383,10 +382,8 @@ main() { bindmounts_rw=("${PWD}:/startdir" "${SRCDEST}:/srcdest") - if chroot-run -r "${bindmounts_ro[@]}" \ - -w "${bindmounts_rw[@]}" \ - "$copydir" \ - /chrootbuild "${makepkg_args[@]}"; then + if chroot-run -r "${bindmounts_ro[*]}" -w "${bindmounts_rw[*]}" "$copydir" \ + /chrootbuild "${makepkg_args[@]}"; then move_products "$copydir" "$src_owner" else (( ret += 1 )) diff --git a/lib/util-msg.sh b/lib/util-msg.sh index d0e1271..bf19a71 100644 --- a/lib/util-msg.sh +++ b/lib/util-msg.sh @@ -65,7 +65,7 @@ error() { stat_busy() { local mesg=$1; shift - printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" >&2 + printf "${GREEN}==>${ALL_OFF}${BOLD} ${mesg}...${ALL_OFF}" "$@" >&2 } stat_done() { diff --git a/lib/util.sh b/lib/util.sh index 3ab8366..04fd7b6 100644 --- a/lib/util.sh +++ b/lib/util.sh @@ -760,8 +760,6 @@ run(){ fi } -orig_argv=("$0" "$@") - check_root() { (( EUID == 0 )) && return if type -P sudo >/dev/null; then