Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/makechrootpkg.in
diff options
context:
space:
mode:
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in20
1 files changed, 19 insertions, 1 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 2407115..90a812d 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -28,6 +28,7 @@ keepbuilddir=0
update_first=0
clean_first=0
run_namcap=0
+run_checkpkg=0
temp_chroot=0
bindmounts_ro=()
@@ -72,6 +73,7 @@ usage() {
echo ' Useful for maintaining multiple copies'
echo " Default: $copy"
echo '-n Run namcap on the package'
+ echo '-C Run checkpkg on the package'
echo '-T Build in a temporary directory'
echo '-U Run makepkg as a specified user'
exit 1
@@ -289,7 +291,7 @@ move_products() {
}
# }}}
-while getopts 'hcur:I:l:nTD:d:U:' arg; do
+while getopts 'hcur:I:l:nCTD:d:U:' arg; do
case "$arg" in
c) clean_first=1 ;;
D) bindmounts_ro+=("--bind-ro=$OPTARG") ;;
@@ -299,6 +301,7 @@ while getopts 'hcur:I:l:nTD:d:U:' arg; do
I) install_pkgs+=("$OPTARG") ;;
l) copy="$OPTARG" ;;
n) run_namcap=1; makepkg_args+=(--install) ;;
+ C) run_checkpkg=1 ;;
T) temp_chroot=1; copy+="-$$" ;;
U) makepkg_user="$OPTARG" ;;
h|*) usage ;;
@@ -385,6 +388,11 @@ if arch-nspawn "$copydir" \
"${bindmounts_ro[@]}" "${bindmounts_rw[@]}" \
/chrootbuild "${makepkg_args[@]}"
then
+ pkgnames=()
+ for pkgfile in "$copydir"/pkgdest/*; do
+ pkgfile=${pkgfile##*/};
+ pkgnames+=("${pkgfile%-*-*-*}");
+ done
move_products
else
(( ret += 1 ))
@@ -399,5 +407,15 @@ if (( ret != 0 )); then
die "Build failed, check %s/build" "$copydir"
fi
else
+ if (( run_checkpkg )); then
+ msg "Running checkpkg"
+ msg2 "Downloading current versions"
+ if pacman --noconfirm -Swdd --logfile /dev/null "${pkgnames[@]}"; then
+ msg2 "Checking packages"
+ sudo -u "$makepkg_user" checkpkg
+ else
+ warning "Skipped checkpkg due to missing packages"
+ fi
+ fi
true
fi