--- portage.py.orig 2003-09-04 23:57:29.000000000 +0200 +++ portage.py 2003-09-04 23:57:41.000000000 +0200 @@ -3059,6 +3059,28 @@ lcfile.write(str(counter)) lcfile.close() + def slot_ent(self,mylist): + depmin=mylist[1] + depmax=mylist[2] + myslotstring=str(mylist[3])+"\n" + origcp=dep_getkey(depmin) + if origcp!=dep_getkey(depmax): + sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") + return + matches=self.cp_list(origcp) + matches=self.match2(depmin,origcp,matches) + matches=self.match2(depmax,origcp,matches) + for mycpv in matches: + origslotfile=open(self.root+"var/db/pkg/"+mycpv+"/SLOT","r") + origslotstring=origslotfile.readline() + origslotfile.close() + if myslotstring!=origslotstring: + sys.stderr.write("$") + sys.stderr.flush() + myslotfile=open(self.root+"var/db/pkg/"+mycpv+"/SLOT","w") + myslotfile.write(myslotstring) + myslotfile.close() + def move_ent(self,mylist): origcp=mylist[1] newcp=mylist[2] @@ -5081,7 +5103,7 @@ sys.stderr.write("\n\n") sys.stderr.write(green("Performing Global Updates: ")+bold(mykey)+"\n") sys.stderr.write("(Could take a couple minutes if you have a lot of binary packages.)\n") - sys.stderr.write(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move'\n") + sys.stderr.write(" "+bold(".")+"='update pass' "+bold("*")+"='binary update' "+bold("@")+"='/var/db move' "+bold("$")+"='/var/db slot'\n") processed=1 #remove stale virtual entries (mappings for packages that no longer exist) myvirts=grabdict("/var/cache/edb/virtuals") @@ -5093,29 +5115,38 @@ mysplit=myline.split() if not len(mysplit): continue - if mysplit[0]!="move": + if mysplit[0]=="slot": + if len(mysplit)!=4: + sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") + processed=0 + continue + sys.stdout.write(".") + sys.stdout.flush() + db["/"]["vartree"].dbapi.slot_ent(mysplit) + elif mysplit[0]=="move": + if len(mysplit)!=3: + sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") + processed=0 + continue + sys.stdout.write(".") + sys.stdout.flush() + db["/"]["vartree"].dbapi.move_ent(mysplit) + db["/"]["bintree"].move_ent(mysplit) + #update world entries: + for x in range(0,len(worldlist)): + #update world entries, if any. + worldlist[x]=dep_transform(worldlist[x],mysplit[1],mysplit[2]) + + #update virtuals: + for myvirt in myvirts.keys(): + for mypos in range(0,len(myvirts[myvirt])): + if myvirts[myvirt][mypos]==mysplit[1]: + #update virtual to new name + myvirts[myvirt][mypos]=mysplit[2] + else : sys.stderr.write("portage: Update type \""+mysplit[0]+"\" not recognized.\n") processed=0 continue - if len(mysplit)!=3: - sys.stderr.write("portage: Update command \""+myline+"\" invalid; skipping.\n") - processed=0 - continue - sys.stdout.write(".") - sys.stdout.flush() - db["/"]["vartree"].dbapi.move_ent(mysplit) - db["/"]["bintree"].move_ent(mysplit) - #update world entries: - for x in range(0,len(worldlist)): - #update world entries, if any. - worldlist[x]=dep_transform(worldlist[x],mysplit[1],mysplit[2]) - - #update virtuals: - for myvirt in myvirts.keys(): - for mypos in range(0,len(myvirts[myvirt])): - if myvirts[myvirt][mypos]==mysplit[1]: - #update virtual to new name - myvirts[myvirt][mypos]=mysplit[2] # We gotta do the brute force updates for these now. if (settings["PORTAGE_CALLER"] in ["fixpackages"]) or \