diff options
author | Joey Hess <joey@gnu.kitenet.net> | 2009-02-04 21:57:13 -0500 |
---|---|---|
committer | Joey Hess <joey@gnu.kitenet.net> | 2009-02-04 21:57:13 -0500 |
commit | 40c6067eb67f28d207cf57f8ba2fc549315827b5 (patch) | |
tree | 51739f8915e3ddadc5fa0815c56672eae6ba064f /init.d/50vcs-ignore | |
parent | bc5d04189542e6da934f7c901b0765891cc5c1d1 (diff) |
Support darcs. Thanks to Gian Piero Carrubba. Closes: #510032
Diffstat (limited to 'init.d/50vcs-ignore')
-rwxr-xr-x | init.d/50vcs-ignore | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/init.d/50vcs-ignore b/init.d/50vcs-ignore index 43c245d..5c7aa78 100755 --- a/init.d/50vcs-ignore +++ b/init.d/50vcs-ignore @@ -7,6 +7,8 @@ elif [ "$VCS" = hg ] && [ ! -e .hgignore ]; then file=.hgignore elif [ "$VCS" = bzr ] && [ ! -e .bzrignore ]; then file=.bzrignore +elif [ "$VCS" = darcs ] && [ ! -e .darcsignore ]; then + file=.darcsignore fi if [ -z "$file" ] || [ -e "$file" ]; then @@ -40,9 +42,29 @@ ignore() { fi echo "$glob" >> $file ;; + darcs) + # darcs doesn't understand globs, so we need to translate + # them into regexs. Not a complete converter, but suitable + # for given globs. + if [ "${glob%\*}" != "$glob" ]; then + glob="${glob%\*}" + else + glob="$glob"'($|/)' + fi + if [ "${glob#\*}" != "$glob" ]; then + glob="${glob#\*}" + else + glob='(^|/)'"$glob" + fi + glob="$( printf %s $glob | sed -e 's/\./\\./g;s/\*/[^\/]*/g;' )" + echo "$glob" >> $file esac } +if [ "$VCS" = darcs ]; then + darcs setpref boringfile .darcsignore +fi + if [ "$LOWLEVEL_PACKAGE_MANAGER" = dpkg ]; then comment "new and old versions of conffiles, stored by dpkg" ignore "*.dpkg-*" |