-
Notifications
You must be signed in to change notification settings - Fork 6
/
de-bootstrap
executable file
·73 lines (64 loc) · 2.08 KB
/
de-bootstrap
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/usr/bin/env sh
# The contents of this file are subject to the MonetDB Public License
# Version 1.1 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://www.monetdb.org/Legal/MonetDBLicense
#
# Software distributed under the License is distributed on an "AS IS"
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
# License for the specific language governing rights and limitations
# under the License.
#
# The Original Code is the MonetDB Database System.
#
# The Initial Developer of the Original Code is CWI.
# Portions created by CWI are Copyright (C) 1997-July 2008 CWI.
# Copyright August 2008-2013 MonetDB B.V.
# All Rights Reserved.
if [ "$1" ] ; then
echo '
This script ("./de-bootstrap") can be used to clean up the source tree,
i.e., to remove all files that were created by "./bootstrap".
"./de-bootstrap" first lists all files that are to be removed and
asks the user for confirmation before actually removing the files.
'
exit
fi
RM() {
if [ "x$1" = 'x-f' ]; then
shift
fi
L=-d
R=''
G=''
if [ "x$1" = 'x-r' -o "x$1" = 'x-rf' -o "x$1" = 'x-fr' ]; then
shift
L=-R
R=-r
G='/$|'
fi
if [ $# -eq 0 ]; then
# nothing to do
return
fi
x=N
n=`ls -Ad $L $* 2>/dev/null | egrep -v "^total [0-9]*$|^$|^[^ ]*:$" | wc -l | sed 's|^ *||'`
if [ $n != '0' ]; then
ls -lAFd $L $* 2>/dev/null | egrep -v "$G^total [0-9]*$|^$"
echo -e "Delete these $n files/directories? (y/N) \c"
read x
if [ "x$x" = 'xy' ]; then
( /bin/rm -f $R $* && echo "$n files deleted." ) || echo "rm failed."
else
echo "rm cancelled, no files/directories deleted."
fi
fi
}
if [ ! -d .hg ] ; then
echo '
This script ("./de-bootstrap") must be called in top-level directory of
MonetDB'\''s Mercurial (HG) source clone.
'
exit 1
fi
RM -rf `hg --config extensions.purge= purge --all -p -I{\*\*Makefile.\*,\*\*.pyc,aclocal.m4,acout.in,autom4te.cache,buildtools/conf/{config.{guess,sub},install-sh,ltmain.sh,l[ti]\*.m4,missing,ylwrap},configure{,.ac},{doc,install}.lst,monetdb_config.h.in}`