[pacman-dev] [PATCH] makepkg: several small bits of tidying

Allan McRae allan at archlinux.org
Thu Nov 13 12:08:52 EST 2008


1. Do not warn people about missing arch if they are using --ignorearch.

2. Remove unneed reference to bug report about using fakeroot as little
   as possible.  We want to do that, bug report of not.

3. Removes superfluous warning given when building as root. The user
   has already used the "--asroot" flag.

4. Move comment about skipping warning message to above where it occurs

5. Do not warn about skipping source retreval, integrety checks and
   extraction when using --repackage

6. Do not warn about skipping build when using --repackage

7. Move comment about fakeroot usage to above test condition

Signed-off-by: Allan McRae <allan at archlinux.org>
---
 scripts/makepkg.sh.in |   31 +++++++++----------------------
 1 files changed, 9 insertions(+), 22 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index b0d1dad..f5cdd90 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1409,10 +1409,6 @@ if ! in_array $CARCH ${arch[@]}; then
 		plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
 		plain "$(gettext "such as arch=('%s').")" "$CARCH"
 		exit 1
-	else
-		warning "$(gettext "%s is not available for the '%s' architecture.")" "$pkgname" "$CARCH"
-		plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
-		plain "$(gettext "such as arch=('%s').")" "$CARCH"
 	fi
 fi
 
@@ -1460,11 +1456,8 @@ if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}" \
 fi
 
 # Run the bare minimum in fakeroot
-# fix flyspray bug 6208 -- using makepkg with fakeroot gives an error
 if [ "$INFAKEROOT" = "1" ]; then
-	if [ "$REPKG" = "1" ]; then
-		warning "$(gettext "Skipping build.")"
-	else
+	if [ "$REPKG" = "0" ]; then
 		run_build
 		tidy_install
 	fi
@@ -1477,10 +1470,6 @@ fi
 
 msg "$(gettext "Making package: %s")" "$pkgname $pkgver-$pkgrel $CARCH ($(date))"
 
-if [ $EUID -eq 0 ]; then
-	warning "$(gettext "Running makepkg as root...")"
-fi
-
 # if we are creating a source-only package, go no further
 if [ "$SOURCEONLY" != "0" ]; then
 	if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}${SRCEXT}" \
@@ -1495,10 +1484,10 @@ fi
 
 # fix flyspray bug #5973
 if [ "$NODEPS" = "1" -o "$NOBUILD" = "1" -o "$REPKG" = "1" ]; then
+	# no warning message needed for nobuild, repkg
 	if [ "$NODEPS" = "1" ]; then
 		warning "$(gettext "Skipping dependency checks.")"
 	fi
-	# skip printing a warning message for the others: nobuild, repkg
 elif [ $(type -p pacman) ]; then
 	unset pkgdeps # Set by resolve_deps() and used by remove_deps()
 	deperr=0
@@ -1524,7 +1513,7 @@ umask 0022
 mkdir -p "$srcdir"
 cd "$srcdir"
 
-if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
+if [ "$NOEXTRACT" = "1" ]; then
 	warning "$(gettext "Skipping source retrieval        -- using existing src/ tree")"
 	warning "$(gettext "Skipping source integrity checks -- using existing src/ tree")"
 	warning "$(gettext "Skipping source extraction       -- using existing src/ tree")"
@@ -1533,11 +1522,11 @@ if [ "$NOEXTRACT" = "1" -o "$REPKG" = "1" ]; then
 		error "$(gettext "The source directory is empty, there is nothing to build!")"
 		plain "$(gettext "Aborting...")"
 		exit 1
-	elif [ "$REPKG" = "1" -a \( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" \) ]; then
-		error "$(gettext "The package directory is empty, there is nothing to repackage!")"
-		plain "$(gettext "Aborting...")"
-		exit 1
 	fi
+elif [ "$REPKG" = "1" -a \( ! -d "$pkgdir" -o "$(ls "$pkgdir" 2>/dev/null)" = "" \) ]; then
+	error "$(gettext "The package directory is empty, there is nothing to repackage!")"
+	plain "$(gettext "Aborting...")"
+	exit 1
 else
 	download_sources
 	check_checksums
@@ -1556,11 +1545,9 @@ else
 	mkdir -p "$pkgdir"
 	cd "$startdir"
 
+	# if we are root or if fakeroot is not enabled, then we don't use it
 	if [ "$(check_buildenv fakeroot)" != "y" -o $EUID -eq 0 ]; then
-		# if we are root or if fakeroot is not enabled, then we don't use it
-		if [ "$REPKG" = "1" ]; then
-			warning "$(gettext "Skipping build.")"
-		else
+		if [ "$REPKG" = "0" ]; then
 			devel_update
 			run_build
 			tidy_install
-- 
1.6.0.4




More information about the pacman-dev mailing list