Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 100581 Details for
Bug 152990
[PATCH] Portage Local Revisions
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch to allow -local# revisions
portage_local_version.patch (text/plain), 3.30 KB, created by
Philip Walls (RETIRED)
on 2006-10-27 08:44:18 UTC
(
hide
)
Description:
Patch to allow -local# revisions
Filename:
MIME Type:
Creator:
Philip Walls (RETIRED)
Created:
2006-10-27 08:44:18 UTC
Size:
3.30 KB
patch
obsolete
>diff -urN usr/lib/portage/pym/portage_dep.py usr-new/lib/portage/pym/portage_dep.py >--- usr/lib/portage/pym/portage_dep.py 2006-10-20 13:47:43.000000000 -0400 >+++ usr-new/lib/portage/pym/portage_dep.py 2006-10-20 14:25:30.000000000 -0400 >@@ -314,9 +314,10 @@ > cat, pkg = catsplit(mycpv) > ver = None > rev = None >+ loc = None > slot = dep_getslot(mydep) > else: >- cat, pkg, ver, rev = mycpv_cps >+ cat, pkg, ver, rev, loc = mycpv_cps > if mydep == mycpv: > raise KeyError("Specific key requires an operator" + \ > " (%s) (try adding an '=')" % (mydep)) >@@ -371,7 +372,7 @@ > elif operator in [">", ">=", "<", "<="]: > for x in candidate_list: > try: >- result = pkgcmp(pkgsplit(x), [cat + "/" + pkg, ver, rev]) >+ result = pkgcmp(pkgsplit(x), [cat + "/" + pkg, ver, rev, loc]) > except SystemExit: > raise > except: >diff -urN usr/lib/portage/pym/portage_versions.py usr-new/lib/portage/pym/portage_versions.py >--- usr/lib/portage/pym/portage_versions.py 2006-10-20 13:47:43.000000000 -0400 >+++ usr-new/lib/portage/pym/portage_versions.py 2006-10-20 15:14:13.000000000 -0400 >@@ -1,6 +1,6 @@ > import re,string > >-ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$") >+ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?(-local(\\d+))?$") > suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$") > suffix_value = {"pre": -2, "p": 0, "alpha": -4, "beta": -3, "rc": -1} > endversion_keys = ["pre", "p", "alpha", "beta", "rc"] >@@ -110,7 +110,7 @@ > except ValueError: r2 = 0 > return r1 - r2 > >- # the suffix part is equal to, so finally check the revision >+ # the suffix part is equal too, so check the revision > if match1.group(10): > r1 = string.atoi(match1.group(10)) > else: >@@ -119,8 +119,23 @@ > r2 = string.atoi(match2.group(10)) > else: > r2 = 0 >- vercmp_cache[mykey] = r1 - r2 >- return r1 - r2 >+ >+ if r1 != r2: >+ vercmp_cache[mykey] = r1 - r2 >+ return r1 - r2 >+ >+ # if revision part is equal, finally check local part >+ if match1.group(12): >+ loc1 = string.atoi(match1.group(12)) >+ else: >+ loc1 = 0 >+ if match2.group(12): >+ loc2 = string.atoi(match2.group(12)) >+ else: >+ loc2 = 0 >+ >+ vercmp_cache[mykey] = loc1 - loc2 >+ return loc1 - loc2 > > def pkgcmp(pkg1, pkg2): > """ >@@ -146,18 +161,8 @@ > """ > if pkg1[0] != pkg2[0]: > return None >- mycmp=vercmp(pkg1[1],pkg2[1]) >- if mycmp>0: >- return 1 >- if mycmp<0: >- return -1 >- r1=string.atof(pkg1[2][1:]) >- r2=string.atof(pkg2[2][1:]) >- if r1>r2: >- return 1 >- if r2>r1: >- return -1 >- return 0 >+ >+ return vercmp("-".join(pkg1[1:]),"-".join(pkg2[1:])) > > > pkgcache={} >@@ -182,6 +187,21 @@ > print "!!! Name error in",mypkg+": empty \"-\" part." > pkgcache[mypkg]=None > return None >+ >+ #verify loc >+ locok=0 >+ myloc=myparts[-1] >+ if len(myloc) and myloc[0:5]=="local": >+ try: >+ string.atoi(myloc[5:]) >+ locok=1 >+ except: >+ pass >+ if locok: >+ local = myparts[-1] >+ del myparts[-1] >+ else: >+ local = "local0" > > #verify rev > revok=0 >@@ -209,7 +229,7 @@ > pkgcache[mypkg]=None > return None > #names can't have versiony looking parts >- myval=[string.join(myparts[:verPos],"-"),myparts[verPos],revision] >+ myval=[string.join(myparts[:verPos],"-"),myparts[verPos],revision,local] > pkgcache[mypkg]=myval > return myval > else:
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 152990
: 100581