Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 628806 - PMS is very unclear on how controllable compression works
Summary: PMS is very unclear on how controllable compression works
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Package Manager Specification
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 11:57 UTC by Michał Górny
Modified: 2019-11-25 08:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2017-08-24 11:57:29 UTC
https://dev.gentoo.org/~ulm/pms/head/pms.html#x1-14000011.3.3.11

> The package manager shall take appropriate steps to ensure that its compression
> mechanisms behave sensibly even if an item is listed in the inclusion list
> multiple times, if an item is a symlink, or if a file is already compressed.

I'd dare say this is very unclear and completely doesn't indicate what behavior you can rely on. More specifically:

1. listed multiple times -- I think we can clearly presume it means it doesn't get compressed twice.

2. is a symlink:

2a. should the symlink target be compressed if it's not explicitly on inclusion list?

2b. should the symlink be renamed if the target is not compressed?

2c. should the symlink be updated to point to a compressed target if it's explicitly in compression list?

2d. what happens if symlinks points to 'foo' that's not on compression list but 'foo.$COMPEXT' exists?

3. file is already compressed:

3a. does that mean it gets uncompressed and recompressed or skipped?

3b. how does the PM know if file is compressed? what if it's compressed using format that the PM does not recognize?

3c. do we really want to allow that?

4. bonus question: what if 'foo' and 'foo.$COMPEXT' both exist?
Comment 1 Ulrich Müller gentoo-dev 2017-08-24 13:56:34 UTC
Controllable compression is implementation-defined and entirely optional, so you cannot rely on anything there.

If you want any specific behaviour (e.g., if the package can only read gzip-compressed files), then have the ebuild itself compress the file and put it on the exclusion list with docompress -x.


(In reply to Michał Górny from comment #0)
> 1. listed multiple times -- I think we can clearly presume it means it
> doesn't get compressed twice.

Obviously.

> 2. is a symlink:
> [...]

"Behave sensibly". Basically that implies that a symlink gets updated if the link and its target are in the inclusion list. Don't rely on anything for obscure corner cases, but have the ebuild handle them explicitly.

> 3. file is already compressed:
> [...]
> 4. bonus question: what if 'foo' and 'foo.$COMPEXT' both exist?

See above.
Comment 2 Ulrich Müller gentoo-dev 2019-11-25 08:16:56 UTC
Closing per comment #1.