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

Collapse All | Expand All

(-)/usr/lib/portage/bin/misc-functions.sh (-3 / +4 lines)
Lines 346-353 Link Here
346
dyn_package() {
346
dyn_package() {
347
	cd "${PORTAGE_BUILDDIR}/image"
347
	cd "${PORTAGE_BUILDDIR}/image"
348
	install_mask "${PORTAGE_BUILDDIR}/image" ${PKG_INSTALL_MASK}
348
	install_mask "${PORTAGE_BUILDDIR}/image" ${PKG_INSTALL_MASK}
349
	local pkg_dest="${PKGDIR}/All/${PF}.tbz2"
349
	[[ ! -d ${PKGDIR}/${CATEGORY} ]] && mkdir ${PKGDIR}/${CATEGORY}
350
	local pkg_tmp="${PKGDIR}/All/${PF}.tbz2.$$"
350
	local pkg_dest="${PKGDIR}/${CATEGORY}/${PF}.tbz2"
351
	local pkg_tmp="${PKGDIR}/${CATEGORY}/${PF}.tbz2.$$"
351
	# Sandbox is disabled in case the user wants to use a symlink
352
	# Sandbox is disabled in case the user wants to use a symlink
352
	# for $PKGDIR and/or $PKGDIR/All.
353
	# for $PKGDIR and/or $PKGDIR/All.
353
	export SANDBOX_ON="0"
354
	export SANDBOX_ON="0"
Lines 359-365 Link Here
359
		die "Failed to append metadata to the tbz2 file"
360
		die "Failed to append metadata to the tbz2 file"
360
	fi
361
	fi
361
	mv -f "${pkg_tmp}" "${pkg_dest}" || die "Failed to move tbz2 to ${pkg_dest}"
362
	mv -f "${pkg_tmp}" "${pkg_dest}" || die "Failed to move tbz2 to ${pkg_dest}"
362
	ln -sf "../All/${PF}.tbz2" "${PKGDIR}/${CATEGORY}/${PF}.tbz2" || die "Failed to create symlink in ${PKGDIR}/${CATEGORY}"
363
	ln -sf "../${CATEGORY}/${PF}.tbz2" "${PKGDIR}/All/${PF}.tbz2" || die "Failed to create symlink in ${PKGDIR}/All"
363
	vecho ">>> Done."
364
	vecho ">>> Done."
364
	cd "${PORTAGE_BUILDDIR}"
365
	cd "${PORTAGE_BUILDDIR}"
365
	touch .packaged || die "Failed to 'touch .packaged' in ${PORTAGE_BUILDDIR}"
366
	touch .packaged || die "Failed to 'touch .packaged' in ${PORTAGE_BUILDDIR}"
(-)/usr/lib/portage/pym/portage.py (-31 / +34 lines)
Lines 5383-5389 Link Here
5383
			myoldpkg=mycpv.split("/")[1]
5383
			myoldpkg=mycpv.split("/")[1]
5384
			mynewpkg=mynewcpv.split("/")[1]
5384
			mynewpkg=mynewcpv.split("/")[1]
5385
5385
5386
			if (mynewpkg != myoldpkg) and os.path.exists(self.getname(mynewcpv)):
5386
			if (mynewcpv != myoldcpv) and os.path.exists(self.getname(mynewcpv)):
5387
				writemsg("!!! Cannot update binary: Destination exists.\n")
5387
				writemsg("!!! Cannot update binary: Destination exists.\n")
5388
				writemsg("!!! "+mycpv+" -> "+mynewcpv+"\n")
5388
				writemsg("!!! "+mycpv+" -> "+mynewcpv+"\n")
5389
				continue
5389
				continue
Lines 5475-5505 Link Here
5475
		global settings
5475
		global settings
5476
		if (not os.path.isdir(self.pkgdir) and not getbinpkgs):
5476
		if (not os.path.isdir(self.pkgdir) and not getbinpkgs):
5477
			return 0
5477
			return 0
5478
		if (not os.path.isdir(self.pkgdir+"/All") and not getbinpkgs):
5479
			return 0
5480
5478
5481
		if (not getbinpkgsonly) and os.path.exists(self.pkgdir+"/All"):
5479
		if (not getbinpkgsonly):
5482
			for mypkg in listdir(self.pkgdir+"/All"):
5480
			for mycat in settings.categories:
5483
				if mypkg[-5:]!=".tbz2":
5481
				for mypkg in listdir(self.pkgdir+"/"+mycat):
5484
					continue
5482
					if mypkg[-5:]!=".tbz2":
5485
				mytbz2=xpak.tbz2(self.pkgdir+"/All/"+mypkg)
5483
						continue
5486
				mycat=mytbz2.getfile("CATEGORY")
5484
					mytbz2=xpak.tbz2(self.pkgdir+"/"+mycat+"/"+mypkg)
5487
				if not mycat:
5485
					fullpkg=mycat+"/"+mypkg[:-5]
5488
					#old-style or corrupt package
5486
					mykey=dep_getkey(fullpkg)
5489
					writemsg("!!! Invalid binary package: "+mypkg+"\n")
5487
					try:
5490
					writemsg("!!! This binary package is not recoverable and should be deleted.\n")
5488
						# invalid tbz2's can hurt things.
5491
					self.invalids.append(mypkg)
5489
						self.dbapi.cpv_inject(fullpkg)
5492
					continue
5490
					except SystemExit, e:
5493
				mycat=string.strip(mycat)
5491
						raise
5494
				fullpkg=mycat+"/"+mypkg[:-5]
5492
					except:
5495
				mykey=dep_getkey(fullpkg)
5493
						pass
5496
				try:
5497
					# invalid tbz2's can hurt things.
5498
					self.dbapi.cpv_inject(fullpkg)
5499
				except SystemExit, e:
5500
					raise
5501
				except:
5502
					continue
5503
5494
5504
		if getbinpkgs and not settings["PORTAGE_BINHOST"]:
5495
		if getbinpkgs and not settings["PORTAGE_BINHOST"]:
5505
			writemsg(red("!!! PORTAGE_BINHOST unset, but use is requested.\n"))
5496
			writemsg(red("!!! PORTAGE_BINHOST unset, but use is requested.\n"))
Lines 5566-5576 Link Here
5566
5557
5567
	def getname(self,pkgname):
5558
	def getname(self,pkgname):
5568
		"returns file location for this particular package"
5559
		"returns file location for this particular package"
5569
		mysplit=string.split(pkgname,"/")
5560
		return self.pkgdir+"/"+pkgname+".tbz2"
5570
		if len(mysplit)==1:
5571
			return self.pkgdir+"/All/"+self.resolve_specific(pkgname)+".tbz2"
5572
		else:
5573
			return self.pkgdir+"/All/"+mysplit[1]+".tbz2"
5574
5561
5575
	def isremote(self,pkgname):
5562
	def isremote(self,pkgname):
5576
		"Returns true if the package is kept remotely."
5563
		"Returns true if the package is kept remotely."
Lines 5603-5609 Link Here
5603
			raise
5590
			raise
5604
		except:
5591
		except:
5605
			pass
5592
			pass
5606
		return getbinpkg.file_get(settings["PORTAGE_BINHOST"]+"/"+tbz2name, mydest, fcmd=settings["RESUMECOMMAND"])
5593
		retval = getbinpkg.file_get(settings["PORTAGE_BINHOST"]+"/"+tbz2name, mydest, fcmd=settings["RESUMECOMMAND"])
5594
		if not retval:
5595
			return 0
5596
		mytbz2 = xpak.tbz2(mydest + tbz2name)
5597
		mycat = xpak.getfile("CATEGORY")
5598
		if not mycat:
5599
			return 0
5600
		newdest = self.pkgdir+"/"+mycat+"/"
5601
		try:
5602
			os.makedirs(newdest, 0775)
5603
		except SystemExit, e:
5604
			raise
5605
		except:
5606
			pass
5607
		os.rename(mydest+tbz2name, newdest+tbz2name)
5608
		os.symlink("../"+mycat+"/"+tbz2name, mydest+tbz2name)
5609
		return retval
5607
5610
5608
	def getslot(self,mycatpkg):
5611
	def getslot(self,mycatpkg):
5609
		"Get a slot for a catpkg; assume it exists."
5612
		"Get a slot for a catpkg; assume it exists."

Return to bug 133908