From 39fe2d0e39956961bdcb9c4bd78ca11247f044bd Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Fri, 2 Jan 2015 21:37:31 +1000 Subject: [PATCH 1/4] Remove outdated fakeroot information from PKGBUILD man page Signed-off-by: Allan McRae --- doc/PKGBUILD.5.txt | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/doc/PKGBUILD.5.txt b/doc/PKGBUILD.5.txt index 7fa91ffe..c95c41d8 100644 --- a/doc/PKGBUILD.5.txt +++ b/doc/PKGBUILD.5.txt @@ -216,7 +216,7 @@ underscore and the architecture name e.g., 'checkdepends_x86_64=()'. and are not utilized by pacman during dependency resolution. The format for specifying optdepends is: - optdepends=('fakeroot: for makepkg usage as normal user') + optdepends=('python: for library bindings') + Additional architecture-specific optdepends can be added by appending an underscore and the architecture name e.g., 'optdepends_x86_64=()'. @@ -336,10 +336,9 @@ files into the packaging directory, with optional `prepare()`, `build()`, and *package() Function*:: The `package()` function is used to install files into the directory that will become the root directory of the built package and is run after all - the optional functions listed below. When specified in combination with - the fakeroot BUILDENV option in linkman:makepkg.conf[5], fakeroot usage - will be limited to running the packaging stage. All other functions will - be run as the user calling makepkg. + the optional functions listed below. The packaging stage is run using + fakeroot to ensure correct file permissions in the resulting package. + All other functions will be run as the user calling makepkg. *prepare() Function*:: An optional `prepare()` function can be specified in which operations to From ca5a2771aeb0babca8270b83b0cb0172db4cebe5 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Wed, 31 Dec 2014 14:33:31 -0500 Subject: [PATCH 2/4] updpkgsums: retain permissions on rewritten PKGBUILD This could have been easy with something like chown's --reference flag, but this is GNU specific. Instead, just truncate and rewrite the file. Our exit trap cleans up after us. Fixes: https://bugs.archlinux.org/task/43272 Signed-off-by: Allan McRae --- contrib/updpkgsums.sh.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/contrib/updpkgsums.sh.in b/contrib/updpkgsums.sh.in index b0d2d69e..7b92efe3 100644 --- a/contrib/updpkgsums.sh.in +++ b/contrib/updpkgsums.sh.in @@ -82,9 +82,6 @@ fi export BUILDDIR=$(mktemp -d --tmpdir updpkgsums.XXXXXX) newbuildfile=$(mktemp --tmpdir updpkgsums.XXXXXX) -# In case the eventual replacement fails, we don't want to leave behind -# $newbuildfile as garbage in $TMPDIR. This fails silently if the replacement -# succeeds. trap "rm -rf '$BUILDDIR' '$newbuildfile'" EXIT newsums=$(makepkg -g -p "$buildfile") || die 'Failed to generate new checksums' awk -v newsums="$newsums" ' @@ -100,8 +97,9 @@ awk -v newsums="$newsums" ' END { if (!w) print newsums } ' "$buildfile" > "$newbuildfile" || die 'Failed to write new PKGBUILD' -# Replace the original buildfile. -if ! mv -- "$newbuildfile" "$buildfile"; then +# Rewrite the original buildfile. Use cat instead of mv/cp to preserve +# permissions implicitly. +if ! cat -- "$newbuildfile" >"$buildfile"; then die "Failed to update %s. The file has not been modified." "$buildfile" fi From 80e6d8a6fe3c94e9a385322494b27885837b7b3a Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Mon, 29 Dec 2014 22:35:53 -0500 Subject: [PATCH 3/4] makepkg: avoid expansion of var in arithmetic context This bombs out when "$trusted" expands to the empty string. We're better off passing the var by name and letting bash default to "0" when the var is empty Fixes: https://bugs.archlinux.org/task/43269 Signed-off-by: Allan McRae --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 18b2822c..1cd8756d 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -1498,7 +1498,7 @@ check_pgpsigs() { esac errors=1 else - if (( ${#validpgpkeys[@]} == 0 && ! $trusted )); then + if (( ${#validpgpkeys[@]} == 0 && !trusted )); then printf "%s ($(gettext "the public key %s is not trusted"))" $(gettext "FAILED") "$fingerprint" >&2 errors=1 elif (( ${#validpgpkeys[@]} > 0 )) && ! in_array "$fingerprint" "${validpgpkeys[@]}"; then From 89b9e9d1dced68587b704cb9e9a2aab55fb60b06 Mon Sep 17 00:00:00 2001 From: "Jason St. John" Date: Mon, 29 Dec 2014 02:28:40 -0500 Subject: [PATCH 4/4] Fix typo in a comment in makepkg.conf Signed-off-by: Jason St. John Signed-off-by: Allan McRae --- etc/makepkg.conf.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/makepkg.conf.in b/etc/makepkg.conf.in index 9ed7ef91..19f673d1 100644 --- a/etc/makepkg.conf.in +++ b/etc/makepkg.conf.in @@ -19,7 +19,7 @@ DLAGENTS=('ftp::/usr/bin/curl -qfC - --ftp-pasv --retry 3 --retry-delay 3 -o %o # /usr/bin/lftpget -c # /usr/bin/wget -#-- The the package required by makepkg to download VCS sources +#-- The package required by makepkg to download VCS sources # Format: 'protocol::package' VCSCLIENTS=('bzr::bzr' 'git::git'