summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2007-07-13 23:42:34 +0000
committerZac Medico <zmedico@gentoo.org>2007-07-13 23:42:34 +0000
commit58d326af715f7a0dec6f2dde1417a8cd637dc96c (patch)
treea51242079e64c0c8c693ab41a30d3a977f60aff2
parente0fe89f2fa55f8689e2972a98e05dd5d7b6f2893 (diff)
downloadportage-58d326af715f7a0dec6f2dde1417a8cd637dc96c.tar.gz
portage-58d326af715f7a0dec6f2dde1417a8cd637dc96c.tar.bz2
portage-58d326af715f7a0dec6f2dde1417a8cd637dc96c.zip
Save the repo name along with the other metadata inside dyn_compile() so that it's saved inside binary packages for when they are finally merged. (trunk r7247)
svn path=/main/branches/2.1.2/; revision=7248
-rwxr-xr-xbin/ebuild.sh1
-rw-r--r--pym/portage.py23
2 files changed, 11 insertions, 13 deletions
diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index cc09080bd..d829bc0ed 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -1008,6 +1008,7 @@ dyn_compile() {
bzip2 -f9 environment
cp "${EBUILD}" "${PF}.ebuild"
+ [ -n "${PORTAGE_REPO_NAME}" ] && echo "${PORTAGE_REPO_NAME}" > repository
if hasq nostrip ${FEATURES} ${RESTRICT} || hasq strip ${RESTRICT}
then
touch DEBUGBUILD
diff --git a/pym/portage.py b/pym/portage.py
index 9d829de3b..92938eb36 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3171,6 +3171,16 @@ def doebuild_environment(myebuild, mydo, myroot, mysettings, debug, use_cache, m
mysettings["ROOT"] = myroot
mysettings["STARTDIR"] = getcwd()
+ mysettings["PORTAGE_REPO_NAME"] = ""
+ # bindbapi has no getRepositories() method
+ if mydbapi and hasattr(mydbapi, "getRepositories"):
+ # do we have a origin repository name for the current package
+ repopath = os.sep.join(pkg_dir.split(os.path.sep)[:-2])
+ for reponame in mydbapi.getRepositories():
+ if mydbapi.getRepositoryPath(reponame) == repopath:
+ mysettings["PORTAGE_REPO_NAME"] = reponame
+ break
+
mysettings["EBUILD"] = ebuild_path
mysettings["O"] = pkg_dir
mysettings.configdict["pkg"]["CATEGORY"] = cat
@@ -7759,19 +7769,6 @@ class dblink:
for x in listdir(inforoot):
self.copyfile(inforoot+"/"+x)
- # do we have a origin repository name for the current package
- repopath = os.sep.join(self.settings["O"].split(os.sep)[:-2])
- # bindbapi has no getRepositories() method
- if mydbapi and hasattr(mydbapi, "getRepositories"):
- foundname = False
- for reponame in mydbapi.getRepositories():
- if mydbapi.getRepositoryPath(reponame) == repopath:
- fd = open(os.path.join(self.dbtmpdir, "repository"), "w")
- fd.write(reponame+"\n")
- fd.close()
- foundname = True
- break
-
# get current counter value (counter_tick also takes care of incrementing it)
# XXX Need to make this destroot, but it needs to be initialized first. XXX
# XXX bis: leads to some invalidentry() call through cp_all().