From 82522dd8c1f4cd9f19d0cae83368689971f48ebd Mon Sep 17 00:00:00 2001
From: Xavier Chantry <shiningxc@gmail.com>
Date: Mon, 10 Aug 2009 15:50:53 +0200
Subject: makepkg: new --skipinteg option

Implements FS#15830

This option allows to build a PKGBUILD with no checksums

Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
---
 scripts/makepkg.sh.in | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

(limited to 'scripts')

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index c8384f80..126379ac 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -58,6 +58,7 @@ DEP_BIN=0
 FORCE=0
 INFAKEROOT=0
 GENINTEG=0
+SKIPINTEG=0
 INSTALL=0
 NOBUILD=0
 NODEPS=0
@@ -613,8 +614,12 @@ check_checksums() {
 	done
 
 	if [ $correlation -eq 0 ]; then
-		error "$(gettext "Integrity checks are missing.")"
-		exit 1 # TODO: error code
+		if [ $SKIPINTEG -eq 1 ]; then
+			warning "$(gettext "Integrity checks are missing.")"
+		else
+			error "$(gettext "Integrity checks are missing.")"
+			exit 1 # TODO: error code
+		fi
 	fi
 }
 
@@ -1399,6 +1404,7 @@ usage() {
 	echo "$(gettext "  -e, --noextract  Do not extract source files (use existing src/ dir)")"
 	echo "$(gettext "  -f, --force      Overwrite existing package")"
 	echo "$(gettext "  -g, --geninteg   Generate integrity checks for source files")"
+	echo "$(gettext "      --skipinteg  Do not fail when integrity checks are missing")"
 	echo "$(gettext "  -h, --help       This help")"
 	echo "$(gettext "  -i, --install    Install package after successful build")"
 	echo "$(gettext "  -L, --log        Log package build process")"
@@ -1447,8 +1453,8 @@ ARGLIST=$@
 OPT_SHORT="AcCdefFghiLmop:rRsV"
 OPT_LONG="allsource,asroot,ignorearch,clean,cleancache,nodeps"
 OPT_LONG="$OPT_LONG,noextract,force,forcever:,geninteg,help,holdver"
-OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,source"
-OPT_LONG="$OPT_LONG,syncdeps,version,config:"
+OPT_LONG="$OPT_LONG,install,log,nocolor,nobuild,rmdeps,repackage,skipinteg"
+OPT_LONG="$OPT_LONG,source,syncdeps,version,config:"
 # Pacman Options
 OPT_LONG="$OPT_LONG,noconfirm,noprogressbar"
 OPT_TEMP="$(parse_options $OPT_SHORT $OPT_LONG "$@" || echo 'PARSE_OPTIONS FAILED')"
@@ -1487,6 +1493,7 @@ while true; do
 		-p)               shift; BUILDFILE=$1 ;;
 		-r|--rmdeps)      RMDEPS=1 ;;
 		-R|--repackage)   REPKG=1 ;;
+		--skipinteg)      SKIPINTEG=1 ;;
 		--source)         SOURCEONLY=1 ;;
 		-s|--syncdeps)    DEP_BIN=1 ;;
 
-- 
cgit v1.2.3-2-g168b


From 7ddb645bd7cf7e1c56a508321df511864da411a4 Mon Sep 17 00:00:00 2001
From: Xavier Chantry <shiningxc@gmail.com>
Date: Wed, 5 Aug 2009 16:12:46 +0200
Subject: makepkg: always keep sources symlinks

Make bunzip2/xz/gunzip decompressing to stdout, because gzip does not offer
something like a -k option.

The selection of the decompression command for gzip/bzip2/xz compressed
files now also depends on the file suffix, since we need to strip the
extensions to get the output filename.

Thanks to Cedric Staniewski <cedric@gmx.ca> for reporting this issue and
contributing patches.
Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
---
 scripts/makepkg.sh.in | 27 +++++++++++++++++++++------
 1 file changed, 21 insertions(+), 6 deletions(-)

(limited to 'scripts')

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 126379ac..80d38670 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -646,16 +646,26 @@ extract_sources() {
 
 		# fix flyspray #6246
 		local file_type=$(file -bizL "$file")
+		local ext=${file##*.}
 		local cmd=''
 		case "$file_type" in
 			*application/x-tar*|*application/zip*|*application/x-zip*|*application/x-cpio*)
-				cmd="bsdtar -x -f" ;;
+				cmd="bsdtar" ;;
 			*application/x-gzip*)
-				cmd="gunzip -d -f" ;;
+				case "$ext" in
+					gz|z|Z) cmd="gzip" ;;
+					*) continue;;
+				esac ;;
 			*application/x-bzip*)
-				cmd="bunzip2 -f" ;;
+				case "$ext" in
+					bz2|bz) cmd="bzip2" ;;
+					*) continue;;
+				esac ;;
 			*application/x-xz*)
