[pacman-dev] [PATCH] makepkg: support .tar.Z source packages creation

lolilolicon lolilolicon at gmail.com
Fri Sep 30 01:30:46 EDT 2011


Also address an uninitialized use of $ret.
---
 scripts/makepkg.sh.in |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d426661..8f76656 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1332,6 +1332,7 @@ create_signature() {
 }
 
 create_srcpackage() {
+	local ret=0
 	msg "$(gettext "Creating source package...")"
 	local srclinks="$(mktemp -d "$startdir"/srclinks.XXXXXXXXX)"
 	mkdir "${srclinks}"/${pkgbase}
@@ -1369,6 +1370,7 @@ create_srcpackage() {
 		*tar.gz)  TAR_OPT="z" ;;
 		*tar.bz2) TAR_OPT="j" ;;
 		*tar.xz)  TAR_OPT="J" ;;
+		*tar.Z)   TAR_OPT="Z" ;;
 		*tar)     TAR_OPT=""  ;;
 		*) warning "$(gettext "'%s' is not a valid archive extension.")" \
 		"$SRCEXT" ;;
@@ -1380,7 +1382,9 @@ create_srcpackage() {
 	# tar it up
 	msg2 "$(gettext "Compressing source package...")"
 	cd "${srclinks}"
-	if ! bsdtar -c${TAR_OPT}Lf "$pkg_file" ${pkgbase}; then
+	bsdtar -c${TAR_OPT}Lf "$pkg_file" ${pkgbase}
+	ret=$?
+	if (( ret )); then
 		error "$(gettext "Failed to create source package file.")"
 		exit 1 # TODO: error code
 	fi
-- 
1.7.6.4



More information about the pacman-dev mailing list