diff options
author | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-06 09:57:40 +0200 |
---|---|---|
committer | Daniel Friesel <derf@derf.homelinux.org> | 2008-09-06 09:57:40 +0200 |
commit | 8e1e823cd160145fda3921d75ecac767bcd5e9d8 (patch) | |
tree | 443af106d6acfdf9adbba1cc8d87df57fbce609d | |
parent | 7bfc883fafa4360c43e9f17f3bd648c9c74fdff5 (diff) |
Added 'conflicts' to check for double path entries
-rwxr-xr-x | include/conflicts | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/include/conflicts b/include/conflicts new file mode 100755 index 0000000..12d916d --- /dev/null +++ b/include/conflicts @@ -0,0 +1,41 @@ +#!/usr/bin/env zsh +## vim:ft=zsh +typeset file dir conflict i +typeset PDIR=$HOME/packages +typeset -a sfpath spath + +is_in_path () { + typeset -i ret=1 + typeset dir + typeset file=$1 + shift + for dir in $@; { + if [[ -e $dir/$file ]] { + ret=0 + echo $dir/$file + } + } + return $ret +} + +# a simple sfpath=${fpath:#/home/derf*} won't work +for i in ${fpath:#/home/derf*}; { + sfpath+=$i +} +for i in ${path:#/home/derf*}; { + spath+=$i +} + +for file in $PDIR/{*/provides/zsh/completions/*(N),zsh/etc/completions/*(N)}; { + conflict=$(is_in_path ${file:t} $sfpath) + if (( ? == 0 )) { + echo "conflict: $file <-> $conflict" + } +} + +for file in $PDIR/*/bin/*(N); { + conflict=$(is_in_path ${file:t} $spath) + if (( ? == 0 )) { + echo "conflict: $file <-> $conflict" + } +} |