Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 247979 Details for
Bug 338002
portage.VERSION syntax inconsistent between releases and live tree
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
make valid version and append _p with unix time if modified relative to HEAD
valid_version.patch (text/plain), 1.75 KB, created by
Zac Medico
on 2010-09-19 10:51:59 UTC
(
hide
)
Description:
make valid version and append _p with unix time if modified relative to HEAD
Filename:
MIME Type:
Creator:
Zac Medico
Created:
2010-09-19 10:51:59 UTC
Size:
1.75 KB
patch
obsolete
>From 3972cf795ee8c4dc4914193f43d6a45f4cfed2fb Mon Sep 17 00:00:00 2001 >From: Zac Medico <zmedico@gentoo.org> >Date: Sun, 19 Sep 2010 03:44:10 -0700 >Subject: [PATCH] Bug #338002 - Make _LazyVersion format portage.VERSION so that it is > a valid version. > >--- > pym/portage/__init__.py | 20 +++++++++++++++----- > 1 files changed, 15 insertions(+), 5 deletions(-) > >diff --git a/pym/portage/__init__.py b/pym/portage/__init__.py >index 3c8d5ce..34d7ec8 100644 >--- a/pym/portage/__init__.py >+++ b/pym/portage/__init__.py >@@ -125,6 +125,7 @@ try: > 'cpv_getkey@getCPFromCPV,endversion_keys,' + \ > 'suffix_value@endversion,pkgcmp,pkgsplit,vercmp,ververify', > 'portage.xpak', >+ 'time', > ) > > try: >@@ -541,12 +542,21 @@ if VERSION == 'HEAD': > if VERSION is not self: > return VERSION > if os.path.isdir(os.path.join(PORTAGE_BASE_PATH, '.git')): >- status, output = subprocess_getstatusoutput( >- "cd %s ; git describe --tags" % \ >- _shell_quote(PORTAGE_BASE_PATH)) >+ status, output = subprocess_getstatusoutput(( >+ "cd %s ; git describe --tags || exit $? ; " + \ >+ "[ -n \"`git diff-index --name-only --diff-filter=M HEAD`\" ] && echo modified ; " + \ >+ "exit 0") % _shell_quote(PORTAGE_BASE_PATH)) > if os.WIFEXITED(status) and os.WEXITSTATUS(status) == os.EX_OK: >- VERSION = output >- return VERSION >+ output = output.split() >+ if output: >+ version_split = output[0].split('-') >+ if version_split: >+ VERSION = version_split[0].lstrip('v') >+ if len(version_split) > 1: >+ VERSION = "%s_p%s" %(VERSION, version_split[1]) >+ if output[-1] == 'modified': >+ VERSION = "%s_p%d" % (VERSION, time.time()) >+ return VERSION > VERSION = 'HEAD' > return VERSION > VERSION = _LazyVersion() >-- >1.7.1.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 338002
: 247979