Patches for aports can be sent to this list

[alpine-aports] [PATCH] main/polkit: add user/group in pre-upgrade also

Paul Bredbury
Details
Message ID
<20190505094133.4553-1-brebs@sent.com>
Sender timestamp
1557049293
DKIM signature
missing
Download raw message
Patch: +8 -2
... to prevent e.g. mate-panel from failing to start, for users who are *upgrading* polkit.

As done in the s6 package. Is an ugly file duplication, but the package manager does not currently support a more elegant method.
---
 main/polkit/APKBUILD           | 4 ++--
 main/polkit/polkit.pre-upgrade | 6 ++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 main/polkit/polkit.pre-upgrade

diff --git a/main/polkit/APKBUILD b/main/polkit/APKBUILD
index d7a19d5a97..f97514ba6f 100644
--- a/main/polkit/APKBUILD
+++ b/main/polkit/APKBUILD
@@ -2,7 +2,7 @@
 # Maintainer: Natanael Copa <ncopa@alpinelinux.org>
 pkgname=polkit
 pkgver=0.115
-pkgrel=0
+pkgrel=1
 pkgdesc="Application development toolkit for controlling system-wide privileges"
 url="https://www.freedesktop.org/wiki/Software/polkit/"
 arch="all !armhf !armv7 !sx390" # limited by mozjs60
@@ -19,7 +19,7 @@ source="https://www.freedesktop.org/software/polkit/releases/polkit-$pkgver.tar.
 	mozjs60-2.patch
 	alpine-pam.patch
 "
-install="polkit.pre-install"
+install="polkit.pre-install polkit.pre-upgrade"
 pkgusers="polkitd"
 pkggroups="polkitd"
 
diff --git a/main/polkit/polkit.pre-upgrade b/main/polkit/polkit.pre-upgrade
new file mode 100644
index 0000000000..7c4e3eff88
--- /dev/null
+++ b/main/polkit/polkit.pre-upgrade
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+addgroup -S polkitd 2>/dev/null
+adduser -S -D -H -h /var/empty -s /sbin/nologin -G polkitd -g polkitd polkitd 2>/dev/null
+
+exit 0
-- 
2.21.0



---
Unsubscribe:  alpine-aports+unsubscribe@lists.alpinelinux.org
Help:         alpine-aports+help@lists.alpinelinux.org
---