summaryrefslogtreecommitdiffstats
path: root/bin/dispatch-conf
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-09-16 00:50:38 +0000
committerZac Medico <zmedico@gentoo.org>2006-09-16 00:50:38 +0000
commitf1c5465691f055c49056856e6e599b985e65ea12 (patch)
tree624e466a94ddc84948ae96ab763d92e0b9d31421 /bin/dispatch-conf
parent48415fe13b8300587fa0d725fac05237f6965957 (diff)
downloadportage-f1c5465691f055c49056856e6e599b985e65ea12.tar.gz
portage-f1c5465691f055c49056856e6e599b985e65ea12.tar.bz2
portage-f1c5465691f055c49056856e6e599b985e65ea12.zip
For bug #14321, make dispatch-conf scan for individual files listed in CONFIG_PROTECT.
svn path=/main/trunk/; revision=4461
Diffstat (limited to 'bin/dispatch-conf')
-rwxr-xr-xbin/dispatch-conf16
1 files changed, 12 insertions, 4 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index f5bf9e578..960a38312 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -14,13 +14,13 @@
from stat import *
from random import *
-import os, shutil, sys, string, re, commands, atexit
+import atexit, commands, os, re, shutil, stat, string, sys
sys.path = ["/usr/lib/portage/pym"]+sys.path
import portage, dispatch_conf
from portage_exec import find_binary
-FIND_EXTANT_CONFIGS = "find %s/ -iname '._cfg????_*' | sed -e 's://:/:g'"
+FIND_EXTANT_CONFIGS = "find '%s' %s -iname '._cfg????_%s'"
DIFF_CONTENTS = 'diff -Nu %s %s'
DIFF_CVS_INTERP = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "# .Header:.*"'
DIFF_WSCOMMENTS = 'diff -Nu %s %s | grep "^[+-][^+-]" | grep -v "^[-+]#" | grep -v "^[-+][:space:]*$"'
@@ -79,10 +79,18 @@ class dispatch:
#
for path in config_paths.split ():
- if not os.path.exists (path):
+ path = portage.normalize_path(path)
+ try:
+ mymode = os.lstat(path).st_mode
+ except OSError:
continue
+ basename = "*"
+ find_opts = ""
+ if not stat.S_ISDIR(mymode):
+ path, basename = os.path.split(path)
+ find_opts = "-maxdepth 1"
- confs += self.massage (os.popen (FIND_EXTANT_CONFIGS % (path,)).readlines ())
+ confs += self.massage(os.popen(FIND_EXTANT_CONFIGS % (path, find_opts, basename)).readlines())
if self.options['use-rcs'] == 'yes':
for rcs_util in ("rcs", "ci", "co", "rcsmerge"):