Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 338002 - portage.VERSION syntax inconsistent between releases and live tree
Summary: portage.VERSION syntax inconsistent between releases and live tree
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: High trivial (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks:
 
Reported: 2010-09-19 08:46 UTC by Michał Górny
Modified: 2023-08-29 07:37 UTC (History)
0 users

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


Attachments
make valid version and append _p with unix time if modified relative to HEAD (valid_version.patch,1.75 KB, patch)
2010-09-19 10:51 UTC, Zac Medico
Details | Diff

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 2010-09-19 08:46:34 UTC
For portage-2.2:
* live git tree generates 'vX.Y_rcZ-N-...'
* ebuilds use 'X.Y_rcZ_pN'

This means that to parse portage.VERSION, I need to use regular expression as complex as:
^v?((?:\d+\.)*\d+)(?:_rc(\d+))?(?:(?:_p|-)(\d+))?

I guess a little unification may be a good idea. Not sure how to embed the hash but the first part could be really ebuild-like, in order to be parsable by the standard PV splitting functions.
Comment 1 Zac Medico gentoo-dev 2010-09-19 10:51:59 UTC
Created attachment 247979 [details, diff]
make valid version and append _p with unix time if modified relative to HEAD

Examples:

python -c 'import portage ; print portage.VERSION'
2.2_rc84_p1

# modify some source files

python -c 'import portage ; print portage.VERSION'
2.2_rc84_p1_p1284893343
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2010-09-19 15:54:01 UTC
(In reply to comment #1)
> python -c 'import portage ; print portage.VERSION'
> 2.2_rc84_p1_p1284893343

Hm, seems a little long. Maybe you could subtract the HEAD timestamp from it?
Comment 3 Zac Medico gentoo-dev 2010-09-19 23:34:19 UTC
(In reply to comment #2)
> Hm, seems a little long. Maybe you could subtract the HEAD timestamp from it?

Ok, it's in git now:

http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=213dce575a3302ea3b24a81382a587533fd665e1
Comment 4 Zac Medico gentoo-dev 2010-09-20 04:13:07 UTC
Marking as fixed since this only matters for checkouts.