Lines 3059-3064
Link Here
|
3059 |
lcfile.write(str(counter)) |
3059 |
lcfile.write(str(counter)) |
3060 |
lcfile.close() |
3060 |
lcfile.close() |
3061 |
|
3061 |
|
|
|
3062 |
def slot_ent(self,mylist): |
3063 |
depmin=mylist[1] |
3064 |
depmax=mylist[2] |
3065 |
myslotstring=str(mylist[3])+"\n" |
3066 |
origcp=dep_getkey(depmin) |
3067 |
if origcp!=dep_getkey(depmax): |
3068 |
sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") |
3069 |
return |
3070 |
matches=self.cp_list(origcp) |
3071 |
matches=self.match2(depmin,origcp,matches) |
3072 |
matches=self.match2(depmax,origcp,matches) |
3073 |
for mycpv in matches: |
3074 |
origslotfile=open(self.root+"var/db/pkg/"+mycpv+"/SLOT","r") |
3075 |
origslotstring=origslotfile.readline() |
3076 |
origslotfile.close() |
3077 |
if myslotstring!=origslotstring: |
3078 |
sys.stderr.write("$") |
3079 |
sys.stderr.flush() |
3080 |
myslotfile=open(self.root+"var/db/pkg/"+mycpv+"/SLOT","w") |
3081 |
myslotfile.write(myslotstring) |
3082 |
myslotfile.close() |
3083 |
|
3062 |
def move_ent(self,mylist): |
3084 |
def move_ent(self,mylist): |
3063 |
origcp=mylist[1] |
3085 |
origcp=mylist[1] |
3064 |
newcp=mylist[2] |
3086 |
newcp=mylist[2] |
Lines 5081-5087
Link Here
|
5081 |
sys.stderr.write("\n\n") |
5103 |
sys.stderr.write("\n\n") |
5082 |
sys.stderr.write(green("Performing Global Updates: ")+bold(mykey)+"\n") |
5104 |
sys.stderr.write(green("Performing Global Updates: ")+bold(mykey)+"\n") |
5083 |
sys.stderr.write("(Could take a couple minutes if you have a lot of binary packages.)\n") |
5105 |
sys.stderr.write("(Could take a couple minutes if you have a lot of binary packages.)\n") |
5084 |
sys.stderr.write(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n") |
5106 |
sys.stderr.write(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move' "+bold("$")+"='/var/db slot'\n") |
5085 |
processed=1 |
5107 |
processed=1 |
5086 |
#remove stale virtual entries (mappings for packages that no longer exist) |
5108 |
#remove stale virtual entries (mappings for packages that no longer exist) |
5087 |
myvirts=grabdict("/var/cache/edb/virtuals") |
5109 |
myvirts=grabdict("/var/cache/edb/virtuals") |
Lines 5093-5121
Link Here
|
5093 |
mysplit=myline.split() |
5115 |
mysplit=myline.split() |
5094 |
if not len(mysplit): |
5116 |
if not len(mysplit): |
5095 |
continue |
5117 |
continue |
5096 |
if mysplit[0]!="move": |
5118 |
if mysplit[0]=="slot": |
|
|
5119 |
if len(mysplit)!=4: |
5120 |
sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") |
5121 |
processed=0 |
5122 |
continue |
5123 |
sys.stdout.write(".") |
5124 |
sys.stdout.flush() |
5125 |
db["/"]["vartree"].dbapi.slot_ent(mysplit) |
5126 |
elif mysplit[0]=="move": |
5127 |
if len(mysplit)!=3: |
5128 |
sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") |
5129 |
processed=0 |
5130 |
continue |
5131 |
sys.stdout.write(".") |
5132 |
sys.stdout.flush() |
5133 |
db["/"]["vartree"].dbapi.move_ent(mysplit) |
5134 |
db["/"]["bintree"].move_ent(mysplit) |
5135 |
#update world entries: |
5136 |
for x in range(0,len(worldlist)): |
5137 |
#update world entries, if any. |
5138 |
worldlist[x]=dep_transform(worldlist[x],mysplit[1],mysplit[2]) |
5139 |
|
5140 |
#update virtuals: |
5141 |
for myvirt in myvirts.keys(): |
5142 |
for mypos in range(0,len(myvirts[myvirt])): |
5143 |
if myvirts[myvirt][mypos]==mysplit[1]: |
5144 |
#update virtual to new name |
5145 |
myvirts[myvirt][mypos]=mysplit[2] |
5146 |
else : |
5097 |
sys.stderr.write("portage: Update type \""+mysplit[0]+"\" not recognized.\n") |
5147 |
sys.stderr.write("portage: Update type \""+mysplit[0]+"\" not recognized.\n") |
5098 |
processed=0 |
5148 |
processed=0 |
5099 |
continue |
5149 |
continue |
5100 |
if len(mysplit)!=3: |
|
|
5101 |
sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") |
5102 |
processed=0 |
5103 |
continue |
5104 |
sys.stdout.write(".") |
5105 |
sys.stdout.flush() |
5106 |
db["/"]["vartree"].dbapi.move_ent(mysplit) |
5107 |
db["/"]["bintree"].move_ent(mysplit) |
5108 |
#update world entries: |
5109 |
for x in range(0,len(worldlist)): |
5110 |
#update world entries, if any. |
5111 |
worldlist[x]=dep_transform(worldlist[x],mysplit[1],mysplit[2]) |
5112 |
|
5113 |
#update virtuals: |
5114 |
for myvirt in myvirts.keys(): |
5115 |
for mypos in range(0,len(myvirts[myvirt])): |
5116 |
if myvirts[myvirt][mypos]==mysplit[1]: |
5117 |
#update virtual to new name |
5118 |
myvirts[myvirt][mypos]=mysplit[2] |
5119 |
|
5150 |
|
5120 |
# We gotta do the brute force updates for these now. |
5151 |
# We gotta do the brute force updates for these now. |
5121 |
if (settings["PORTAGE_CALLER"] in ["fixpackages"]) or \ |
5152 |
if (settings["PORTAGE_CALLER"] in ["fixpackages"]) or \ |