| 1 | #!/bin/sh |
| 2 | set -e |
| 3 | |
| 4 | if [ "$VCS" = darcs ] && [ -d _darcs ]; then |
| 5 | rc=0 |
| 6 | res=$( darcs add -qr . 2>&1 ) || rc=$? |
| 7 | if test $rc -ne 0; then |
| 8 | if ! test $rc -eq 2 -a "${res%No files were added}" != "$res"; then |
| 9 | printf "%s" "$res" |
| 10 | echo "etckeeper warning: darcs add failed" >&2 |
| 11 | fi |
| 12 | fi |
| 13 | unset rc res |
| 14 | fi |