Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 78979 | Differences between
and this patch

Collapse All | Expand All

(-)portage.py (-11 / +39 lines)
Lines 1606-1613 Link Here
1606
	mydigests = {}
1606
	mydigests = {}
1607
	digestfn  = mysettings["FILESDIR"]+"/digest-"+mysettings["PF"]
1607
	digestfn  = mysettings["FILESDIR"]+"/digest-"+mysettings["PF"]
1608
	if os.path.exists(digestfn):
1608
	if os.path.exists(digestfn):
1609
		mydigests = digestParseFile(digestfn)
1609
		try:
1610
1610
			mydigests = digestParseFile(digestfn)
1611
		except portage_exception.DigestException:
1612
			print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
1613
			sys.exit( -5 )
1611
	fsmirrors = []
1614
	fsmirrors = []
1612
	for x in range(len(mymirrors)-1,-1,-1):
1615
	for x in range(len(mymirrors)-1,-1,-1):
1613
		if mymirrors[x] and mymirrors[x][0]=='/':
1616
		if mymirrors[x] and mymirrors[x][0]=='/':
Lines 2016-2023 Link Here
2016
		# all files to be downloaded. 'Assuming'
2019
		# all files to be downloaded. 'Assuming'
2017
		myolddigest = {}
2020
		myolddigest = {}
2018
		if os.path.exists(digestfn):
2021
		if os.path.exists(digestfn):
2019
			myolddigest = digestParseFile(digestfn)
2022
			try:
2020
2023
				myolddigest = digestParseFile(digestfn)
2024
			except portage_exception.DigestException:
2025
				print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
2026
				sys.exit( -5 )
2021
		mydigests=digestCreate(myarchives, basedir, oldDigest=myolddigest)
2027
		mydigests=digestCreate(myarchives, basedir, oldDigest=myolddigest)
2022
		if mydigests==None: # There was a problem, exit with an errorcode.
2028
		if mydigests==None: # There was a problem, exit with an errorcode.
2023
			return 0
2029
			return 0
Lines 2120-2127 Link Here
2120
			mydigests[myfn] = {}
2126
			mydigests[myfn] = {}
2121
		mydigests[myfn][mykey] = myhash
2127
		mydigests[myfn][mykey] = myhash
2122
		if "size" in mydigests[myfn]:
2128
		if "size" in mydigests[myfn]:
2123
			if mydigests[myfn]["size"] != mysize:
2129
				if mydigests[myfn]["size"] != mysize:
2124
				raise portage_exception.DigestException, "Conflicting sizes in digest: %(filename)s" % {"filename":myfilename}
2130
					raise portage_exception.DigestException, "Conflicting sizes in digest: %(filename)s" % {"filename":myfilename}
2125
		else:
2131
		else:
2126
			mydigests[myfn]["size"] = mysize
2132
			mydigests[myfn]["size"] = mysize
2127
	return mydigests
2133
	return mydigests
Lines 2189-2199 Link Here
2189
				print "!!! Type \"ebuild foo.ebuild digest\" to generate it."
2195
				print "!!! Type \"ebuild foo.ebuild digest\" to generate it."
2190
				return 0
2196
				return 0
2191
2197
2192
	mydigests=digestParseFile(digestfn)
2198
	try:
2199
		mydigests=digestParseFile(digestfn)
2200
	except portage_exception.DigestException:
2201
		print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
2202
		sys.exit( -5 )
2203
	
2193
	if mydigests==None:
2204
	if mydigests==None:
2194
		print "!!! Failed to parse digest file:",digestfn
2205
		print "!!! Failed to parse digest file:",digestfn
2195
		return 0
2206
		return 0
2196
	mymdigests=digestParseFile(manifestfn)
2207
	try:
2208
		mymdigests=digestParseFile(manifestfn)
2209
	except portage_exception.DigestException:
2210
		print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
2211
		sys.exit( -5 )
2212
	
2197
	if "strict" not in features:
2213
	if "strict" not in features:
2198
		# XXX: Remove this when manifests become mainstream.
2214
		# XXX: Remove this when manifests become mainstream.
2199
		pass
2215
		pass
Lines 2554-2560 Link Here
2554
		checkme=aalist[:]
2570
		checkme=aalist[:]
2555
		digestfn=mysettings["FILESDIR"]+"/digest-"+mysettings["PF"]
2571
		digestfn=mysettings["FILESDIR"]+"/digest-"+mysettings["PF"]
2556
		if os.path.exists(digestfn):
2572
		if os.path.exists(digestfn):
2557
			mydigests=digestParseFile(digestfn)
2573
			try:
2574
				mydigests = digestParseFile(digestfn)
2575
			except portage_exception.DigestException:
2576
				print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
2577
				sys.exit( -5 )
2558
			if mydigests:
2578
			if mydigests:
2559
				for x in mydigests:
2579
				for x in mydigests:
2560
					while x in checkme:
2580
					while x in checkme:
Lines 5294-5300 Link Here
5294
	def getfetchsizes(self,mypkg,useflags=None,debug=0):
5314
	def getfetchsizes(self,mypkg,useflags=None,debug=0):
5295
		# returns a filename:size dictionnary of remaining downloads
5315
		# returns a filename:size dictionnary of remaining downloads
5296
		mydigest=self.finddigest(mypkg)
5316
		mydigest=self.finddigest(mypkg)
5297
		mymd5s=digestParseFile(mydigest)
5317
		try:
5318
			mymd5s=digestParseFile(mydigest)	
5319
		except portage_exception.DigestException:
5320
			print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
5321
			sys.exit( -5 )
5298
		if not mymd5s:
5322
		if not mymd5s:
5299
			if debug: print "[empty/missing/bad digest]: "+mypkg
5323
			if debug: print "[empty/missing/bad digest]: "+mypkg
5300
			return None
5324
			return None
Lines 5320-5326 Link Here
5320
				useflags = mysettings["USE"].split()
5344
				useflags = mysettings["USE"].split()
5321
		myuri, myfiles = self.getfetchlist(mypkg, useflags=useflags, mysettings=mysettings, all=all)
5345
		myuri, myfiles = self.getfetchlist(mypkg, useflags=useflags, mysettings=mysettings, all=all)
5322
		mydigest       = self.finddigest(mypkg)
5346
		mydigest       = self.finddigest(mypkg)
5323
		mysums         = digestParseFile(mydigest)
5347
		try:
5348
			mysums         = digestParseFile(mydigest)
5349
		except portage_exception.DigestException:
5350
			print "The digest sizes do not match.  Usually this is due to an invalid manifest.  Try an emerge sync to fetch a working manifest."
5351
			sys.exit( -5 )
5324
		
5352
		
5325
		failures = {}
5353
		failures = {}
5326
		for x in myfiles:
5354
		for x in myfiles:

Return to bug 78979