Bug #193548 - When scanning for config updates and an error
authorZac Medico <zmedico@gentoo.org>
Fri, 28 Sep 2007 21:52:51 +0000 (21:52 -0000)
committerZac Medico <zmedico@gentoo.org>
Fri, 28 Sep 2007 21:52:51 +0000 (21:52 -0000)
occurs, send find's stdout to /dev/null so that only an
error message is shown. (trunk r7875)

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

bin/emerge

index 7dc67c8c5c305ccae59fe54ee802a3e8f8d24cf7..cba9ef5e5b836e1d3a9aaee30e2b25f4b70b2c18 100755 (executable)
@@ -4537,11 +4537,13 @@ def chk_updated_cfg_files(target_root, config_protect):
                        else:
                                mycommand = "find '%s' -maxdepth 1 -iname '._cfg????_%s'" % \
                                        os.path.split(x.rstrip(os.path.sep))
-                       a = commands.getstatusoutput(mycommand + \
-                               " ! -iname '.*~' ! -iname '.*.bak' -print0")
+                       mycommand += " ! -iname '.*~' ! -iname '.*.bak' -print0"
+                       a = commands.getstatusoutput(mycommand)
                        if a[0] != 0:
-                               print >> sys.stderr, " " + bad("*")+ \
-                                       " error scanning '%s': %s" % (x, a[1])
+                               sys.stderr.write(" %s error scanning '%s': " % (bad("*"), x))
+                               sys.stderr.flush()
+                               # Show the error message alone, sending stdout to /dev/null.
+                               os.system(mycommand + " 1>/dev/null")
                        else:
                                files = a[1].split('\0')
                                # split always produces an empty string as the last element