[pacman-dev] makepkg Patch for consistancy

Daniel McGee toofishes at hotmail.com
Wed Nov 15 21:38:05 EST 2006


This patch implements two consistency issues I think are present in 
makepkg. Once again, use what you want, not trying to force a patch down 
your throat.

1. DISTCC was a variable without 'USE_' or 'NO' attached, so I changed 
it to USE_DISTCC.
2. Undocumented options are present in the makepkg script so I made 
these options available in makepkg.conf with explanations. The script 
also needed slightly changing to accommodate these.

Dan
________

diff -Naur pacman-lib.orig/etc/makepkg.conf.in 
pacman-lib/etc/makepkg.conf.in
--- pacman-lib.orig/etc/makepkg.conf.in	2006-11-15 15:22:46.000000000 -0500
+++ pacman-lib/etc/makepkg.conf.in	2006-11-15 16:36:58.000000000 -0500
@@ -6,7 +6,7 @@
  # SOURCE ACQUISITION
  #########################################################################
  #
-#-- The FTP/HTTP download utility that makepkg should use to acquire 
sources
+#-- The FTP/HTTP download utility makepkg should use to acquire sources
  FTPAGENT="/usr/bin/wget --continue --passive-ftp --tries=3 
--waitretry=3 --no-check-certificate"
  #FTPAGENT="/usr/bin/snarf"
  #FTPAGENT="/usr/bin/lftpget -c"
@@ -18,7 +18,7 @@
  CARCH="@CARCH@"
  CHOST="@CHOST@"

-#-- Exclusive: will only run on i686 or higher (P6, Athlon)
+#-- Exclusive: will only run on @CARCHFLAGS@
  CFLAGS="- at MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe"
  CXXFLAGS="- at MARCHFLAG@=@CARCHFLAGS@ -O2 -pipe"
  #-- Optimized: will run on any x86, but optimized for i686
@@ -34,7 +34,7 @@
  #-- Fakeroot: for building packages as a non-root user
  USE_FAKEROOT="y"
  #-- DistCC: a distributed C/C++/ObjC compiler (modify MAKEFLAGS too)
-DISTCC="n"
+USE_DISTCC="n"
  #-- A space-delimited list of hosts running in the DistCC cluster
  DISTCC_HOSTS=""
  #-- Colorized output messages
@@ -44,10 +44,15 @@
  # GLOBAL PACKAGE OPTIONS
  #########################################################################
  #
-#-- Don't strip symbols from binaries/libraries
-NOSTRIP=0
-#-- Keep doc and info directories
+#-- Keep doc and info directories?
  KEEPDOCS=0
+#-- Don't strip symbols from binaries/libraries?
+NOSTRIP=0
+#-- Don't remove libtool files?
+#NOLIBTOOL=0
+#-- Don't remove empty directories from package?
+#NOEMPTYDIRS=0

  #########################################################################
  # PACKAGE OUTPUT
@@ -59,13 +64,13 @@
  #PACKAGER="John Doe <john at doe.com>"

  #########################################################################
-# Functionality Configuration
-#   Most of this will probably not need to be changed by and end user
+# FUNCTIONALITY CONFIGURATION
+#   (not likely to need changes by the end user)
  #########################################################################
  #
  BUILDSCRIPT="PKGBUILD"
  PKGEXT="pkg.tar.gz"
-INTEGRITY_CHECK="sha1"
+INTEGRITY_CHECK="md5"

  source "/etc/abs/abs.conf"
  SRCROOT=$ABSROOT
diff -Naur pacman-lib.orig/scripts/makepkg pacman-lib/scripts/makepkg
--- pacman-lib.orig/scripts/makepkg	2006-11-15 15:22:46.000000000 -0500
+++ pacman-lib/scripts/makepkg	2006-11-15 16:37:01.000000000 -0500
@@ -267,9 +267,10 @@
  	echo "  -h, --help       This help"
  	echo "  -i, --install    Install package after successful build"
  	echo "  -j <jobs>        Set MAKEFLAGS to \"-j<jobs>\" before building"
+	echo "  -k, --keepdocs   Keep doc and info directories"
  	echo "  -L, --log        Log package build process"
  	echo "  -m, --nocolor    Disable colorized output messages"
-	echo "  -n, --nostrip    Do not strip binaries/libraries"
+	echo "  -n, --nostrip    Do not strip symbols from binaries/libraries"
  	echo "  -o, --nobuild    Download and extract files only"
  	echo "  -p <buildscript> Use an alternate build script (instead of 
'$BUILDSCRIPT')"
  	echo "  -r, --rmdeps     Remove installed dependencies after a 
successful build"
@@ -314,6 +315,7 @@
  		--noextract)  NOEXTRACT=1 ;;
  		--install)    INSTALL=1 ;;
  		--force)      FORCE=1 ;;
+		--keepdocs)   KEEPDOCS=1 ;;
  		--nostrip)    NOSTRIP=1 ;;
  		--nobuild)    NOBUILD=1 ;;
  		--nocolor)    USE_COLOR="n" ;;
@@ -329,7 +331,7 @@
  			exit 1
  			;;
  		-*)
-			while getopts "bBcCdefghij:Lmnop:rsSw:-" opt; do
+			while getopts "bBcCdefghij:kLmnop:rsSw:-" opt; do
  				case $opt in
  					b) DEP_SRC=1 ;;
  					B) USE_CCACHE=0 ;;
@@ -345,6 +347,7 @@
  						;;
  					i) INSTALL=1 ;;
  					j) export MAKEFLAGS="-j$OPTARG" ;;
+					k) KEEPDOCS=1 ;;
                      L) LOGGING=1 ;;
  					m) USE_COLOR="n" ;;
  					n) NOSTRIP=1 ;;
@@ -694,7 +697,7 @@
  fi

  # use distcc if requested
-if [ "$DISTCC" = "y" ]; then
+if [ "$USE_DISTCC" = "y" ]; then
  	[ -d /usr/lib/distcc/bin ] && export PATH=/usr/lib/distcc/bin:$PATH
  fi

@@ -785,13 +788,13 @@
  fi

  # remove libtool (.la) files
-if [ "`check_option NOLIBTOOL`" ]; then
+if [ "`check_option NOLIBTOOL`" -a "$NOLIBTOOL" = "1" ]; then
  	msg "Removing libtool .la files..."
  	find pkg -type f -name "*.la" -exec rm -f -- '{}' \;
  fi

  # remove empty directories
-if [ "`check_option NOEMPTYDIRS`" ]; then
+if [ "`check_option NOEMPTYDIRS`" -a "$NOEMPTYDIRS" = "1" ]; then
  	msg "Removing empty directories..."
  	find pkg -mindepth 1 -type d -empty -exec rmdir {} \;
  fi




More information about the pacman-dev mailing list