[pacman-dev] Maybe some problems with pacman-git

Karolina Lindqvist karolina.lindqvist at kramnet.se
Tue Jan 8 04:44:00 EST 2008


I have a patch-file that I apply to makepkg in pacman-git, with some problems 
and enhancement. I made a new diff with the current version, and this is 
possible problem areas. Since I have more "feature" patches, I have tried to 
extract just the problems, in case someone think that the fix might be 
valuable. All proper UNIFIED diff patch snippets are for makepkg.sh.in

BUG: When pacman recurses, and the --asroot option is given it fails to 
propagate --asroot to the inner pacman.
The second part of the patch is that the correct options are not propagated to 
a recursing makepkg. I think this is primarily --noconfirm 
and --noprogressbar

@@ -363,13 +373,15 @@
 
 			local makepkg_opts='-i -c -b'
 			[ "$RMDEPS" = "1" ] && makepkg_opts="$makepkg_opts -r"
+			[ "$ASROOT" = "1" ] && makepkg_opts="$makepkg_opts -r --asroot"
 			local ret packagedir
 			for packagedir in $candidates; do
 				if [ -f "$packagedir/$BUILDSCRIPT" ]; then
 					cd "$packagedir"
 					ret=0
-					PKGDEST="$PKGDEST" makepkg $makepkg_opts || ret=$?
					[ $ret -eq 0 ] && continue 2
+					PKGDEST="$PKGDEST" makepkg $PACMAN_OPTS $makepkg_opts || ret=$?
 				fi
 			done


bsdtar failed to unzip one of the zip files in one of the packages, so 
therefore I have this patch.

@@ -616,10 +628,12 @@
 		local file_type=$(file -bizL "$file")
 		local cmd=''
 		case "$file_type" in
-			*application/x-tar*|*application/zip*|*application/x-zip*|
*application/x-cpio*)
+			*application/x-tar*|*application/x-cpio*)
 				cmd="bsdtar -x -f $file" ;;
 			*application/x-gzip*)
 				cmd="gunzip -d -f $file" ;;
+			*application/zip*|*application/x-zip*)
+				cmd="unzip -q $file" ;;
 			*application/x-bzip*)
 				cmd="bunzip2 -f $file" ;;
 			*)

This one I have, since bsdtar outputs tons, and tons of error/warning 
messages, about something that it cannot handle attributes. Highly annoying.

@@ -858,7 +876,7 @@
 
 	local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
 
-	if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
+	if ! bsdtar -czf "$pkg_file" $comp_files $(ls) 2>/dev/null ; then
 		error "$(gettext "Failed to create package file.")"
 		exit 1 # TODO: error code
 	fi


BUG: Pacman fails to work properly with --asroot, and when it recalls itself, 
on some particular packages. 

@@ -1425,6 +1454,7 @@
 		rm -rf "$pkgdir"
 	fi
 	mkdir -p "$pkgdir"
+	cd "$startdir"
 
 	if [ $EUID -eq 0 ]; then
 		# if we are root, then we don't need to recall makepkg with fakeroot
@@ -1439,7 +1469,6 @@
 		create_package
 	else
 		msg "$(gettext "Entering fakeroot environment...")"
-		cd "$startdir"
 
 		if [ "$newpkgver" != "" ]; then
 			fakeroot -- $0 --forcever $newpkgver -F $ARGLIST || exit $?


This is just a nice "feature" patch, so that you know what is going on when 
you use -b. 
@@ -969,7 +987,7 @@
 install_package() {
 	[ "$INSTALL" = "0" ] && return
 
-	msg "$(gettext "Installing package with pacman -U...")"
+	msg "$(gettext "Installing package ${pkgname} with pacman -U...")"
 	if [ "$ASROOT" = "0" ]; then
 		sudo pacman $PACMAN_OPTS -U 
$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT} || exit $?
 	else




More information about the pacman-dev mailing list