I'll go ahead and push this, since it's a minor thing.
>From e2b6e0ec4da9a79e0599f0c034fb055a5284c0de Mon Sep 17 00:00:00 2001
From: Loui Chang <[EMAIL PROTECTED]>
Date: Sun, 15 Jun 2008 21:17:49 -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 |   18 +++++-------------
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/doc/makepkg.8.txt b/doc/makepkg.8.txt
index 068cbcb..b196fa3 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 5bdc5bc..06c9c62 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1091,7 +1091,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
@@ -1149,7 +1148,7 @@ SRCDEST=${SRCDEST:-$startdir} #default to $startdir if undefined
 
 # Parse Command Line Options.
 OPT_SHORT="AbcCdefFghiLmop:rRsV"
-OPT_LONG="allsource,asroot,ignorearch,builddeps,clean,cleancache,nodeps"
+OPT_LONG="allsource,ignorearch,builddeps,clean,cleancache,nodeps"
 OPT_LONG="$OPT_LONG,noextract,force,forcever:,geninteg,help,holdver"
 OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,source"
 OPT_LONG="$OPT_LONG,syncdeps,version"
@@ -1171,7 +1170,6 @@ while true; do
 
 		# Makepkg Options
 		--allsource)      SOURCEONLY=2 ;;
-		--asroot)         ASROOT=1 ;;
 		-A|--ignorearch)  IGNOREARCH=1 ;;
 		-c|--clean)       CLEANUP=1 ;;
 		-C|--cleancache)  CLEANCACHE=1 ;;
@@ -1245,17 +1243,11 @@ if [ -z $BUILDSCRIPT ]; then
 fi
 
 if [ "$INFAKEROOT" = "0" ]; then
-	if [ $EUID -eq 0 -a "$ASROOT" = "0" ]; then
+	if [ $EUID -eq 0 ]; then
+		ASROOT="1"
 		# 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

Reply via email to