I've found --asroot to be kind of a hand holding hindrance so I decided
to remove it. Here's the patch if anyone is interested. Cheers.
>From bad738d80b6fd5d842411dc82a51be8958b2df72 Mon Sep 17 00:00:00 2001
From: Loui Chang <[EMAIL PROTECTED]>
Date: Sat, 14 Jun 2008 15:30:03 -0400
Subject: [PATCH] Remove --asroot switch from makepkg.

Make running makepkg as root seem less like the apocalypse.

Signed-off-by: Loui Chang <[EMAIL PROTECTED]>
---
 doc/makepkg.8.txt     |    5 -----
 scripts/makepkg.sh.in |   19 +++++--------------
 2 files changed, 5 insertions(+), 19 deletions(-)

diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index 59108f1..44ddc8e 100644
--- a/doc/makepkg.8.txt
+++ b/doc/makepkg.8.txt
@@ -35,11 +35,6 @@ your logs and output are not localized.
 
 Options
 -------
-*\--asroot*::
-	Allow makepkg to run as root. This is for security purposes as it is
-	normally dangerous to do so. This will also disable use of fakeroot and
-	sudo.
-
 *-A, \--ignorearch*::
 	Ignore a missing or incomplete arch field in the build script. This is
 	for rebuilding packages from source when the PKGBUILD may be slightly
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 175edb8..fc8f028 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -364,7 +364,6 @@ handledeps() {
 
 			local makepkg_opts='-i -c -b'
 			[ "$RMDEPS" = "1" ] && makepkg_opts="$makepkg_opts -r"
-			[ "$ASROOT" = "1" ] && makepkg_opts="$makepkg_opts --asroot"
 			local ret packagedir
 			for packagedir in $candidates; do
 				if [ -f "$packagedir/$BUILDSCRIPT" ]; then
@@ -1088,7 +1087,6 @@ usage() {
 	# fix flyspray feature request #2978
 	echo "$(gettext "  -R, --repackage  Repackage contents of pkg/ without building")"
 	echo "$(gettext "  -s, --syncdeps   Install missing dependencies with pacman")"
-	echo "$(gettext "      --asroot     Allow makepkg to run as root user")"
 	echo "$(gettext "      --holdver    Prevent automatic version bumping for development PKGBUILDs")"
 	echo "$(gettext "      --source     Do not build package; generate a source-only tarball")"
 	echo
@@ -1146,7 +1144,7 @@ SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined
 
 # Parse Command Line Options.
 OPT_SHORT="AbcCdefFghiLmop:rRsSV"
-OPT_LONG="ignorearch,asroot,builddeps,clean,cleancache,nodeps,noextract,force,forcever:,geninteg,help,holdver"
+OPT_LONG="ignorearch,builddeps,clean,cleancache,nodeps,noextract,force,forcever:,geninteg,help,holdver"
 OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,source,syncdeps,usesudo,version"
 # Pacman Options
 OPT_LONG="$OPT_LONG,noconfirm,noprogressbar"
@@ -1165,7 +1163,6 @@ while true; do
 		--noprogressbar)  PACMAN_OPTS="$PACMAN_OPTS --noprogressbar" ;;
 
 		# Makepkg Options
-		--asroot)         ASROOT=1 ;;
 		-A|--ignorearch)  IGNOREARCH=1 ;;
 		-b|--builddeps)   DEP_SRC=1 ;;
 		-c|--clean)       CLEANUP=1 ;;
@@ -1245,17 +1242,11 @@ if [ -z $BUILDSCRIPT ]; then
 fi
 
 if [ "$INFAKEROOT" = "0" ]; then
-	if [ $EUID -eq 0 -a "$ASROOT" = "0" ]; then
+	if [ $EUID -eq 0 ]; then
+		ASROOT="0"
 		# Warn those who like to live dangerously.
-		error "$(gettext "Running makepkg as root is a BAD idea and can cause")"
-		plain "$(gettext "permanent, catastrophic damage to your system. If you")"
-		plain "$(gettext "wish to run as root, please use the --asroot option.")"
-		exit 1 # $E_USER_ABORT
-	elif [ $EUID -gt 0 -a "$ASROOT" = "1" ]; then
-		# Warn those who try to use the --asroot option when they are not root
-		error "$(gettext "The --asroot option is meant for the root user only.")"
-		plain "$(gettext "Please rerun makepkg without the --asroot flag.")"
-		exit 1 # $E_USER_ABORT
+		warning "$(gettext "Running makepkg as root is a BAD idea and can cause")"
+		plain "$(gettext "serious damage to your system.")"
 	elif [ "$(check_buildenv fakeroot)" = "y" -a $EUID -gt 0 ]; then
 		if [ ! $(type -p fakeroot) ]; then
 			error "$(gettext "Fakeroot must be installed if using the 'fakeroot' option")"
-- 
1.5.5.3

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev

Reply via email to