From: ahesford <ahesford@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Merged]: hplip: prevent conflicts with the GUI package
Date: Fri, 02 Dec 2022 20:19:54 +0100 [thread overview]
Message-ID: <20221202191954.7CSqST8_sZL-KdrBgpA1j7R4mUw2x6-PfAMNgqrZosw@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-40559@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 1691 bytes --]
There's a merged pull request on the void-packages repository
hplip: prevent conflicts with the GUI package
https://github.com/void-linux/void-packages/pull/40559
Description:
The `hplip-gui` package uses the exact same files as the regular `hplip` package, plus a few extra for the UI and three changes in the configuration file. Rather than copy the entire package contents and register `conflict=` and `provides=` to fool the package manager, we can make `hplip-gui` depend on `hplip` and just manage a symlink between two alternative configuration files.
The only really sophisticated part is handling the configuration symlink when removing `hplip-gui`. Because a user might remove the GUI package and want to keep the non-GUI version installed, the remove hook should detect whether a) it owns the existing symlink (*i.e.*, the link points at the GUI configuration) and b) whether the non-GUI configuration exists (in which case the link should be moved to the non-GUI config; otherwise, it should be removed). The rest of the hooks are very basic:
- `hplip` only claims the configuration symlink on installation if *no* valid configuration symlink exists, to avoid clobbering, *e.g.*, the existing GUI link on an upgrade.
- `hplip-gui` claims any configuration symlink (but leaves regular files alone) because a user installing the GUI package probably wants it to work.
- `hplip` just removes any configuration symlink it owns when the package is removed.
The removal hooks also treat a failure of `readlink` (which really ought to never happen) as if they "own" the symlink.
I've run through a few installation and removal cycles, and this seems to do what I expect.
prev parent reply other threads:[~2022-12-02 19:19 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 15:19 [PR PATCH] " ahesford
2022-11-17 18:54 ` [PR PATCH] [Updated] " ahesford
2022-11-17 18:58 ` ahesford
2022-12-02 19:19 ` ahesford [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221202191954.7CSqST8_sZL-KdrBgpA1j7R4mUw2x6-PfAMNgqrZosw@z \
--to=ahesford@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).