~alpine/aports

gnupg-scdaemon: fix pre-install group add v1 PROPOSED

Hunter Blanks: 1
 gnupg-scdaemon: fix pre-install group add

 1 files changed, 4 insertions(+), 1 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.alpinelinux.org/~alpine/aports/patches/3354/mbox | git am -3
Learn more about email & git

[PATCH] gnupg-scdaemon: fix pre-install group add Export this patch

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