Commit c97a4c84 authored by Philip Müller's avatar Philip Müller

[pkg-upd] 5.1.1-1

parent 195cc48c
From 842bdfbb622db0673d4952812a490e10f61fa3bd Mon Sep 17 00:00:00 2001
Message-Id: <842bdfbb622db0673d4952812a490e10f61fa3bd.1527784094.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Thu, 31 May 2018 17:01:16 +0200
Subject: [PATCH 1/2] makepkg: Clear ERR trap before trying to restore it
$restoretrap is empty if the trap was not set. This caused the trap
handler to remain and override later exit codes.
---
scripts/makepkg.sh.in | 1 +
1 file changed, 1 insertion(+)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index e9080a70..d67fd853 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -432,6 +432,7 @@ run_function_safe() {
run_function "$1"
+ trap - ERR
eval "$restoretrap"
eval "$restoreset"
eval "$restoreshopt"
--
2.17.0
From bd164585f1a815a9f57b0c5bd2365d251500bc9f Mon Sep 17 00:00:00 2001
Message-Id: <bd164585f1a815a9f57b0c5bd2365d251500bc9f.1527784094.git.jan.steffens@gmail.com>
In-Reply-To: <842bdfbb622db0673d4952812a490e10f61fa3bd.1527784094.git.jan.steffens@gmail.com>
References: <842bdfbb622db0673d4952812a490e10f61fa3bd.1527784094.git.jan.steffens@gmail.com>
From: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>
Date: Thu, 31 May 2018 17:46:51 +0200
Subject: [PATCH 2/2] makepkg: Don't use parameterless return
It's especially dangerous in trap handlers since the return value of the
function becomes the return value of the last command before the trap,
not the last command in the current function. This applies to any
function executed in a trap handler, nested functions included.
In one case, install_packages failed (via return 14), which was inside a
conditional that then ran exit 14, which triggered the EXIT handler,
which called clean_up, which called remove_deps, which had !RMDEPS and
thus returned. The return value of remove_deps became the return value
of install_packages, triggering the ERR handler, which (due to another
problem) was still the user function handler, which then printed a
misleading error message and overrode the exit code with 4.
---
scripts/makepkg.sh.in | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index d67fd853..15524dc0 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -133,7 +133,7 @@ clean_up() {
if (( INFAKEROOT )); then
# Don't clean up when leaving fakeroot, we're not done yet.
- return
+ return 0
fi
if (( (EXIT_CODE == E_OK || EXIT_CODE == E_INSTALL_FAILED) && CLEANUP )); then
@@ -313,7 +313,7 @@ resolve_deps() {
}
remove_deps() {
- (( ! RMDEPS )) && return
+ (( ! RMDEPS )) && return 0
# check for packages removed during dependency install (e.g. due to conflicts)
# removing all installed packages is risky in this case
@@ -519,7 +519,7 @@ find_libdepends() {
if (( sodepends == 0 )); then
(( ${#depends[@]} )) && printf '%s\n' "${depends[@]}"
- return;
+ return 0;
fi
local libdeps filename soarch sofile soname soversion;
@@ -721,7 +721,7 @@ list_package_files() {
}
create_package() {
- (( NOARCHIVE )) && return
+ (( NOARCHIVE )) && return 0
if [[ ! -d $pkgdir ]]; then
error "$(gettext "Missing %s directory.")" "\$pkgdir/"
@@ -784,14 +784,14 @@ create_package() {
create_debug_package() {
# check if a debug package was requested
if ! check_option "debug" "y" || ! check_option "strip" "y"; then
- return
+ return 0
fi
pkgdir="$pkgdirbase/$pkgbase-@DEBUGSUFFIX@"
# check if we have any debug symbols to package
if dir_is_empty "$pkgdir/usr/lib/debug"; then
- return
+ return 0
fi
unset groups depends optdepends provides conflicts replaces backup install changelog
@@ -875,7 +875,7 @@ create_srcpackage() {
}
install_package() {
- (( ! INSTALL )) && return
+ (( ! INSTALL )) && return 0
if (( ! SPLITPKG )); then
msg "$(gettext "Installing package %s with %s...")" "$pkgname" "$PACMAN -U"
--
2.17.0
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
# Example: pacsort: error while loading shared libraries # Example: pacsort: error while loading shared libraries
pkgname=pacman pkgname=pacman
pkgver=5.1.0 pkgver=5.1.1
_pkgver=1.0.0 _pkgver=1.0.0
pkgrel=2 pkgrel=1
pkgdesc="A library-based package manager with dependency support" pkgdesc="A library-based package manager with dependency support"
arch=('i686' 'x86_64') arch=('i686' 'x86_64')
url="http://www.archlinux.org/pacman/" url="http://www.archlinux.org/pacman/"
...@@ -21,7 +21,8 @@ depends=('bash>=4.2.042-2' 'glibc>=2.17-2' 'libarchive>=3.1.2' 'curl>=7.39.0' ...@@ -21,7 +21,8 @@ depends=('bash>=4.2.042-2' 'glibc>=2.17-2' 'libarchive>=3.1.2' 'curl>=7.39.0'
'gpgme' 'archlinux-keyring' 'manjaro-keyring' 'pacman-mirrors>=4.1.0') 'gpgme' 'archlinux-keyring' 'manjaro-keyring' 'pacman-mirrors>=4.1.0')
checkdepends=('python2' 'fakechroot') checkdepends=('python2' 'fakechroot')
makedepends=('asciidoc' 'pacman>=5.1') makedepends=('asciidoc' 'pacman>=5.1')
optdepends=('haveged: for pacman-init.service') optdepends=('haveged: for pacman-init.service'
'perl-locale-gettext: translation support in makepkg-template')
provides=('pacman-contrib' 'pacman-init') provides=('pacman-contrib' 'pacman-init')
conflicts=('pacman-contrib' 'pacman-init') conflicts=('pacman-contrib' 'pacman-init')
replaces=('pacman-contrib' 'pacman-init') replaces=('pacman-contrib' 'pacman-init')
...@@ -36,8 +37,6 @@ source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig ...@@ -36,8 +37,6 @@ source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig
pacman.conf.i686 pacman.conf.i686
pacman.conf.x86_64 pacman.conf.x86_64
makepkg.conf makepkg.conf
0001-makepkg-Clear-ERR-trap-before-trying-to-restore-it.patch
0002-makepkg-Don-t-use-parameterless-return.patch
pacman-sync-first-option.patch pacman-sync-first-option.patch
etc-pacman.d-gnupg.mount etc-pacman.d-gnupg.mount
pacman-init.service) pacman-init.service)
...@@ -45,10 +44,6 @@ source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig ...@@ -45,10 +44,6 @@ source=(https://sources.archlinux.org/other/pacman/$pkgname-$pkgver.tar.gz{,.sig
prepare() { prepare() {
cd $srcdir/$pkgname-$pkgver cd $srcdir/$pkgname-$pkgver
# Fix install_packages failure exit code, required by makechrootpkg
patch -Np1 -i $srcdir/0001-makepkg-Clear-ERR-trap-before-trying-to-restore-it.patch
patch -Np1 -i $srcdir/0002-makepkg-Don-t-use-parameterless-return.patch
# Manjaro patches # Manjaro patches
patch -p1 -i $srcdir/pacman-sync-first-option.patch patch -p1 -i $srcdir/pacman-sync-first-option.patch
...@@ -127,15 +122,13 @@ package() { ...@@ -127,15 +122,13 @@ package() {
ln -sfv "/usr/bin/pacman-mirrors" "$pkgdir/usr/bin/rankmirrors" ln -sfv "/usr/bin/pacman-mirrors" "$pkgdir/usr/bin/rankmirrors"
} }
sha256sums=('9f5993fc8923530713742f15df284677f297b3eca15ed7a24758c98ac7399bd3' sha256sums=('be04b9162d62d2567e21402dcbabb5bedfdb03909fa5ec6e8568e02ab325bd8d'
'SKIP' 'SKIP'
'0fb95514bd16a316d4cce920d34edc88b0d0618c484e2d7588746869d2339795' '0fb95514bd16a316d4cce920d34edc88b0d0618c484e2d7588746869d2339795'
'SKIP' 'SKIP'
'b2ebeb47dd78e9df277f5d363daa079c82850a0ee65d2017689497b340b92e80' '4421dc5d63a24e926852c1ea83b575355772aaa2add71cc522cd04ca22b131d6'
'01aa62ecd3e3d37bf800cd3ab0bf55121d3dd1d51a5070175c67216167a846de' 'a9f21ebe59f1a2c8309145930ee96b8e3dc6e96e150fb77269d9958a80550950'
'eec71e0b23f2ac1f06ad6ec5890d9de62effe0883ffd16573eed2153d0c87475' 'eec71e0b23f2ac1f06ad6ec5890d9de62effe0883ffd16573eed2153d0c87475'
'9b2304141582a421e812c76760a74f360a3cbd780472cbb60cf023a34d6fcb3d' 'fe0901a02d34ccf288743397fa32526f6dd878db8337e666082bced10e24e754'
'2a31d4db5f6e19e0148d4892de14317514f2b2dfb5369c7972a641ca8be89e5a'
'd3a77bf8ea916c24a73b2a2dc4162d2b81f993394850e0f2c331a8f8893c1a0b'
'b6d14727ec465bb66d0a0358163b1bbfafcb4eaed55a0f57c30aabafae7eed68' 'b6d14727ec465bb66d0a0358163b1bbfafcb4eaed55a0f57c30aabafae7eed68'
'65d8bdccdcccb64ae05160b5d1e7f3e45e1887baf89dda36c1bd44c62442f91b') '65d8bdccdcccb64ae05160b5d1e7f3e45e1887baf89dda36c1bd44c62442f91b')
...@@ -7,7 +7,7 @@ diff -Nur a/etc/pacman.conf.in b/etc/pacman.conf.in ...@@ -7,7 +7,7 @@ diff -Nur a/etc/pacman.conf.in b/etc/pacman.conf.in
HoldPkg = pacman glibc HoldPkg = pacman glibc
+# If upgrades are available for these packages they will be asked for first +# If upgrades are available for these packages they will be asked for first
+SyncFirst = pacman +SyncFirst = pacman
#XferCommand = /usr/bin/curl -C - -f %u > %o #XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
diff -Nur a/src/pacman/conf.c b/src/pacman/conf.c diff -Nur a/src/pacman/conf.c b/src/pacman/conf.c
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
HoldPkg = pacman glibc manjaro-system HoldPkg = pacman glibc manjaro-system
# If upgrades are available for these packages they will be asked for first # If upgrades are available for these packages they will be asked for first
SyncFirst = manjaro-system archlinux-keyring manjaro-keyring SyncFirst = manjaro-system archlinux-keyring manjaro-keyring
#XferCommand = /usr/bin/curl -C - -f %u > %o #XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
#UseDelta = 0.7 #UseDelta = 0.7
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
HoldPkg = pacman glibc manjaro-system HoldPkg = pacman glibc manjaro-system
# If upgrades are available for these packages they will be asked for first # If upgrades are available for these packages they will be asked for first
SyncFirst = manjaro-system archlinux-keyring manjaro-keyring SyncFirst = manjaro-system archlinux-keyring manjaro-keyring
#XferCommand = /usr/bin/curl -C - -f %u > %o #XferCommand = /usr/bin/curl -L -C - -f -o %o %u
#XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u #XferCommand = /usr/bin/wget --passive-ftp -c -O %o %u
#CleanMethod = KeepInstalled #CleanMethod = KeepInstalled
#UseDelta = 0.7 #UseDelta = 0.7
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment