index : devtools32 | |
Archlinux32 fork of devtools | gitolite user |
summaryrefslogtreecommitdiff |
author | Sébastien Luttringer <seblu@seblu.net> | 2013-03-02 05:21:08 +0100 |
---|---|---|
committer | Pierre Schmitz <pierre@archlinux.de> | 2013-03-10 10:33:58 +0100 |
commit | 280d5501b00945fdf4e8de13724ec22b87a41576 (patch) | |
tree | 77bec2545b698eb1b4f07a769f6b531a72fc9f8c /makechrootpkg.in | |
parent | dee4d05b1ea4533979933d32953ffa4481c6c66e (diff) |
-rw-r--r-- | makechrootpkg.in | 20 |
diff --git a/makechrootpkg.in b/makechrootpkg.in index fb91100..9021b3e 100644 --- a/makechrootpkg.in +++ b/makechrootpkg.in @@ -21,6 +21,7 @@ add_to_db=false run_namcap=false chrootdir= passeddir= +declare -a install_pkgs default_copy=$USER [[ -n $SUDO_USER ]] && default_copy=$SUDO_USER @@ -66,7 +67,7 @@ while getopts 'hcudr:I:l:n' arg; do u) update_first=true ;; d) add_to_db=true ;; r) passeddir="$OPTARG" ;; - I) install_pkg="$OPTARG" ;; + I) install_pkgs+=("$OPTARG") ;; l) copy="$OPTARG" ;; n) run_namcap=true; makepkg_args="$makepkg_args -i" ;; *) makepkg_args="$makepkg_args -$arg $OPTARG" ;; @@ -98,7 +99,7 @@ if (( EUID )); then die 'This script must be run as root.' fi -if [[ ! -f PKGBUILD && -z $install_pkg ]]; then +if [[ ! -f PKGBUILD && -z "${install_pkgs[*]}" ]]; then die 'This must be run in a directory containing a PKGBUILD.' fi @@ -152,14 +153,17 @@ if [[ ! -d $copydir ]] || $clean_first; then exec 8>&- fi -if [[ -n $install_pkg ]]; then - pkgname="${install_pkg##*/}" - cp "$install_pkg" "$copydir/$pkgname" +if [[ -n "${install_pkgs[*]}" ]]; then + declare -i ret=0 + for install_pkg in "${install_pkgs[@]}"; do + pkgname="${install_pkg##*/}" + cp "$install_pkg" "$copydir/$pkgname" - mkarchroot -r "pacman -U /$pkgname --noconfirm" "$copydir" - ret=$? + mkarchroot -r "pacman -U /$pkgname --noconfirm" "$copydir" + (( ret += !! $? )) - rm "$copydir/$pkgname" + rm "$copydir/$pkgname" + done # If there is no PKGBUILD we have done [[ -f PKGBUILD ]] || exit $ret |