From 62453b9e7ddf8518f555e1cbfd6dd95dc12932b4 Mon Sep 17 00:00:00 2001 From: Oliver Smith Date: Sun, 12 Sep 2021 22:23:40 +0200 Subject: [PATCH] pine64-pinephone: fix pre-upgrade script (MR 2512) Use -f, so rm * does not complain if the file does not exist * does not exit with 1 if the file does not exist Remove the stdout/stderr redirect (not needed with -f). Add exit 0 at the end of the file, even though it clearly should not exit with anything other than 0 anymore, as it's common practice in these pre-upgrade etc. scripts. With the old script, the problem was that it would exit 1 as soon as the files did not exist at the time the script runs. Exit 1 in this pre-upgrade script causes apk to show an error, and it would not go away with 'apk fix' since it ran into the same problem. Fixes: 7c511d ("pine64-pinephone: remove old u-boot...") --- device/main/device-pine64-pinephone/APKBUILD | 2 +- .../device-pine64-pinephone.pre-upgrade | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/device/main/device-pine64-pinephone/APKBUILD b/device/main/device-pine64-pinephone/APKBUILD index d5828057d..f2a0bcac3 100644 --- a/device/main/device-pine64-pinephone/APKBUILD +++ b/device/main/device-pine64-pinephone/APKBUILD @@ -6,7 +6,7 @@ # Co-Maintainer: Dylan Van Assche pkgname=device-pine64-pinephone pkgver=0.35 -pkgrel=1 +pkgrel=2 pkgdesc="PINE64 PinePhone" url="https://postmarketos.org" license="MIT" diff --git a/device/main/device-pine64-pinephone/device-pine64-pinephone.pre-upgrade b/device/main/device-pine64-pinephone/device-pine64-pinephone.pre-upgrade index 68592f5db..4261c2972 100644 --- a/device/main/device-pine64-pinephone/device-pine64-pinephone.pre-upgrade +++ b/device/main/device-pine64-pinephone/device-pine64-pinephone.pre-upgrade @@ -4,5 +4,7 @@ # packaging so remove them here to prevent a failed upgrade if /boot is too # full # see: https://gitlab.com/postmarketOS/pmaports/-/merge_requests/2449 -rm /boot/uImage-postmarketos-allwinner 2>/dev/null 1>&2 -rm /boot/uInitrd-postmarketos-allwinner 2>/dev/null 1>&2 +rm -f /boot/uImage-postmarketos-allwinner +rm -f /boot/uInitrd-postmarketos-allwinner + +exit 0