[pacman-dev] CVS update of pacman-lib/scripts (makepkg)

Dan McGee dan at archlinux.org
Sun Mar 18 19:09:50 EDT 2007


    Date: Sunday, March 18, 2007 @ 19:09:50
  Author: dan
    Path: /home/cvs-pacman/pacman-lib/scripts

Modified: makepkg (1.59 -> 1.60)

* Added quoting on several makepkg paths that were lacking it.


---------+
 makepkg |   36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)


Index: pacman-lib/scripts/makepkg
diff -u pacman-lib/scripts/makepkg:1.59 pacman-lib/scripts/makepkg:1.60
--- pacman-lib/scripts/makepkg:1.59	Wed Mar 14 19:25:03 2007
+++ pacman-lib/scripts/makepkg	Sun Mar 18 19:09:50 2007
@@ -245,8 +245,8 @@
 				fi
 				success=0
 				for pkgdir in $candidates; do
-					if [ -f $pkgdir/$BUILDSCRIPT ]; then
-						cd $pkgdir
+					if [ -f "$pkgdir/$BUILDSCRIPT" ]; then
+						cd "$pkgdir"
 						if [ "$RMDEPS" = "1" ]; then
 							makepkg -i -c -b -r -w $PKGDEST
 						else
@@ -541,11 +541,11 @@
 	error "pkgrel is not allowed to be empty."
 	exit 1
 fi
-if [ $(echo $pkgver | grep '-') ]; then
+if [ $(echo "$pkgver" | grep '-') ]; then
 	error "pkgver is not allowed to contain hyphens."
 	exit 1
 fi
-if [ $(echo $pkgrel | grep '-') ]; then
+if [ $(echo "$pkgrel" | grep '-') ]; then
 	error "pkgrel is not allowed to contain hyphens."
 	exit 1
 fi
@@ -561,7 +561,7 @@
 	exit 1
 fi
 
-if [ -f $PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT} \
+if [ -f "$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}.${PKGEXT}" \
      -a "$FORCE" = "0" -a "$GENINTEG" = "0" ]; then
 	if [ "$INSTALL" = "1" ]; then
 		warning "a package has already been built, installing existing package."
@@ -630,12 +630,12 @@
 	warning "pacman was not found in PATH. skipping dependency checks."
 fi
 
-cd $startdir
+cd "$startdir"
 
 # retrieve sources
 msg "Retrieving Sources..."
 mkdir -p src
-cd $startdir/src
+cd "$startdir/src"
 for netfile in ${source[@]}; do
 	file=$(strip_url "$netfile")
 	if [ -f "../$file" ]; then
@@ -810,7 +810,7 @@
 	
 	if [ "$EUID" = "0" ]; then
 		# chown all source files to root.root
-		chown -R root.root $startdir/src
+		chown -R root.root "$startdir/src"
 	fi
 fi
 
@@ -821,11 +821,11 @@
 	warning "Skipping build"
 else
 	# check for existing pkg directory
-	if [ -d $startdir/pkg ]; then
+	if [ -d "$startdir/pkg" ]; then
 		msg "Removing existing pkg/ directory..."
-		rm -rf $startdir/pkg
+		rm -rf "$startdir/pkg"
 	fi
-	mkdir -p $startdir/pkg
+	mkdir -p "$startdir/pkg"
 
 	# use distcc if it is requested (check buildenv and PKGBUILD opts)
 	if [ "$(check_buildenv distcc)" = "y" -a "$(check_option distcc)" != "n" ]; then
@@ -896,14 +896,14 @@
 if [ "$(check_option docs)" = "n" ]; then
 	# remove info/doc files
 	msg "Removing info/doc files..."
-	cd $startdir/pkg
+	cd "$startdir/pkg"
 	#fix flyspray bug #5021
 	rm -rf ${DOC_DIRS[@]}
 fi
 
 # move /usr/share/man files to /usr/man
 if [ -d $startdir/pkg/usr/share/man ]; then
-	cd $startdir
+	cd "$startdir"
 	mkdir -p pkg/usr/man 
 	cp -a pkg/usr/share/man/* pkg/usr/man/
 	rm -rf pkg/usr/share/man
@@ -911,12 +911,12 @@
 
 # compress man pages
 msg "Compressing man pages..."
-find $startdir/pkg/{usr{,/local},opt/*}/man -type f 2>/dev/null | while read i ; do
+find "$startdir"/pkg/{usr{,/local},opt/*}/man -type f 2>/dev/null | while read i ; do
 	ext="${i##*.}"
 	fn="${i##*/}"
 	if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then
 		# update symlinks to this manpage
-		find $startdir/pkg/{usr{,/local},opt/*}/man -lname "$fn" 2> /dev/null | while read ln ; do
+		find "$startdir"/pkg/{usr{,/local},opt/*}/man -lname "$fn" 2> /dev/null | while read ln ; do
 			rm -f "$ln"
 			ln -sf "${fn}.gz" "${ln}.gz"
 		done
@@ -925,7 +925,7 @@
 	fi
 done
 
-cd $startdir
+cd "$startdir"
 
 # strip binaries
 if [ "$(check_option strip)" = "y" ]; then
@@ -959,7 +959,7 @@
 else
 	packager="Arch Linux (http://www.archlinux.org)"
 fi
-size=$(du -cb $startdir/pkg | tail -n 1 | awk '{print $1}')
+size=$(du -cb "$startdir/pkg" | tail -n 1 | awk '{print $1}')
 
 # build a filelist - do this first to keep meta files out of the list
 msg "Generating .FILELIST file..."
@@ -968,7 +968,7 @@
 
 # write the .PKGINFO file
 msg "Generating .PKGINFO file..."
-cd $startdir/pkg
+cd "$startdir/pkg"
 echo "# Generated by makepkg $myver" >.PKGINFO
 echo -n "# " >>.PKGINFO
 date >>.PKGINFO




More information about the pacman-dev mailing list