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