Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 756778 - sys-apps/portage: add content-hash distfiles layout
Summary: sys-apps/portage: add content-hash distfiles layout
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All All
: Normal enhancement (vote)
Assignee: Portage team
Depends on:
Blocks: 534528
  Show dependency tree
Reported: 2020-11-26 04:32 UTC by Zac Medico
Modified: 2020-11-26 20:21 UTC (History)
2 users (show)

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


Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2020-11-26 04:32:17 UTC
The content-hash distfiles layout will be similar to filename-hash, except that paths will be derived entirely from a file content hash.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-11-26 08:01:48 UTC
What's the advantage?
Comment 2 Zac Medico gentoo-dev 2020-11-26 20:21:13 UTC
The content-hash layout has a few advantages over the filename-hash layout:

1) Since the file path is independent of the file name, file name collisions cannot occur. This makes the content-hash layout suitable for storage of multiple types of files (not only gentoo distfiles). For example, it can be used to store distfiles for multiple linux distros within the same tree, with automatic deduplication based on content digest. This layout can be used to store and distribute practically anything (including binary packages for example).

2) Allows multiple revisions for the same distfiles name. An existing distfile can be updated, and if a user still has an older copy of an ebuild repository (or an overlay), then a user can successfully fetch a desired revision of the distfile as long as it has not been purged from the mirror.

3) File integrity data is integrated into the layout itself, making it very simple to verify the integrity of any file that it contains. The only tool required is an implementation of the chosen hash algorithm.