# "a? ( b? ( z ) ) -- Valid
#
-import re, string, sys, types
+import re, sys, types
import portage_exception
from portage_exception import InvalidData
from portage_versions import catpkgsplit, catsplit, pkgcmp, pkgsplit, ververify
sys.stderr.write("Note: Nested use flags without parenthesis (Deprecated)\n")
warned = 1
if warned:
- sys.stderr.write(" --> "+string.join(map(str,[head]+newdeparray))+"\n")
+ sys.stderr.write(" --> "+"".join(map(str,[head]+newdeparray))+"\n")
# Check that each flag matches
ismatch = True
import errno
import os
import stat
-import string
import time
import types
import portage_exception
mylist = {}
for x in mydl:
if os.path.isfile(path+"/"+x):
- parts = string.split(x, ".hardlock-")
+ parts = x.split(".hardlock-")
if len(parts) == 2:
filename = parts[0]
- hostpid = string.split(parts[1],"-")
- host = string.join(hostpid[:-1], "-")
+ hostpid = parts[1].split("-")
+ host = "-".join(hostpid[:-1])
pid = hostpid[-1]
if not mylist.has_key(filename):
for x in mylines:
#the split/join thing removes leading and trailing whitespace, and converts any whitespace in the line
#into single spaces.
- myline=string.join(string.split(x))
+ myline="".join(x.split())
if not len(myline):
continue
if myline[0]=="#":
# Check if we have a compat-level string. BC-integration data.
# '##COMPAT==>N<==' 'some string attached to it'
- mylinetest = string.split(myline, "<==", 1)
+ mylinetest = myline.split("<==",1)
if len(mylinetest) == 2:
myline_potential = mylinetest[1]
- mylinetest = string.split(mylinetest[0],"##COMPAT==>")
+ mylinetest = mylinetest[0].split("##COMPAT==>")
if len(mylinetest) == 2:
if compat_level >= int(mylinetest[1]):
# It's a compat line, and the key matches.
final_dict[y] += " "+mydict[y][:]
else:
final_dict[y] = mydict[y][:]
- mydict[y] = string.join(mydict[y].split()) # Remove extra spaces.
+ mydict[y] = "".join(mydict[y].split()) # Remove extra spaces.
return final_dict
def stack_lists(lists, incremental=1):
#into single spaces.
if x[0] == "#":
continue
- myline=string.split(x)
+ myline=x.split()
if len(myline) < 2 and empty == 0:
continue
if len(myline) < 1 and empty == 1:
# Distributed under the terms of the GNU General Public License v2
# $Id$
-import re,string
+import re
ver_regexp = re.compile("^(cvs\\.)?(\\d+)((\\.\\d+)*)([a-z]?)((_(pre|p|beta|alpha|rc)\\d*)*)(-r(\\d+))?$")
suffix_regexp = re.compile("^(alpha|beta|rc|pre|p)(\\d*)$")
list2.append(int(vlist2[i]))
# now we have to use floats so 1.02 compares correctly against 1.1
else:
- list1.append(string.atof("0."+vlist1[i]))
- list2.append(string.atof("0."+vlist2[i]))
+ list1.append(float("0."+vlist1[i]))
+ list2.append(float("0."+vlist2[i]))
# and now the final letter
if len(match1.group(5)):
return 1
if mycmp<0:
return -1
- r1=string.atof(pkg1[2][1:])
- r2=string.atof(pkg2[2][1:])
+ r1=float(pkg1[2][1:])
+ r2=float(pkg2[2][1:])
if r1>r2:
return 1
if r2>r1:
return pkgcache[mypkg][:]
except KeyError:
pass
- myparts=string.split(mypkg,'-')
+ myparts=mypkg.split("-")
if len(myparts)<2:
if not silent:
pkgcache[mypkg]=None
return None
#names can't have versiony looking parts
- myval=[string.join(myparts[:verPos],"-"),myparts[verPos],revision]
+ myval=["-".join(myparts[:verPos]),myparts[verPos],revision]
pkgcache[mypkg]=myval
return myval
else:
# (integer) == encodeint(integer) ===> 4 characters (big-endian copy)
# '+' means concatenate the fields ===> All chunks are strings
-import sys,os,string,shutil,errno
+import sys,os,shutil,errno
from stat import *
def addtolist(mylist,curdir):
mydat=self.getfile(myfile)
if not mydat:
return []
- return string.split(mydat)
+ return mydat.split()
def unpackinfo(self,mydest):
"""Unpacks all the files from the dataSegment into 'mydest'."""