summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <LukeShu@sbcglobal.net>2012-11-13 00:44:38 -0500
committerLuke Shumaker <LukeShu@sbcglobal.net>2012-11-13 00:44:38 -0500
commit444cc22bc5cda7a4adc26982d3edbcfd1af426ed (patch)
treef3e7c3f25f8fe22887c55b86baa9955c6fce9707
parentc611090157e9c7d04e6f411c0c5f9ca5834835fd (diff)
add an '-f' flag to pkgbuild-check-nonfree to let libremakepkg run as root
-rwxr-xr-xsrc/chroot-tools/libremakepkg2
-rwxr-xr-xsrc/pkgbuild-check-nonfree5
2 files changed, 5 insertions, 2 deletions
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