--- pym/portage.py.org 2003-09-23 23:56:16.000000000 +0200 +++ pym/portage.py 2003-09-29 21:43:25.000000000 +0200 @@ -2126,8 +2189,9 @@ myrev=myparts[-1] if len(myrev) and myrev[0]=="r": try: - string.atoi(myrev[1:]) - revok=1 + #string.atoi(myrev[1:]) + if re.compile("r[0-9]+[a-zA-Z]*").search(myrev): + revok=1 except: pass if revok: @@ -2271,11 +2335,13 @@ return 1 if mycmp<0: return -1 - r1=string.atoi(pkg1[2][1:]) - r2=string.atoi(pkg2[2][1:]) - if r1>r2: + m1=re.match("r([0-9]+)([a-zA-Z]*)", pkg1[2]) + m2=re.match("r([0-9]+)([a-zA-Z]*)", pkg2[2]) + r1=string.atoi(m1.group(1)) #string.atoi(pkg1[2][1:]) + r2=string.atoi(m2.group(1)) #string.atoi(pkg2[2][1:]) + if r1>r2 or (r1==r2 and m1.group(2) > m2.group(2)): return 1 - if r2>r1: + if r2>r1 or (r1==r2 and m2.group(2) > m1.group(2)): return -1 return 0 @@ -2901,7 +2998,7 @@ elif mydep[0]=="~": if cp_key==None: return [] - myrev=-1 + myrev="0" for x in mylist: cp_x=catpkgsplit(x) if cp_x==None: @@ -2912,10 +3009,10 @@ if cp_key[2]!=cp_x[2]: #if version doesn't match, skip it continue - if string.atoi(cp_x[3][1:])>myrev: - myrev=string.atoi(cp_x[3][1:]) + if cp_x[3][1:] > myrev: #string.atoi(cp_x[3][1:])>myrev: + myrev=cp_x[3][1:] #string.atoi(cp_x[3][1:]) mymatch=x - if myrev==-1: + if myrev=="0": return [] else: return [mymatch]