From: Fabian Groffen Date: Fri, 1 Jun 2007 20:57:59 +0000 (-0000) Subject: Merged from trunk 6710:6718 X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=f839efbfe76e62ea7e37870555a73c9aa36680a5;p=portage.git Merged from trunk 6710:6718 +------------------------------------------------------------------------+ | 6711 | Don't complain when $FILESDIR is missing unless manifest1 | | zmedico | compatibility is enabled. | |---------+--------------------------------------------------------------| | 6716 | Fix it so repoman still does QA when $FILESDIR doesn't | | zmedico | exist. | |---------+--------------------------------------------------------------| | 6718 | Add an optional PATH attribute to the Packages index in | | zmedico | order to indicate the relative path of the package within | | | the repository. In the future this will allow storage of | | | more than one package per cpv but for now it's just use to | | | indicate if a package is stored in the old-style All/ | | | directory (instead of the category directory). | +------------------------------------------------------------------------+ svn path=/main/branches/prefix/; revision=6719 --- diff --git a/bin/repoman b/bin/repoman index 7fca8538f..2433adcb7 100755 --- a/bin/repoman +++ b/bin/repoman @@ -863,17 +863,14 @@ for x in scanlist: s = s[s.rfind("\n") + 1:] fails["file.UTF8"].append("%s/%s: line %i, just after: '%s'" % (checkdir, y, line, s)) - if isCvs or isSvn: - try: - mystat=os.stat(checkdir+"/files")[0] - if len(ebuildlist) and not S_ISDIR(mystat): - raise Exception - except SystemExit, e: - raise # Need to propogate this - except: + has_filesdir = True + if not os.path.isdir(os.path.join(checkdir, "files")): + has_filesdir = False + if manifest1_compat: stats["filedir.missing"] += 1 fails["filedir.missing"].append(checkdir) - continue + + if isCvs or isSvn: try: if isCvs: myf=open(checkdir+"/CVS/Entries","r") @@ -914,6 +911,7 @@ for x in scanlist: fails["svn.IO_error"].append(checkdir+"svn info") continue + if isCvs and has_filesdir: try: if isCvs: myf=open(checkdir+"/files/CVS/Entries","r") diff --git a/pym/portage/dbapi/bintree.py b/pym/portage/dbapi/bintree.py index c6cc084c9..061a8d8d8 100644 --- a/pym/portage/dbapi/bintree.py +++ b/pym/portage/dbapi/bintree.py @@ -397,6 +397,18 @@ class binarytree(object): # discard duplicates (All/ is preferred) continue pkg_paths[mycpv] = mypath + # update the path if the package has been moved + oldpath = d.get("PATH") + if oldpath and oldpath != mypath: + update_pkgindex = True + if mypath != mycpv + ".tbz2": + d["PATH"] = mypath + if not oldpath: + update_pkgindex = True + else: + d.pop("PATH", None) + if oldpath: + update_pkgindex = True self.dbapi.cpv_inject(mycpv) if not self.dbapi._aux_cache_keys.difference(d): aux_cache = {} @@ -458,6 +470,11 @@ class binarytree(object): d["SLOT"] = slot d["MTIME"] = str(long(s.st_mtime)) d["SIZE"] = str(s.st_size) + # record location if it's non-default + if mypath != mycpv + ".tbz2": + d["PATH"] = mypath + else: + d.pop("PATH", None) metadata[mycpv] = d if not self.dbapi._aux_cache_keys.difference(d): aux_cache = {} @@ -660,6 +677,10 @@ class binarytree(object): d["MTIME"] = str(long(s.st_mtime)) d["SIZE"] = str(s.st_size) d["MD5"] = str(md5) + rel_path = self._pkg_paths[cpv] + # record location if it's non-default + if rel_path != cpv + ".tbz2": + d["PATH"] = rel_path keys = ["USE", "IUSE", "DESCRIPTION", "LICENSE", "PROVIDE", \ "RDEPEND", "DEPEND", "PDEPEND"] from itertools import izip @@ -785,16 +806,11 @@ class binarytree(object): base_url = self.settings["PORTAGE_BINHOST"] fcmd = self.settings["RESUMECOMMAND"] if self._remote_has_index: - url = urljoin(base_url, pkgname+".tbz2") + rel_url = self._remotepkgs[pkgname].get("PATH") + if not rel_url: + rel_url = pkgname+".tbz2" + url = urljoin(base_url, rel_url) success = portage.getbinpkg.file_get(url, mydest, fcmd=fcmd) - if not success: - try: - os.unlink(self.getname(pkgname)) - except OSError: - pass - # Fall back to the "All" directory - url = urljoin(base_url, "All/"+tbz2name) - success = portage.getbinpkg.file_get(url, mydest, fcmd=fcmd) else: url = urljoin(base_url, tbz2name) success = portage.getbinpkg.file_get(url, mydest, fcmd=fcmd)