Save the repo name along with the other metadata inside dyn_compile() so that it...
authorZac Medico <zmedico@gentoo.org>
Fri, 13 Jul 2007 23:37:09 +0000 (23:37 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 13 Jul 2007 23:37:09 +0000 (23:37 -0000)
svn path=/main/trunk/; revision=7247

bin/ebuild.sh
pym/portage/__init__.py
pym/portage/dbapi/vartree.py

index b7636b1e3d44ed538e2604a3f05b8d92ac8e3aee..6442ec4ff02978b2d06b8d1650cc4d362009da0e 100755 (executable)
@@ -930,6 +930,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
index da9f499ab56bff624bb96005142e1170a4cd152c..822f813beb11b68958543331b2964afcff109f38 100644 (file)
@@ -3279,6 +3279,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
index 0060b5715e849a4084e2cfd034b807922128da97..fd543d5cd4af12e72abb094687db13388ca345b2 100644 (file)
@@ -1736,21 +1736,6 @@ class dblink(object):
                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
-                       if not foundname:
-                               ewarn("Could not determine name of source repository at %s" % repopath, phase="preinst", key=self.mycpv)
-
                # write local package counter for recording
                lcfile = open(os.path.join(self.dbtmpdir, "COUNTER"),"w")
                lcfile.write(str(counter))