-				cmd="xz -d -f" ;;
+				case "$ext" in
+					xz) cmd="xz" ;;
+					*) continue;;
+				esac ;;
 			*)
 				# Don't know what to use to extract this file,
 				# skip to the next file
@@ -663,8 +673,13 @@ extract_sources() {
 		esac
 
 		local ret=0
-		msg2 '%s' "$cmd \"$file\""
-		$cmd "$file" || ret=$?
+		msg2 "$(gettext "extracting %s with %s")" "$file" "$cmd"
+		if [ "$cmd" = "bsdtar" ]; then
+			$cmd -xf "$file" || ret=?
+		else
+			rm -f "${file%.*}"
+			$cmd -dcf "$file" > "${file%.*}" || ret=?
+		fi
 		if [ $ret -ne 0 ]; then
 			error "$(gettext "Failed to extract %s")" "$file"
 			plain "$(gettext "Aborting...")"
-- 
cgit v1.2.3-2-g168b


From 1e51b81c6392125899c94761b5aa35bb6a0e032c Mon Sep 17 00:00:00 2001
From: Francois Charette <francois@archlinux.org>
Date: Tue, 18 Aug 2009 22:10:56 +0200
Subject: fix typos in makepkg.sh.in

Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
---
 scripts/makepkg.sh.in | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'scripts')

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 80d38670..99e19b4f 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -1,6 +1,6 @@
 #!/bin/bash -e
 #
-#   makepkg - make packages compatable for use with pacman
+#   makepkg - make packages compatible for use with pacman
 #   @configure_input@
 #
 #   Copyright (c) 2006-2009 Pacman Development Team <pacman-dev@archlinux.org>
@@ -178,7 +178,7 @@ clean_up() {
 trap 'clean_up' 0
 trap 'trap_exit "$(gettext "TERM signal caught. Exiting...")"' TERM HUP QUIT
 trap 'trap_exit "$(gettext "Aborted by user! Exiting...")"' INT
-trap 'trap_exit "$(gettext "An unknown error has occured. Exiting...")"' ERR
+trap 'trap_exit "$(gettext "An unknown error has occurred. Exiting...")"' ERR
 
 # a source entry can have two forms :
 # 1) "filename::http://path/to/file"
@@ -188,11 +188,11 @@ trap 'trap_exit "$(gettext "An unknown error has occured. Exiting...")"' ERR
 get_filename() {
 	# if a filename is specified, use it
 	local filename=$(echo $1 | sed 's|::.*||')
-	# if it is just an url, we only keep the last component
+	# if it is just an URL, we only keep the last component
 	echo "$filename" | sed 's|^.*://.*/||g'
 }
 
-# extract the url from a source entry
+# extract the URL from a source entry
 get_url() {
 	# strip an eventual filename
 	echo $1 | sed 's|.*::||'
@@ -279,7 +279,7 @@ in_array() {
 }
 
 get_downloadclient() {
-	# $1 = url with valid protocol prefix
+	# $1 = URL with valid protocol prefix
 	local url=$1
 	local proto=$(echo "$url" | sed 's|://.*||')
 
@@ -315,11 +315,11 @@ get_downloadclient() {
 download_file() {
 	# download command
 	local dlcmd=$1
-	# url of the file
+	# URL of the file
 	local url=$2
 	# destination file
 	local file=$3
-	# temporary download file, default to last component of the url
+	# temporary download file, default to last component of the URL
 	local dlfile=$(echo "$url" | sed 's|^.*://.*/||g')
 
 	# replace %o by the temporary dlfile if it exists
@@ -327,7 +327,7 @@ download_file() {
 		dlcmd=${dlcmd//\%o/\"$file.part\"}
 		dlfile="$file.part"
 	fi
-	# add the url, either in place of %u or at the end
+	# add the URL, either in place of %u or at the end
 	if echo "$dlcmd" | grep -q "%u" ; then
 		dlcmd=${dlcmd//\%u/\"$url\"}
 	else
@@ -786,7 +786,7 @@ run_package() {
 			mv "$BUILDLOG" "$BUILDLOG.$i"
 		fi
 
-		# ensure overridden package variables suvrive tee with split packages
+		# ensure overridden package variables survive tee with split packages
 		logpipe=$(mktemp -u "$startdir/logpipe.XXXXXXXX")
 		mknod "$logpipe" p
 		exec 3>&1
@@ -869,7 +869,7 @@ tidy_install() {
 		local binary
 		find ${STRIP_DIRS[@]} -type f 2>/dev/null | while read binary ; do
 			case "$(file -biz "$binary")" in
-				*compressed-encoding*)      # Skip compressed binarys
+				*compressed-encoding*)      # Skip compressed binaries
 					;;
 				*application/x-sharedlib*)  # Libraries (.so)
 					/usr/bin/strip -S "$binary";;
-- 
cgit v1.2.3-2-g168b