re-mark 1.29b-2 as not yet uploaded (merge madness!)
[debian/tar] / cleanup-script.sh
1 #!/bin/sh
2 #
3 #       clean upstream source to achieve DFSG compliance
4 #       Copyright 2009 by Bdale Garbee.  GPL v2 or any later version.
5 #
6
7 # preserve the man pages upstream has provided since 1.28
8 tmpfile=$(mktemp -p /tmp tar-doc.XXXXXXXX)
9 tar cf $tmpfile doc/tar.1 doc/rmt.8
10
11 git rm -rf doc
12 rm -rf doc
13
14 # This is a shell archive (produced by GNU sharutils 4.15.2).
15 # To extract the files from this archive, save it to some FILE, remove
16 # everything before the '#!/bin/sh' line above, then type 'sh FILE'.
17 #
18 lock_dir=_sh14383
19 # Made on 2016-07-22 13:04 MDT by <bdale@rover>.
20 # Source directory was '/home/bdale/debian/tar'.
21 #
22 # Existing files will *not* be overwritten, unless '-c' is specified.
23 #
24 # This shar contains:
25 # length mode       name
26 # ------ ---------- ------------------------------------------
27 #    638 -rw-r--r-- doc/README
28 #     51 -rw-r--r-- doc/Makefile.in
29 #     51 -rw-r--r-- doc/Makefile
30 #
31 MD5SUM=${MD5SUM-md5sum}
32 f=`${MD5SUM} --version | egrep '^md5sum .*(core|text)utils'`
33 test -n "${f}" && md5check=true || md5check=false
34 ${md5check} || \
35   echo 'Note: not verifying md5sums.  Consider installing GNU coreutils.'
36 if test "X$1" = "X-c"
37 then keep_file=''
38 else keep_file=true
39 fi
40 echo=echo
41 save_IFS="${IFS}"
42 IFS="${IFS}:"
43 gettext_dir=
44 locale_dir=
45 set_echo=false
46
47 for dir in $PATH
48 do
49   if test -f $dir/gettext \
50      && ($dir/gettext --version >/dev/null 2>&1)
51   then
52     case `$dir/gettext --version 2>&1 | sed 1q` in
53       *GNU*) gettext_dir=$dir
54       set_echo=true
55       break ;;
56     esac
57   fi
58 done
59
60 if ${set_echo}
61 then
62   set_echo=false
63   for dir in $PATH
64   do
65     if test -f $dir/shar \
66        && ($dir/shar --print-text-domain-dir >/dev/null 2>&1)
67     then
68       locale_dir=`$dir/shar --print-text-domain-dir`
69       set_echo=true
70       break
71     fi
72   done
73
74   if ${set_echo}
75   then
76     TEXTDOMAINDIR=$locale_dir
77     export TEXTDOMAINDIR
78     TEXTDOMAIN=sharutils
79     export TEXTDOMAIN
80     echo="$gettext_dir/gettext -s"
81   fi
82 fi
83 IFS="$save_IFS"
84 if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null
85 then if (echo -n test; echo 1,2,3) | grep n >/dev/null
86      then shar_n= shar_c='
87 '
88      else shar_n=-n shar_c= ; fi
89 else shar_n= shar_c='\c' ; fi
90 f=shar-touch.$$
91 st1=200112312359.59
92 st2=123123592001.59
93 st2tr=123123592001.5 # old SysV 14-char limit
94 st3=1231235901
95
96 if   touch -am -t ${st1} ${f} >/dev/null 2>&1 && \
97      test ! -f ${st1} && test -f ${f}; then
98   shar_touch='touch -am -t $1$2$3$4$5$6.$7 "$8"'
99
100 elif touch -am ${st2} ${f} >/dev/null 2>&1 && \
101      test ! -f ${st2} && test ! -f ${st2tr} && test -f ${f}; then
102   shar_touch='touch -am $3$4$5$6$1$2.$7 "$8"'
103
104 elif touch -am ${st3} ${f} >/dev/null 2>&1 && \
105      test ! -f ${st3} && test -f ${f}; then
106   shar_touch='touch -am $3$4$5$6$2 "$8"'
107
108 else
109   shar_touch=:
110   echo
111   ${echo} 'WARNING: not restoring timestamps.  Consider getting and
112 installing GNU '\''touch'\'', distributed in GNU coreutils...'
113   echo
114 fi
115 rm -f ${st1} ${st2} ${st2tr} ${st3} ${f}
116 #
117 if test ! -d ${lock_dir} ; then :
118 else ${echo} "lock directory ${lock_dir} exists"
119      exit 1
120 fi
121 if mkdir ${lock_dir}
122 then ${echo} "x - created lock directory ${lock_dir}."
123 else ${echo} "x - failed to create lock directory ${lock_dir}."
124      exit 1
125 fi
126 # ============= doc/README ==============
127 if test ! -d 'doc'; then
128   mkdir 'doc'
129 if test $? -eq 0
130 then ${echo} "x - created directory doc."
131 else ${echo} "x - failed to create directory doc."
132      exit 1
133 fi
134 fi
135 if test -n "${keep_file}" && test -f 'doc/README'
136 then
137 ${echo} "x - SKIPPING doc/README (file already exists)"
138
139 else
140 ${echo} "x - extracting doc/README (text)"
141   sed 's/^X//' << 'SHAR_EOF' > 'doc/README' &&
142 Unfortunately, the info document describing tar is licensed under the GFDL with
143 invariant cover texts, which violates the Debian Free Software Guidelines.  As
144 a result, the info documentation for tar has been completely removed from the
145 Debian package.  Fortunately, since 1.28 the upstream tar package includes
146 man page sources, so at least that documentation is included in the Debian
147 main tar package.
148 X
149 If you want to read the complete info documentation for GNU tar, please either
150 install the 'tar-doc' package from Debian's non-free repository, or refer to
151 the online version at <http://www.gnu.org/software/tar/manual/index.html>.
152 X
153 SHAR_EOF
154   (set 20 16 07 22 13 04 11 'doc/README'
155    eval "${shar_touch}") && \
156   chmod 0644 'doc/README'
157 if test $? -ne 0
158 then ${echo} "restore of doc/README failed"
159 fi
160   if ${md5check}
161   then (
162        ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'doc/README': 'MD5 check failed'
163        ) << \SHAR_EOF
164 2f70316837b4f65972a24e61ab8f0897  doc/README
165 SHAR_EOF
166
167 else
168 test `LC_ALL=C wc -c < 'doc/README'` -ne 638 && \
169   ${echo} "restoration warning:  size of 'doc/README' is not 638"
170   fi
171 fi
172 # ============= doc/Makefile.in ==============
173 if test ! -d 'doc'; then
174   mkdir 'doc'
175 if test $? -eq 0
176 then ${echo} "x - created directory doc."
177 else ${echo} "x - failed to create directory doc."
178      exit 1
179 fi
180 fi
181 if test -n "${keep_file}" && test -f 'doc/Makefile.in'
182 then
183 ${echo} "x - SKIPPING doc/Makefile.in (file already exists)"
184
185 else
186 ${echo} "x - extracting doc/Makefile.in (text)"
187   sed 's/^X//' << 'SHAR_EOF' > 'doc/Makefile.in' &&
188 all:
189 X
190 install:
191 X
192 check:
193 X
194 distclean:
195 X       rm -f Makefile
196 SHAR_EOF
197   (set 20 16 07 22 13 03 35 'doc/Makefile.in'
198    eval "${shar_touch}") && \
199   chmod 0644 'doc/Makefile.in'
200 if test $? -ne 0
201 then ${echo} "restore of doc/Makefile.in failed"
202 fi
203   if ${md5check}
204   then (
205        ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'doc/Makefile.in': 'MD5 check failed'
206        ) << \SHAR_EOF
207 426042328bcada50997fe11fff91ca61  doc/Makefile.in
208 SHAR_EOF
209
210 else
211 test `LC_ALL=C wc -c < 'doc/Makefile.in'` -ne 51 && \
212   ${echo} "restoration warning:  size of 'doc/Makefile.in' is not 51"
213   fi
214 fi
215 # ============= doc/Makefile ==============
216 if test -n "${keep_file}" && test -f 'doc/Makefile'
217 then
218 ${echo} "x - SKIPPING doc/Makefile (file already exists)"
219
220 else
221 ${echo} "x - extracting doc/Makefile (text)"
222   sed 's/^X//' << 'SHAR_EOF' > 'doc/Makefile' &&
223 all:
224 X
225 install:
226 X
227 check:
228 X
229 distclean:
230 X       rm -f Makefile
231 SHAR_EOF
232   (set 20 16 07 22 13 03 35 'doc/Makefile'
233    eval "${shar_touch}") && \
234   chmod 0644 'doc/Makefile'
235 if test $? -ne 0
236 then ${echo} "restore of doc/Makefile failed"
237 fi
238   if ${md5check}
239   then (
240        ${MD5SUM} -c >/dev/null 2>&1 || ${echo} 'doc/Makefile': 'MD5 check failed'
241        ) << \SHAR_EOF
242 426042328bcada50997fe11fff91ca61  doc/Makefile
243 SHAR_EOF
244
245 else
246 test `LC_ALL=C wc -c < 'doc/Makefile'` -ne 51 && \
247   ${echo} "restoration warning:  size of 'doc/Makefile' is not 51"
248   fi
249 fi
250 if rm -fr ${lock_dir}
251 then ${echo} "x - removed lock directory ${lock_dir}."
252 else ${echo} "x - failed to remove lock directory ${lock_dir}."
253      exit 1
254 fi
255
256 tar xf $tmpfile doc/tar.1 doc/rmt.8
257 git add doc/Makefile doc/Makefile.in doc/README doc/tar.1 doc/rmt.8
258
259 exit 0
260