-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathRepo_clean
More file actions
executable file
·150 lines (111 loc) · 3.84 KB
/
Copy pathRepo_clean
File metadata and controls
executable file
·150 lines (111 loc) · 3.84 KB
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#! /bin/bash
# Quickscope - a software oscilloscope
#
# Copyright (C) 2012-2014 Lance Arsenault
# This file is part of Quickscope.
#
# Quickscope is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published
# by the Free Software Foundation, either version 3 of the License,
# or (at your option) any later version.
#
# Quickscope is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Quickscope. If not, see <http://www.gnu.org/licenses/>.
#
####################################################################
# This script removes auto generated files. See output from
# $0 --help.
function usage()
{
cat <<END
Usage: $0 [--force|--help|-h]
Remove generated files. Removes files that are generated
by the Quickscope package build system. Look at this script
to see what is removed, so that you don't lose files that you
want to keep. This will not remove files if it looks like you
do not have the required programs in you path needed to regenerate
them.
This script removes auto generated files. If you don't have the
tools needed in your PATH to regenerate the auto generated files
this script will not do anything, or so it tries. This should not
remove any of your extra development cruft files like
joes_configure.bash or .*.swp which you may need but will not go
into the repository. Distribution tar files are not removed either.
OPTIONS
--force run this script without checking that required
packages are in your path
--help|-h print this help and exit
END
exit 1
}
function rm_common()
{
rm -f *.o *.la *.so *.lo stamp-h* *.a *.xpm\
Makefile Makefile.in stamp-h*
rm -rf .libs .deps
}
function remove_files()
{
srcdir="$(dirname ${BASH_SOURCE[0]})" || exit 1
cd $srcdir || exit 1
####################################################################
set -x
# remove if empty
for f in NEWS AUTHORS ChangeLog ; do
if [ -f "$f" ] && [ ! -s "$f" ] ; then
rm -f $f
fi
done
####################################################################
# top src dir
# generated directories
rm -rf conftest.dir autom4te.cache
rm_common
rm -f\
aclocal.m4 config.cache config.h install-sh config.log\
missing mkinstalldirs ltmain.sh\
config.sub config.guess configure README.html\
configure.scan autoscan-*x.log INSTALL\
libtool config.status autoscan.log depcomp confdefs.h\
depend.make compile ar-lib
####################################################################
# directory lib/
cd lib || exit 1
rm_common
rm -f\
config.h quickscope.h quickscope.xpm\
quickscope.pc quickscope.ico debug.h config.h*
####################################################################
# directory bin/
cd ../bin || exit 1
rm_common
rm -f qs_*
####################################################################
# directory tests/
cd ../tests || exit 1
rm_common
rm -f tests_launcher hello circle saw_print\
non_master_print qsSource sin soundFile\
soundFile_print rk4_print ode ode_print ode_3wins\
urandom rossler3Wins alsa_info\
alsa_capture_print alsaCapture\
qsGtkWidget controller app_arg idle\
sin.c ode.c rossler3Wins.c alsaCapture.c
####################################################################
# directory examples/
cd ../examples || exit 1
make clean || exit 1
######################################################################
exit 0
}
[ "$1" = "--force" ] && remove_files
[ -z "$1" ] || usage
# Test that we have some programs in path
source repo_require.bash || exit 1
check_repo_require
remove_files