diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-13 00:44:38 -0500 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-13 00:44:38 -0500 |
commit | 444cc22bc5cda7a4adc26982d3edbcfd1af426ed (patch) | |
tree | f3e7c3f25f8fe22887c55b86baa9955c6fce9707 /src/pkgbuild-check-nonfree | |
parent | c611090157e9c7d04e6f411c0c5f9ca5834835fd (diff) |
add an '-f' flag to pkgbuild-check-nonfree to let libremakepkg run as root
Diffstat (limited to 'src/pkgbuild-check-nonfree')
-rwxr-xr-x | src/pkgbuild-check-nonfree | 5 |
1 files changed, 4 insertions, 1 deletions
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 |