Bug #149745 - Generate an eqawarn message if dohtml is called on a directory
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 12:14:10 +0000 (12:14 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Mar 2008 12:14:10 +0000 (12:14 -0000)
without the recursive option. Thanks to brad walker <bradmwalker@cableone.net>
for reporting. (trunk r9476)

svn path=/main/branches/2.1.2/; revision=9558

bin/dohtml

index 6aeb68ee5ac07e8cf912646b678cf13a86e9cf44..23d0292f4aef2bbcccd3ae81c7c75bc445194673 100755 (executable)
@@ -39,6 +39,13 @@ def dodir(path):
 def dofile(src,dst):
        os.spawnlp(os.P_WAIT, "install", "install", "-m0644", src, dst)
 
+def eqawarn(lines):
+       cmd = "source '%s/isolated-functions.sh' ; " % \
+               os.environ["PORTAGE_BIN_PATH"]
+       for line in lines:
+               cmd += "eqawarn \"%s\" ; " % line
+       os.spawnlp(os.P_WAIT, "bash", "bash", "-c", cmd)
+
 def install(basename, dirname, options, prefix=""):
        fullpath = basename
        if prefix:
@@ -62,6 +69,10 @@ def install(basename, dirname, options, prefix=""):
                        pfx = basename
                        if prefix: pfx = prefix + "/" + pfx
                        install(i, dirname, options, pfx)
+       elif not options.recurse and os.path.isdir(fullpath):
+               eqawarn(["QA Notice: dohtml on directory " + \
+                       "'%s' without recursion option" % fullpath])
+               return False
        else:
                return False
        return True