Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 171291 - metadata/cache requirements
Summary: metadata/cache requirements
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PMS/EAPI (show other bugs)
Hardware: All All
: High normal
Assignee: Package Manager Specification
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-17 23:35 UTC by Zac Medico
Modified: 2007-04-11 21:18 UTC (History)
0 users

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 Zac Medico gentoo-dev 2007-03-17 23:35:30 UTC
Section 3.7.1 does not mention 2 requirements that apply to all current versions of portage:

1) The mtimes of the metadata/cache files must exactly match those of the corresponding ebuilds (with 1 second granularity).

2) Cache files must be exactly 22 \n terminated lines in length.

If either of these two requirements is not met, the cache is useless to all current versions of portage.
Comment 1 Zac Medico gentoo-dev 2007-03-18 20:12:39 UTC
(In reply to comment #0)
> 1) The mtimes of the metadata/cache files must exactly match those of the
> corresponding ebuilds (with 1 second granularity).

The above is required for backward compatibility.  However, if the user modifies an eclass in the repo which triggers a change in ebuild metadata, the ebuild mtime is insufficient information to verify that the cache is not stale.  For this reason, we may want to add a new metadata key to the spec which would allow the package manager to detect staleness triggered by eclass modification.  For example, we can add a 16th line containing the mtime of the most recently modified  file (among the ebuild and the eclasses it inherits) expressed as the integer number of seconds elapsed since the Unix epoch.
Comment 2 Ciaran McCreesh 2007-03-25 15:48:22 UTC
Bleh. This is a mess. The only reason the cache things are in at all is because it's a pain in the ass to use the tree without them. I'd really rather not bog the spec down with weird things like requiring trailing blank lines and race-condition prone mtime requirements...
Comment 3 SpanKY gentoo-dev 2007-03-25 15:54:09 UTC
well, no point in mandating a half assed version when nothing actually generates/supports it ...
Comment 4 Ciaran McCreesh 2007-03-25 16:00:28 UTC
For the blank lines, fair enough.

For the mtimes, though, I'd say no point mandating something that's defective by design that would require any compliant package manager to be broken...
Comment 5 SpanKY gentoo-dev 2007-03-25 16:22:59 UTC
yeah, the spec should cover the current state, not any additional hacks to work around its broken design ...

we know we've out grown the cache format and it has many limitations ... best to freeze it now and move to something else
Comment 6 Ciaran McCreesh 2007-04-11 20:45:06 UTC
r148 adds the blank lines requirements.

I see no way of mandating mtime issues that doesn't require broken behaviour, so I've left it unspecified.