TODO: add entries for centralizing licensing and authorship information and incorpora...
[Ale.git] / repo-clean
blobeabf9e4d0421c04a966a92a53cb6980b5ab4a099
1 #!/bin/sh
3 # Copyright 2006 David Hilvert <dhilvert@auricle.dyndns.org>,
4 # <dhilvert@ugcs.caltech.edu>
6 # This file is part of the Anti-Lamenessing Engine.
8 # The Anti-Lamenessing Engine is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # The Anti-Lamenessing Engine is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with Anti-Lamenessing Engine; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 ###
23 ### 'repo-clean' attempts to remove files not in the
24 ### repository.
25 ###
28 # Use makefile clean commands.
31 echo ""
32 echo "Running makefile 'clean' commands."
33 make clean &> /dev/null
34 make distclean &> /dev/null
37 # List other candidates for removal.
40 echo ""
41 echo "Other removal candidates (run manually if OK):"
42 echo ""
43 find | xargs file | grep "symbolic link" | sed -e 's/:.*//g' | xargs -n 1 -r echo "rm"
46 # Check for the existence of repository resources.
49 if ! which darcs &> /dev/null; then
50 echo "*** Cannot find 'darcs'. ***"
51 exit
54 if ! ls _darcs &> /dev/null; then
55 echo "*** Cannot find repository directory '_darcs'.***"
56 exit
60 # List ordinary files that the repository doesn't know about.
63 darcs wha -l --boring | grep "^a.*[^/]$" | sed -e 's/a //' | xargs -n 1 -r echo "rm"
64 darcs wha -l --boring | grep "^a.*/$" | sed -e 's/a //' | xargs -n 1 -r echo "rmdir"