summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-04-11 08:58:58 +0000
committerZac Medico <zmedico@gentoo.org>2006-04-11 08:58:58 +0000
commit4d9a290a8533f57e1adf7d689d5bab044a80347c (patch)
tree528d3563f8c5503f545481a1bb50a326c7722382 /bin/dispatch-conf
parentMake qmerge imply noclean for bug #129559. (diff)
downloadportage-multirepo-4d9a290a8533f57e1adf7d689d5bab044a80347c.tar.gz
portage-multirepo-4d9a290a8533f57e1adf7d689d5bab044a80347c.tar.bz2
portage-multirepo-4d9a290a8533f57e1adf7d689d5bab044a80347c.zip
Make dispatch-conf play nice with symlinks for bug #129515. Thanks to Patrick McLean for the initial patch.
svn path=/main/trunk/; revision=3129
Diffstat (limited to 'bin/dispatch-conf')
-rwxr-xr-xbin/dispatch-conf10
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/dispatch-conf b/bin/dispatch-conf
index 586b9875..4df6306f 100755
--- a/bin/dispatch-conf
+++ b/bin/dispatch-conf
@@ -18,8 +18,16 @@ import os, shutil, sys, string, re, commands, atexit
sys.path = ["/usr/lib/portage/pym"]+sys.path
import portage, dispatch_conf
+import portage_exec
+
+# `readlink -f` is not supported on all systems, so it's necessary to test for
+# the alternative "realpath" program.
+FIND_EXTANT_CONFIGS = "find -L %s/ -iname '._cfg????_*' -exec realpath '{}' ';' | uniq | sed -e 's://:/:g'"
+realpath_binary = portage_exec.find_binary("realpath")
+if realpath_binary is None:
+ FIND_EXTANT_CONFIGS = FIND_EXTANT_CONFIGS.replace("realpath", "readlink -q -f")
+del realpath_binary
-FIND_EXTANT_CONFIGS = "find %s/ -iname '._cfg????_*' | sed -e 's://:/:g'"
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:]*$"'