From 444cc22bc5cda7a4adc26982d3edbcfd1af426ed Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 13 Nov 2012 00:44:38 -0500 Subject: add an '-f' flag to pkgbuild-check-nonfree to let libremakepkg run as root --- src/chroot-tools/libremakepkg | 2 +- src/pkgbuild-check-nonfree | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 3fa2f3d..4593121 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -113,7 +113,7 @@ main() { if $CHECKNONFREE; then msg "Checking PKGBUILD for non-free issues" - if ! pkgbuild-check-nonfree; then + if ! pkgbuild-check-nonfree -f; then if [[ $? -eq 15 ]]; then # other errors mean fail, not nonfree error "PKGBUILD contains non-free issues" diff --git a/src/pkgbuild-check-nonfree b/src/pkgbuild-check-nonfree index fba4b7b..0fd480c 100755 --- a/src/pkgbuild-check-nonfree +++ b/src/pkgbuild-check-nonfree @@ -146,12 +146,15 @@ usage() { echo "If no PKGBUILD is specified, \`./PKGBUILD' is implied" echo "" echo "Options:" + echo " -f Allow running as root user" echo " -h Show this message" } main() { + local asroot=false while getopts 'fh' arg; do case "$arg" in + f) asroot=true;; h) usage; exit 0;; *) usage; exit 1;; esac @@ -162,7 +165,7 @@ main() { pkgbuilds=("`pwd`/PKGBUILD") fi - if [[ -w / ]]; then + if [[ -w / ]] && ! $asroot; then error "Run as normal user" exit 1 fi -- cgit v1.2.2