summaryrefslogtreecommitdiffstats
path: root/makechrootpkg.in
diff options
context:
space:
mode:
authorJan Alexander Steffens (heftig) <jan.steffens@gmail.com>2011-09-17 15:59:57 +0200
committerLukas Fleischer <archlinux@cryptocrack.de>2011-10-07 21:53:03 +0200
commite66a1f3cd85b22cd5113684acdad50e5c077662e (patch)
treebde358a6ad072d9318ba498328b73231b8414fa6 /makechrootpkg.in
parent7a9f808a0fd80c14b32223fa73d5368294994e49 (diff)
downloaddevtools-e66a1f3cd85b22cd5113684acdad50e5c077662e.tar.gz
devtools-e66a1f3cd85b22cd5113684acdad50e5c077662e.tar.xz
makechrootpkg: Add option to explicitly run namcap
Installs namcap if needed, *after* building the package, contrary to the former way of having to have namcap installed, e.g. via makedepends. Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'makechrootpkg.in')
-rw-r--r--makechrootpkg.in10
1 files changed, 8 insertions, 2 deletions
diff --git a/makechrootpkg.in b/makechrootpkg.in
index 04893b8..6bedf03 100644
--- a/makechrootpkg.in
+++ b/makechrootpkg.in
@@ -16,6 +16,7 @@ update_first=false
clean_first=false
install_pkg=
add_to_db=false
+run_namcap=false
chrootdir=
default_copy=$USER
@@ -49,11 +50,12 @@ usage() {
echo '-I <pkg> Install a package into the working copy of the chroot'
echo '-l <copy> The directory to use as the working copy of the chroot'
echo ' Useful for maintaining multiple copies.'
+ echo '-n Run namcap on the package'
echo " Default: $default_copy"
exit 1
}
-while getopts 'hcudr:I:l:' arg; do
+while getopts 'hcudr:I:l:n' arg; do
case "$arg" in
h) usage ;;
c) clean_first=true ;;
@@ -62,6 +64,7 @@ while getopts 'hcudr:I:l:' arg; do
r) chrootdir="$OPTARG" ;;
I) install_pkg="$OPTARG" ;;
l) copy="$OPTARG" ;;
+ n) run_namcap=true ;;
*) makepkg_args="$makepkg_args -$arg $OPTARG" ;;
esac
done
@@ -259,7 +262,10 @@ sudo -u nobody makepkg $makepkg_args || touch BUILD_FAILED
[[ -f BUILD_FAILED ]] && exit 1
-which namcap &>/dev/null && namcap /build/PKGBUILD /pkgdest/*.pkg.tar.* > /build/namcap.log
+if $run_namcap; then
+ pacman -S --needed --noconfirm namcap
+ namcap /build/PKGBUILD /pkgdest/*.pkg.tar.* > /build/namcap.log
+fi
exit 0
EOF