global _doebuild_manifest_exempt_depend
try:
_doebuild_manifest_exempt_depend += 1
+ distfiles_map = {}
+ fetchlist_dict = FetchlistDict(mysettings["O"], mysettings, myportdb)
+ for cpv, fetchlist in fetchlist_dict.iteritems():
+ for myfile in fetchlist:
+ distfiles_map.setdefault(myfile, []).append(cpv)
mf = Manifest(mysettings["O"], mysettings["DISTDIR"],
- fetchlist_dict=FetchlistDict(mysettings["O"],
- mysettings, myportdb))
+ fetchlist_dict=fetchlist_dict)
+ missing_hashes = set(distfiles_map).difference(
+ mf.fhashdict.get("DIST", {}))
+ if missing_hashes:
+ missing_files = []
+ for myfile in missing_hashes:
+ try:
+ os.stat(os.path.join(mysettings["DISTDIR"], myfile))
+ except OSError, e:
+ if e.errno != errno.ENOENT:
+ raise
+ del e
+ missing_files.append(myfile)
+ if missing_files:
+ mytree = os.path.realpath(os.path.dirname(
+ os.path.dirname(mysettings["O"])))
+ myuris = []
+ for myfile in missing_files:
+ for cpv in distfiles_map[myfile]:
+ alluris, aalist = myportdb.getfetchlist(
+ cpv, mytree=mytree, all=True,
+ mysettings=mysettings)
+ for i in xrange(len(aalist)):
+ if aalist[i] == myfile:
+ myuris.append(alluris[i])
+ if not fetch(myuris, mysettings):
+ writemsg("!!! File %s doesn't exist, can't update " + \
+ "Manifest\n" % myfile, noiselevel=-1)
+ return 0
writemsg_stdout(">>> Creating Manifest for %s\n" % mysettings["O"])
try:
mf.create(requiredDistfiles=myarchives,