Subject: Does an apk feature exist similar to deb's dpkg-divert or pacman.conf's NoExtract?

From: Ralf Mardorf <[email-masked]>
Date: Mon, 05 Jun 2023 11:57:27 +0200

Hi,

does Alpine provide a feature similar to either (Debian/Ubuntu...) deb's

   dpkg-divert

or (Arch) pacman.conf's

   NoExtract

? In other words, can you install packages and exclude certain files in
the packages from the installation, like with pacman.conf's NoExtract,
or can certain files at least be installed in a different path and/or
with a different name, like dpkg-divert allows?

The .desktop files in /usr/local/share/applications/ or
$HOME/.local/share/applications/ in some cases don't override .desktop
files in /usr/share/applications/. This is one of the reasons to
_permanently_ get rid of some files owned by packages, even when
upgrading/reinstalling a package.

Maybe a workaround by making an edited .desktop file immutable by
running chattr might cause issues, if apk tries to remove or overwrite
it, but even if it shouldn't cause issues, I'm in favour of doing it not
like that.

IIUC it is possible to protect paths by /etc/apk/protected_paths.d/, but
not certain files.

Regards,
Ralf

---

From: "alice" <[email-masked]>
Date: Mon, 05 Jun 2023 12:02:00 +0200

> does Alpine provide a feature similar to either (Debian/Ubuntu...) deb's

no

>    NoExtract

no

---

From: Ralf Mardorf <[email-masked]>
Date: Mon, 05 Jun 2023 12:36:08 +0200

On Mon, 2023-06-05 at 12:02 +0200, alice wrote:
> > does Alpine provide a feature similar to either (Debian/Ubuntu...) deb
> >    dpkg-divert
> no
> > or (Arch) pacman.conf's
> >    NoExtract
> no

Thank you!

FWIW I added a comment to
https://gitlab.alpinelinux.org/alpine/apk-tools/-/issues/10829#note_316654

---

From: Konstantin Kulikov <[email-masked]>
Date: Mon, 5 Jun 2023 20:00:44 +0300

protected_paths.d is used by lbu and apk audit, i think that's all.
It has nothing to do with what you want here.

---

From: Ralf Mardorf <[email-masked]>
Date: Mon, 05 Jun 2023 12:03:31 +0200

> IIUC it is possible to protect paths by /etc/apk/protected_paths.d/, but

PS:

OTOH the content of the files in /etc/apk/protected_paths.d/ seems to be
protected files. Internet search engines return ambiguous information
related to this topic.