ewarn when merging a package and the source repository/overlay does not have a name
authorMarius Mauch <genone@gentoo.org>
Sat, 30 Jun 2007 10:32:36 +0000 (10:32 -0000)
committerMarius Mauch <genone@gentoo.org>
Sat, 30 Jun 2007 10:32:36 +0000 (10:32 -0000)
svn path=/main/trunk/; revision=7097

pym/portage/dbapi/vartree.py

index 64fafbb57abddf6dcfd814569385431158750d1c..6e3c8736a5c5a2c9ec3e4b3fce12c2a279923dcb 100644 (file)
@@ -24,6 +24,8 @@ from portage import listdir, dep_expand, flatten, key_expand, \
        doebuild_environment, doebuild, env_update, \
        abssymlink, movefile, _movefile, bsd_chflags
 
+from portage.elog.messages import ewarn
+
 import os, sys, stat, errno, commands, copy, time
 from itertools import izip
 
@@ -1703,12 +1705,16 @@ class dblink(object):
                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")