def move_ent(self,mylist):
origcp=mylist[1]
newcp=mylist[2]
+ # sanity check
+ for cp in [origcp,newcp]:
+ if not (isvalidatom(cp) and isjustname(cp)):
+ raise portage_exception.InvalidPackageName(cp)
origmatches=self.match(origcp,use_cache=0)
if not origmatches:
return
origslot=mylist[2]
newslot=mylist[3]
+ if not isvalidatom(pkg):
+ raise portage_exception.InvalidAtom(pkg)
+
origmatches=self.match(pkg,use_cache=0)
+
if not origmatches:
return
for mycpv in origmatches:
self.populate()
origcp=mylist[1]
newcp=mylist[2]
+ # sanity check
+ for cp in [origcp,newcp]:
+ if not (isvalidatom(cp) and isjustname(cp)):
+ raise portage_exception.InvalidPackageName(cp)
mynewcat=newcp.split("/")[0]
origmatches=self.dbapi.cp_list(origcp)
if not origmatches:
pkg=mylist[1]
origslot=mylist[2]
newslot=mylist[3]
+
+ if not isvalidatom(pkg):
+ raise portage_exception.InvalidAtom(pkg)
+
origmatches=self.dbapi.match(pkg)
if not origmatches:
return
sys.stdout.flush()
if mysplit[0]=="move":
- db["/"]["vartree"].dbapi.move_ent(mysplit)
- db["/"]["bintree"].move_ent(mysplit)
+ try:
+ db["/"]["vartree"].dbapi.move_ent(mysplit)
+ db["/"]["bintree"].move_ent(mysplit)
+ except portage_exception.InvalidPackageName, e:
+ writemsg("\nERROR: Malformed update entry '%s'\n" % myline)
+ continue
#update world entries:
for x in range(0,len(worldlist)):
#update world entries, if any.
sys.stdout.flush()
elif mysplit[0]=="slotmove":
- db["/"]["vartree"].dbapi.move_slot_ent(mysplit)
- db["/"]["bintree"].move_slot_ent(mysplit,settings["PORTAGE_TMPDIR"]+"/tbz2")
+ try:
+ db["/"]["vartree"].dbapi.move_slot_ent(mysplit)
+ db["/"]["bintree"].move_slot_ent(mysplit,settings["PORTAGE_TMPDIR"]+"/tbz2")
+ except portage_exception.InvalidAtom, e:
+ writemsg("\nERROR: Malformed update entry '%s'\n" % myline)
for x in update_files:
mydblink = dblink('','','/',settings)