-
Notifications
You must be signed in to change notification settings - Fork 2
/
de-bootstrap
executable file
·62 lines (53 loc) · 1.63 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
#!/usr/bin/env sh
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Copyright 1997 - July 2008 CWI, August 2008 - 2019 MonetDB B.V.
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}`