def populate(self, getbinpkgs=0,getbinpkgsonly=0):
"populates the binarytree"
- global settings
if (not os.path.isdir(self.pkgdir) and not getbinpkgs):
return 0
if (not os.path.isdir(self.pkgdir+"/All") and not getbinpkgs):
except:
continue
- if getbinpkgs and not settings["PORTAGE_BINHOST"]:
+ if getbinpkgs and not self.settings["PORTAGE_BINHOST"]:
writemsg(red("!!! PORTAGE_BINHOST unset, but use is requested.\n"),
noiselevel=-1)
- if getbinpkgs and settings["PORTAGE_BINHOST"] and not self.remotepkgs:
+ if getbinpkgs and \
+ self.settings["PORTAGE_BINHOST"] and not self.remotepkgs:
try:
- chunk_size = long(settings["PORTAGE_BINHOST_CHUNKSIZE"])
+ chunk_size = long(self.settings["PORTAGE_BINHOST_CHUNKSIZE"])
if chunk_size < 8:
chunk_size = 8
except SystemExit, e:
chunk_size = 3000
writemsg(green("Fetching binary packages info...\n"))
- self.remotepkgs = getbinpkg.dir_get_metadata(settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
+ self.remotepkgs = getbinpkg.dir_get_metadata(
+ self.settings["PORTAGE_BINHOST"], chunk_size=chunk_size)
writemsg(green(" -- DONE!\n\n"))
for mypkg in self.remotepkgs.keys():
def gettbz2(self,pkgname):
"fetches the package from a remote site, if necessary."
- global settings
print "Fetching '"+str(pkgname)+"'"
mysplit = string.split(pkgname,"/")
tbz2name = mysplit[1]+".tbz2"
raise
except:
pass
- return getbinpkg.file_get(settings["PORTAGE_BINHOST"]+"/"+tbz2name, mydest, fcmd=settings["RESUMECOMMAND"])
+ return getbinpkg.file_get(
+ self.settings["PORTAGE_BINHOST"] + "/" + tbz2name,
+ mydest, fcmd=self.settings["RESUMECOMMAND"])
def getslot(self,mycatpkg):
"Get a slot for a catpkg; assume it exists."