makechrootpkg: move init_variables() to be part of main()
The reason it wasn't moved before was just to keep the diffs (with --ignore-all-space) smaller, to make merging and rebasing work easier. Moving code around in a file tends to make that difficult. But, readability wise, it belongs in main().
This commit is contained in:
parent
ddd508efc0
commit
e4db687d10
|
@ -15,29 +15,6 @@ m4_include(lib/archroot.sh)
|
||||||
|
|
||||||
shopt -s nullglob
|
shopt -s nullglob
|
||||||
|
|
||||||
init_variables() {
|
|
||||||
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
|
|
||||||
makepkg_args=("${default_makepkg_args[@]}")
|
|
||||||
keepbuilddir=false
|
|
||||||
update_first=false
|
|
||||||
clean_first=false
|
|
||||||
run_namcap=false
|
|
||||||
temp_chroot=false
|
|
||||||
chrootdir=
|
|
||||||
passeddir=
|
|
||||||
makepkg_user=
|
|
||||||
declare -ga install_pkgs
|
|
||||||
declare -gi ret=0
|
|
||||||
|
|
||||||
bindmounts_ro=()
|
|
||||||
bindmounts_rw=()
|
|
||||||
|
|
||||||
copy=$USER
|
|
||||||
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
|
||||||
[[ -z "$copy" || $copy = root ]] && copy=copy
|
|
||||||
src_owner=${SUDO_USER:-$USER}
|
|
||||||
}
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
|
echo "Usage: ${0##*/} [options] -r <chrootdir> [--] [makepkg args]"
|
||||||
echo ' Run this script in a PKGBUILD dir to build a package inside a'
|
echo ' Run this script in a PKGBUILD dir to build a package inside a'
|
||||||
|
@ -325,7 +302,26 @@ move_products() {
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
init_variables
|
default_makepkg_args=(--syncdeps --noconfirm --log --holdver --skipinteg)
|
||||||
|
makepkg_args=("${default_makepkg_args[@]}")
|
||||||
|
keepbuilddir=false
|
||||||
|
update_first=false
|
||||||
|
clean_first=false
|
||||||
|
run_namcap=false
|
||||||
|
temp_chroot=false
|
||||||
|
chrootdir=
|
||||||
|
passeddir=
|
||||||
|
makepkg_user=
|
||||||
|
declare -a install_pkgs
|
||||||
|
declare -i ret=0
|
||||||
|
|
||||||
|
bindmounts_ro=()
|
||||||
|
bindmounts_rw=()
|
||||||
|
|
||||||
|
copy=$USER
|
||||||
|
[[ -n ${SUDO_USER:-} ]] && copy=$SUDO_USER
|
||||||
|
[[ -z "$copy" || $copy = root ]] && copy=copy
|
||||||
|
src_owner=${SUDO_USER:-$USER}
|
||||||
|
|
||||||
while getopts 'hcur:I:l:nTD:d:U:' arg; do
|
while getopts 'hcur:I:l:nTD:d:U:' arg; do
|
||||||
case "$arg" in
|
case "$arg" in
|
||||||
|
|
Loading…
Reference in New Issue