Received: from terra.artifex.org (terra.artifex.org [216.252.162.213]) by nld3-dev1.alpinelinux.org (Postfix) with ESMTPS id B8679781D5A for ; Sat, 25 Jul 2020 16:37:06 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by terra (OpenSMTPD) with ESMTP id 0c28f24e; Sat, 25 Jul 2020 16:30:25 +0000 (UTC) From: Hunter Blanks To: alpine-aports@lists.alpinelinux.org Cc: Hunter Blanks Subject: [PATCH] gnupg-scdaemon: fix pre-install group add Date: Sat, 25 Jul 2020 09:29:55 -0700 Message-Id: <20200725162955.87130-1-hblanks@artifex.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit gnupg-scdaemon fails if /etc/group already contains the group gnupg. Fix this by checking first if the group exists before trying to add it. Example of the bug follows: # apk add gnupg-scdaemon ... Executing gnupg-scdaemon-2.2.20-r0.pre-install OK: 26 MiB in 44 packages # grep gnupg /etc/group gnupg:x:101: # apk del gnupg-scdaemon ... # apk add gnupg-scdaemon ... Executing gnupg-scdaemon-2.2.20-r0.pre-install ERROR: gnupg-scdaemon-2.2.20-r0.pre-install: script exited with error 1 1 error; 26 MiB in 44 packages # addgroup -S gnupg addgroup: group 'gnupg' in use --- main/gnupg/gnupg-scdaemon.pre-install | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main/gnupg/gnupg-scdaemon.pre-install b/main/gnupg/gnupg-scdaemon.pre-install index 8d8262ceea..9e6e5ed01d 100644 --- a/main/gnupg/gnupg-scdaemon.pre-install +++ b/main/gnupg/gnupg-scdaemon.pre-install @@ -1,2 +1,5 @@ #!/bin/sh -addgroup -S gnupg 2> /dev/null +if ! grep -q -E '^gnupg:' /etc/group +then + addgroup -S gnupg 2> /dev/null +fi -- 2.25.1