From 40c6067eb67f28d207cf57f8ba2fc549315827b5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 4 Feb 2009 21:57:13 -0500 Subject: Support darcs. Thanks to Gian Piero Carrubba. Closes: #510032 --- init.d/50vcs-ignore | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'init.d/50vcs-ignore') 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-*" -- cgit v1.2.3