-
Notifications
You must be signed in to change notification settings - Fork 3
/
cleanup-script.sh
executable file
·225 lines (216 loc) · 6.31 KB
/
cleanup-script.sh
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
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/bin/sh
#
# clean upstream source to achieve DFSG compliance
# Copyright 2009 by Bdale Garbee. GPL v2 or any later version.
#
git rm -rf doc
rm -rf doc
# This is a shell archive (produced by GNU sharutils 4.6.3).
# To extract the files from this archive, save it to some FILE, remove
# everything before the `#!/bin/sh' line above, then type `sh FILE'.
#
lock_dir=_sh04253
# Made on 2009-02-24 22:24 MST by <bdale@rover>.
# Source directory was `/home/bdale/debian/tar'.
#
# Existing files will *not* be overwritten, unless `-c' is specified.
#
# This shar contains:
# length mode name
# ------ ---------- ------------------------------------------
# 51 -rw-r--r-- doc/Makefile
# 51 -rw-r--r-- doc/Makefile.in
# 571 -rw-r--r-- doc/README
#
MD5SUM=${MD5SUM-md5sum}
f=`${MD5SUM} --version | egrep '^md5sum .*(core|text)utils'`
test -n "${f}" && md5check=true || md5check=false
${md5check} || \
echo 'Note: not verifying md5sums. Consider installing GNU coreutils.'
save_IFS="${IFS}"
IFS="${IFS}:"
gettext_dir=FAILED
locale_dir=FAILED
first_param="$1"
for dir in $PATH
do
if test "$gettext_dir" = FAILED && test -f $dir/gettext \
&& ($dir/gettext --version >/dev/null 2>&1)
then
case `$dir/gettext --version 2>&1 | sed 1q` in
*GNU*) gettext_dir=$dir ;;
esac
fi
if test "$locale_dir" = FAILED && test -f $dir/shar \
&& ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
then
locale_dir=`$dir/shar --print-text-domain-dir`
fi
done
IFS="$save_IFS"
if test "$locale_dir" = FAILED || test "$gettext_dir" = FAILED
then
echo=echo
else
TEXTDOMAINDIR=$locale_dir
export TEXTDOMAINDIR
TEXTDOMAIN=sharutils
export TEXTDOMAIN
echo="$gettext_dir/gettext -s"
fi
if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null
then if (echo -n test; echo 1,2,3) | grep n >/dev/null
then shar_n= shar_c='
'
else shar_n=-n shar_c= ; fi
else shar_n= shar_c='\c' ; fi
f=shar-touch.$$
st1=200112312359.59
st2=123123592001.59
st2tr=123123592001.5 # old SysV 14-char limit
st3=1231235901
if touch -am -t ${st1} ${f} >/dev/null 2>&1 && \
test ! -f ${st1} && test -f ${f}; then
shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
elif touch -am ${st2} ${f} >/dev/null 2>&1 && \
test ! -f ${st2} && test ! -f ${st2tr} && test -f ${f}; then
shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
elif touch -am ${st3} ${f} >/dev/null 2>&1 && \
test ! -f ${st3} && test -f ${f}; then
shar_touch='touch -am $3$4$5$6$2 "$8"'
else
shar_touch=:
echo
${echo} 'WARNING: not restoring timestamps. Consider getting and'
${echo} 'installing GNU `touch'\'', distributed in GNU coreutils...'
echo
fi
rm -f ${st1} ${st2} ${st2tr} ${st3} ${f}
#
if test ! -d ${lock_dir}
then : ; else ${echo} 'lock directory '${lock_dir}' exists'
exit 1
fi
if mkdir ${lock_dir}
then ${echo} 'x - created lock directory `'${lock_dir}\''.'
else ${echo} 'x - failed to create lock directory `'${lock_dir}\''.'
exit 1
fi
# ============= doc/Makefile ==============
if test ! -d 'doc'; then
mkdir 'doc'
if test $? -eq 0
then ${echo} 'x - created directory `doc'\''.'
else ${echo} 'x - failed to create directory `doc'\''.'
exit 1
fi
fi
if test -f 'doc/Makefile' && test "$first_param" != -c; then
${echo} 'x -SKIPPING doc/Makefile (file already exists)'
else
${echo} 'x - extracting doc/Makefile (text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/Makefile' &&
all:
X
install:
X
check:
X
distclean:
X rm -f Makefile
SHAR_EOF
(set 20 09 02 24 22 23 00 'doc/Makefile'; eval "$shar_touch") &&
chmod 0644 'doc/Makefile'
if test $? -ne 0
then ${echo} 'restore of doc/Makefile failed'
fi
if ${md5check}
then (
${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'doc/Makefile: MD5 check failed'
) << SHAR_EOF
426042328bcada50997fe11fff91ca61 doc/Makefile
SHAR_EOF
else
test `LC_ALL=C wc -c < 'doc/Makefile'` -ne 51 && \
${echo} 'restoration warning: size of doc/Makefile is not 51'
fi
fi
# ============= doc/Makefile.in ==============
if test ! -d 'doc'; then
mkdir 'doc'
if test $? -eq 0
then ${echo} 'x - created directory `doc'\''.'
else ${echo} 'x - failed to create directory `doc'\''.'
exit 1
fi
fi
if test -f 'doc/Makefile.in' && test "$first_param" != -c; then
${echo} 'x -SKIPPING doc/Makefile.in (file already exists)'
else
${echo} 'x - extracting doc/Makefile.in (text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/Makefile.in' &&
all:
X
install:
X
check:
X
distclean:
X rm -f Makefile
SHAR_EOF
(set 20 09 02 24 22 23 00 'doc/Makefile.in'; eval "$shar_touch") &&
chmod 0644 'doc/Makefile.in'
if test $? -ne 0
then ${echo} 'restore of doc/Makefile.in failed'
fi
if ${md5check}
then (
${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'doc/Makefile.in: MD5 check failed'
) << SHAR_EOF
426042328bcada50997fe11fff91ca61 doc/Makefile.in
SHAR_EOF
else
test `LC_ALL=C wc -c < 'doc/Makefile.in'` -ne 51 && \
${echo} 'restoration warning: size of doc/Makefile.in is not 51'
fi
fi
# ============= doc/README ==============
if test -f 'doc/README' && test "$first_param" != -c; then
${echo} 'x -SKIPPING doc/README (file already exists)'
else
${echo} 'x - extracting doc/README (text)'
sed 's/^X//' << 'SHAR_EOF' > 'doc/README' &&
Unfortunately, the info document describing tar is licensed under the GFDL with
invariant cover texts, which violates the Debian Free Software Guidelines. As
a result, the info documentation for tar has been completely removed from the
Debian package. Instead, we deliver a tar man page that was created from
scratch for the Debian project.
X
If you want to read the complete documentation for GNU tar, please either
install the 'tar-doc' package from Debian's non-free repository, or refer to
the online version at <http://www.gnu.org/software/tar/manual/index.html>.
X
SHAR_EOF
(set 20 09 02 24 22 23 00 'doc/README'; eval "$shar_touch") &&
chmod 0644 'doc/README'
if test $? -ne 0
then ${echo} 'restore of doc/README failed'
fi
if ${md5check}
then (
${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'doc/README: MD5 check failed'
) << SHAR_EOF
2ca08c08d4bff8e2dcf2b33f717512ef doc/README
SHAR_EOF
else
test `LC_ALL=C wc -c < 'doc/README'` -ne 571 && \
${echo} 'restoration warning: size of doc/README is not 571'
fi
fi
if rm -fr ${lock_dir}
then ${echo} 'x - removed lock directory `'${lock_dir}\''.'
else ${echo} 'x - failed to remove lock directory `'${lock_dir}\''.'
exit 1
fi
git add doc/Makefile doc/Makefile.in doc/README
exit 0