@@ -24,6 +24,7 @@ customized_password=false
2424customized_kernel=false
2525customized_logpath=false
2626pkglist_args=()
27+ makepkg_script_args=()
2728modules=()
2829DEFAULT_ARGUMENT=" "
2930alteriso_version=" 3.1"
@@ -473,22 +474,12 @@ prepare_build() {
473474 eval " $( bash " ${tools_dir} /locale.sh" -s -a " ${arch} " get " ${locale_name} " ) "
474475 eval " $( bash " ${tools_dir} /kernel.sh" -s -c " ${channel_name} " -a " ${arch} " get " ${kernel} " ) "
475476
476- # Set username
477- if [[ " ${customized_username} " = false ]]; then
478- username=" ${defaultusername} "
479- fi
480-
481- # Set password
482- if [[ " ${customized_password} " = false ]]; then
483- password=" ${defaultpassword} "
484- fi
477+ # Set username and password
478+ [[ " ${customized_username} " = false ]] && username=" ${defaultusername} "
479+ [[ " ${customized_password} " = false ]] && password=" ${defaultpassword} "
485480
486481 # gitversion
487- if [[ " ${gitversion} " = true ]]; then
488- cd " ${script_path} "
489- iso_version=" ${iso_version} -$( git rev-parse --short HEAD) "
490- cd " ${OLDPWD} "
491- fi
482+ [[ " ${gitversion} " = true ]] && iso_version=" ${iso_version} -$( cd " ${script_path} " ; git rev-parse --short HEAD) "
492483
493484 # Generate iso file name.
494485 local _channel_name=" ${channel_name% .add} -${locale_version} "
@@ -524,11 +515,15 @@ prepare_build() {
524515
525516 # Set argument of pkglist.sh
526517 pkglist_args=(" -a" " ${arch} " " -k" " ${kernel} " " -c" " ${channel_dir} " " -l" " ${locale_name} " )
527- if [[ " ${boot_splash} " = true ]]; then pkglist_args+=(" -b" ); fi
528- if [[ " ${debug} " = true ]]; then pkglist_args+=(" -d" ); fi
529- if [[ " ${memtest86} " = true ]]; then pkglist_args+=(" -m" ); fi
530- if (( "${# additional_exclude_pkg[@]} " >= 1 )) ; then pkglist_args+=(" -e" " ${additional_exclude_pkg[*]} " ); fi
518+ [[ " ${boot_splash} " = true ]] && pkglist_args+=(" -b" )
519+ [[ " ${debug} " = true ]] && pkglist_args+=(" -d" )
520+ [[ " ${memtest86} " = true ]] && pkglist_args+=(" -m" )
521+ (( "${# additional_exclude_pkg[@]} " >= 1 )) && pkglist_args+=(" -e" " ${additional_exclude_pkg[*]} " ); fi
531522 pkglist_args+=(" ${modules[@]} " )
523+
524+ # Set argument of aur.sh and pkgbuild.sh
525+ [[ " ${bash_debug} " = true ]] && makepkg_script_args+=(" -x" )
526+ [[ " ${pacman_debug} " = true ]] && makepkg_script_args+=(" -d" )
532527}
533528
534529
@@ -595,7 +590,7 @@ make_packages_aur() {
595590 cp -rf --preserve=mode " ${script_path} /system/aur.sh" " ${airootfs_dir} /root/aur.sh"
596591
597592 # Run aur script
598- _run_with_pacmanconf _chroot_run " bash $( [[ " ${bash_debug} " = true ]] && echo -n " -x " ) /root/aur.sh ${ _pkglist_aur[* ]}"
593+ _run_with_pacmanconf _chroot_run " bash" " /root/aur.sh" " ${makepkg_script_args[@]} " " ${ _pkglist_aur[@ ]}"
599594
600595 # Remove script
601596 remove " ${airootfs_dir} /root/aur.sh"
@@ -618,7 +613,7 @@ make_pkgbuild() {
618613 cp -rf --preserve=mode " ${script_path} /system/pkgbuild.sh" " ${airootfs_dir} /root/pkgbuild.sh"
619614
620615 # Run build script
621- _run_with_pacmanconf _chroot_run " bash $( [[ " ${bash_debug} " = true ]] && echo -n " -x " ) /root/pkgbuild.sh /pkgbuilds"
616+ _run_with_pacmanconf _chroot_run " bash" " /root/pkgbuild.sh" " ${makepkg_script_args[@]} " " /pkgbuilds"
622617
623618 # Remove script
624619 remove " ${airootfs_dir} /root/pkgbuild.sh"
0 commit comments