Skip to content

Commit

Permalink
add makechrootpkg support (#19)
Browse files Browse the repository at this point in the history
remove powerpill support, it's a pain to get working in the nspawn,
and people set PACMAN themselves if they want to
  • Loading branch information
Alad Wenter committed Mar 10, 2016
1 parent ffe094e commit 250de7d
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions aurbuild
Expand Up @@ -30,6 +30,7 @@ repofind() {
else
target=${!rset[*]}
fi

msg "Using [$target] repository"
pool=${rset[$target]}
else
Expand All @@ -39,7 +40,7 @@ repofind() {
}

build() {
if PACMAN="$cmd" PKGDEST="$pool" LC_MESSAGES=C makepkg -Lsc; then
if PKGDEST="$pool" LC_MESSAGES=C makepkg -Lsc; then
if repose -vf "$target".db -r "$pool" -p "$pool"; then
# https://github.com/AladW/aurutils/issues/19
sudo pacsync "$target"
Expand All @@ -51,6 +52,24 @@ build() {
fi
}

build_chroot() {
declare CHROOT=/var/cache/aurbuild

if [[ ! -d $CHROOT/root ]]; then
if sudo mkarchroot -C /etc/pacman.conf "$CHROOT"/root base base-devel; then
return 1
fi
fi

if sudo -E PKGDEST="$pool" makechrootpkg -d "$pool" -u -r "$CHROOT"; then
if ! repose -vf "$target".db -r "$pool" -p "$pool"; then
return 1
fi
else
return 1
fi
}

trap 'exit' INT

source /usr/share/makepkg/util.sh || exit 1
Expand All @@ -67,11 +86,9 @@ fi

repofind

hash powerpill 2>/dev/null && cmd=powerpill || cmd=pacman

while read -r -u 3 p; do
if cd "$pwd/$p"; then
build || break
build_chroot || break
fi
done

Expand Down

0 comments on commit 250de7d

Please sign in to comment.