This repository has been archived by the owner on May 20, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Vendor enable the gnupg systemd sockets instead of manually symlinkin…
…g them to /etc/systemd/system/ in the .install file. git-svn-id: file:///srv/repos/svn-packages/svn@452400 eb2447ed-0c53-47e4-bac8-5bc4a241df78
- Loading branch information
Showing
2 changed files
with
22 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
_global_units() { | ||
_units=(dirmngr.socket gpg-agent.socket gpg-agent-{browser,extra,ssh}.socket) | ||
_dir=/etc/systemd/user/sockets.target.wants | ||
|
||
case $1 in | ||
enable) | ||
mkdir -p $_dir | ||
for _u in "${_units[@]}"; do | ||
ln -sf /usr/lib/systemd/user/$_u $_dir/$_u | ||
done | ||
;; | ||
disable) | ||
for _u in "${_units[@]}"; do | ||
rm -f $_dir/$_u | ||
done | ||
rmdir -p --ignore-fail-on-non-empty $_dir | ||
;; | ||
esac | ||
} | ||
|
||
post_install() { | ||
# See FS#42798 and FS#47371 | ||
# run dirmngr once to create /root/.gnupg | ||
# https://bugs.archlinux.org/task/47371 | ||
# https://bugs.archlinux.org/task/42798 | ||
dirmngr </dev/null &>/dev/null | ||
|
||
# Let systemd supervise daemons by default | ||
_global_units enable | ||
} | ||
|
||
pre_remove() { | ||
_global_units disable | ||
post_upgrade() { | ||
local unit | ||
|
||
if (( $(vercmp "$2" '2.2.36-2') < 0)); then | ||
for unit in {dirmngr,gpg-agent{,-{browser,extra,ssh}}}.socket; do | ||
rm -f "/etc/systemd/user/sockets.target.wants/$unit" | ||
done | ||
printf "NOTE: GnuPG's systemd sockets are now enabled in the vendor location /usr/lib/systemd/user/!\n" | ||
fi | ||
} |