Skip to content

Commit d7d36c8

Browse files
committed
Install gzip-1.2.4.tar.gz
Signed-off-by: Erik Faye-Lund <[email protected]>
1 parent f354ff8 commit d7d36c8

24 files changed

Lines changed: 3223 additions & 0 deletions

File tree

mingw/bin/gunzip.exe

84.4 KB
Binary file not shown.

mingw/bin/gzexe

Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
:
2+
#!/bin/sh
3+
# gzexe: compressor for Unix executables.
4+
# Use this only for binaries that you do not use frequently.
5+
#
6+
# The compressed version is a shell script which decompresses itself after
7+
# skipping $skip lines of shell commands. We try invoking the compressed
8+
# executable with the original name (for programs looking at their name).
9+
# We also try to retain the original file permissions on the compressed file.
10+
# For safety reasons, gzexe will not create setuid or setgid shell scripts.
11+
12+
# WARNING: the first line of this file must be either : or #!/bin/sh
13+
# The : is required for some old versions of csh.
14+
# On Ultrix, /bin/sh is too buggy, change the first line to: #!/bin/sh5
15+
16+
x=`basename $0`
17+
if test $# = 0; then
18+
echo compress executables. original file foo is renamed to foo~
19+
echo usage: ${x} [-d] files...
20+
echo " -d decompress the executables"
21+
exit 1
22+
fi
23+
24+
tmp=gz$$
25+
trap "rm -f $tmp; exit 1" 1 2 3 5 10 13 15
26+
27+
decomp=0
28+
res=0
29+
test "$x" = "ungzexe" && decomp=1
30+
if test "x$1" = "x-d"; then
31+
decomp=1
32+
shift
33+
fi
34+
35+
echo hi > zfoo1$$
36+
echo hi > zfoo2$$
37+
if test -z "`(${CPMOD-cpmod} zfoo1$$ zfoo2$$) 2>&1`"; then
38+
cpmod=${CPMOD-cpmod}
39+
fi
40+
rm -f zfoo[12]$$
41+
42+
tail=""
43+
IFS="${IFS= }"; saveifs="$IFS"; IFS="${IFS}:"
44+
for dir in $PATH; do
45+
test -z "$dir" && dir=.
46+
if test -f $dir/tail; then
47+
tail="$dir/tail"
48+
break
49+
fi
50+
done
51+
IFS="$saveifs"
52+
if test -z "$tail"; then
53+
echo cannot find tail
54+
exit 1
55+
fi
56+
57+
for i do
58+
if test ! -f "$i" ; then
59+
echo ${x}: $i not a file
60+
res=1
61+
continue
62+
fi
63+
if test $decomp -eq 0; then
64+
if sed -e 1d -e 2q "$i" | grep "^skip=[0-9]*$" >/dev/null; then
65+
echo "${x}: $i is already gzexe'd"
66+
continue
67+
fi
68+
fi
69+
if ls -l "$i" | grep '^...[sS]' > /dev/null; then
70+
echo "${x}: $i has setuid permission, unchanged"
71+
continue
72+
fi
73+
if ls -l "$i" | grep '^......[sS]' > /dev/null; then
74+
echo "${x}: $i has setgid permission, unchanged"
75+
continue
76+
fi
77+
case "`basename $i`" in
78+
gzip | tail | chmod | ln | sleep | rm)
79+
echo "${x}: $i would depend on itself"; continue ;;
80+
esac
81+
if test -z "$cpmod"; then
82+
cp -p "$i" $tmp 2>/dev/null || cp "$i" $tmp
83+
if test -w $tmp 2>/dev/null; then
84+
writable=1
85+
else
86+
writable=0
87+
chmod u+w $tmp 2>/dev/null
88+
fi
89+
fi
90+
if test $decomp -eq 0; then
91+
sed 1q $0 > $tmp
92+
sed "s|^if tail|if $tail|" >> $tmp <<'EOF'
93+
skip=18
94+
if tail +$skip $0 | "/mingw/bin"/gzip -cd > /tmp/gztmp$$; then
95+
/bin/chmod 700 /tmp/gztmp$$
96+
prog="`echo $0 | /bin/sed 's|^.*/||'`"
97+
if /bin/ln /tmp/gztmp$$ "/tmp/$prog" 2>/dev/null; then
98+
trap '/bin/rm -f /tmp/gztmp$$ "/tmp/$prog"; exit $res' 0
99+
(/bin/sleep 5; /bin/rm -f /tmp/gztmp$$ "/tmp/$prog") 2>/dev/null &
100+
/tmp/"$prog" ${1+"$@"}; res=$?
101+
else
102+
trap '/bin/rm -f /tmp/gztmp$$; exit $res' 0
103+
(/bin/sleep 5; /bin/rm -f /tmp/gztmp$$) 2>/dev/null &
104+
/tmp/gztmp$$ ${1+"$@"}; res=$?
105+
fi
106+
else
107+
echo Cannot decompress $0; exit 1
108+
fi; exit $res
109+
EOF
110+
"/mingw/bin"/gzip -cv9 "$i" >> $tmp || {
111+
/bin/rm -f $tmp
112+
echo ${x}: compression not possible for $i, file unchanged.
113+
res=1
114+
continue
115+
}
116+
117+
else
118+
# decompression
119+
skip=18
120+
if sed -e 1d -e 2q "$i" | grep "^skip=[0-9]*$" >/dev/null; then
121+
eval `sed -e 1d -e 2q "$i"`
122+
fi
123+
if tail +$skip "$i" | "/mingw/bin"/gzip -cd > $tmp; then
124+
:
125+
else
126+
echo ${x}: $i probably not in gzexe format, file unchanged.
127+
res=1
128+
continue
129+
fi
130+
fi
131+
rm -f "$i~"
132+
mv "$i" "$i~" || {
133+
echo ${x}: cannot backup $i as $i~
134+
rm -f $tmp
135+
res=1
136+
continue
137+
}
138+
mv $tmp "$i" || cp -p $tmp "$i" 2>/dev/null || cp $tmp "$i" || {
139+
echo ${x}: cannot create $i
140+
rm -f $tmp
141+
res=1
142+
continue
143+
}
144+
rm -f $tmp
145+
if test -n "$cpmod"; then
146+
$cpmod "$i~" "$i" 2>/dev/null
147+
elif test $writable -eq 0; then
148+
chmod u-w $i 2>/dev/null
149+
fi
150+
done
151+
exit $res

mingw/bin/gzip.exe

84.4 KB
Binary file not shown.

mingw/bin/zcat.exe

84.4 KB
Binary file not shown.

mingw/bin/zcmp

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
:
2+
#!/bin/sh
3+
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
4+
5+
# Zcmp and zdiff are used to invoke the cmp or the diff pro-
6+
# gram on compressed files. All options specified are passed
7+
# directly to cmp or diff. If only 1 file is specified, then
8+
# the files compared are file1 and an uncompressed file1.gz.
9+
# If two files are specified, then they are uncompressed (if
10+
# necessary) and fed to cmp or diff. The exit status from cmp
11+
# or diff is preserved.
12+
13+
PATH="/mingw/bin:$PATH"; export PATH
14+
prog=`echo $0 | sed 's|.*/||'`
15+
case "$prog" in
16+
*cmp) comp=${CMP-cmp} ;;
17+
*) comp=${DIFF-diff} ;;
18+
esac
19+
20+
OPTIONS=
21+
FILES=
22+
for ARG
23+
do
24+
case "$ARG" in
25+
-*) OPTIONS="$OPTIONS $ARG";;
26+
*) if test -f "$ARG"; then
27+
FILES="$FILES $ARG"
28+
else
29+
echo "${prog}: $ARG not found or not a regular file"
30+
exit 1
31+
fi ;;
32+
esac
33+
done
34+
if test -z "$FILES"; then
35+
echo "Usage: $prog [${comp}_options] file [file]"
36+
exit 1
37+
fi
38+
set $FILES
39+
if test $# -eq 1; then
40+
FILE=`echo "$1" | sed 's/[-.][zZtga]*$//'`
41+
gzip -cd "$1" | $comp $OPTIONS - "$FILE"
42+
STAT="$?"
43+
44+
elif test $# -eq 2; then
45+
case "$1" in
46+
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
47+
case "$2" in
48+
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
49+
F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'`
50+
gzip -cdfq "$2" > /tmp/"$F".$$
51+
gzip -cdfq "$1" | $comp $OPTIONS - /tmp/"$F".$$
52+
STAT="$?"
53+
/bin/rm -f /tmp/"$F".$$;;
54+
55+
*) gzip -cdfq "$1" | $comp $OPTIONS - "$2"
56+
STAT="$?";;
57+
esac;;
58+
*) case "$2" in
59+
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
60+
gzip -cdfq "$2" | $comp $OPTIONS "$1" -
61+
STAT="$?";;
62+
*) $comp $OPTIONS "$1" "$2"
63+
STAT="$?";;
64+
esac;;
65+
esac
66+
exit "$STAT"
67+
else
68+
echo "Usage: $prog [${comp}_options] file [file]"
69+
exit 1
70+
fi

mingw/bin/zdiff

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
:
2+
#!/bin/sh
3+
# sh is buggy on RS/6000 AIX 3.2. Replace above line with #!/bin/ksh
4+
5+
# Zcmp and zdiff are used to invoke the cmp or the diff pro-
6+
# gram on compressed files. All options specified are passed
7+
# directly to cmp or diff. If only 1 file is specified, then
8+
# the files compared are file1 and an uncompressed file1.gz.
9+
# If two files are specified, then they are uncompressed (if
10+
# necessary) and fed to cmp or diff. The exit status from cmp
11+
# or diff is preserved.
12+
13+
PATH="/mingw/bin:$PATH"; export PATH
14+
prog=`echo $0 | sed 's|.*/||'`
15+
case "$prog" in
16+
*cmp) comp=${CMP-cmp} ;;
17+
*) comp=${DIFF-diff} ;;
18+
esac
19+
20+
OPTIONS=
21+
FILES=
22+
for ARG
23+
do
24+
case "$ARG" in
25+
-*) OPTIONS="$OPTIONS $ARG";;
26+
*) if test -f "$ARG"; then
27+
FILES="$FILES $ARG"
28+
else
29+
echo "${prog}: $ARG not found or not a regular file"
30+
exit 1
31+
fi ;;
32+
esac
33+
done
34+
if test -z "$FILES"; then
35+
echo "Usage: $prog [${comp}_options] file [file]"
36+
exit 1
37+
fi
38+
set $FILES
39+
if test $# -eq 1; then
40+
FILE=`echo "$1" | sed 's/[-.][zZtga]*$//'`
41+
gzip -cd "$1" | $comp $OPTIONS - "$FILE"
42+
STAT="$?"
43+
44+
elif test $# -eq 2; then
45+
case "$1" in
46+
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
47+
case "$2" in
48+
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
49+
F=`echo "$2" | sed 's|.*/||;s|[-.][zZtga]*||'`
50+
gzip -cdfq "$2" > /tmp/"$F".$$
51+
gzip -cdfq "$1" | $comp $OPTIONS - /tmp/"$F".$$
52+
STAT="$?"
53+
/bin/rm -f /tmp/"$F".$$;;
54+
55+
*) gzip -cdfq "$1" | $comp $OPTIONS - "$2"
56+
STAT="$?";;
57+
esac;;
58+
*) case "$2" in
59+
*[-.]gz* | *[-.][zZ] | *.t[ga]z)
60+
gzip -cdfq "$2" | $comp $OPTIONS "$1" -
61+
STAT="$?";;
62+
*) $comp $OPTIONS "$1" "$2"
63+
STAT="$?";;
64+
esac;;
65+
esac
66+
exit "$STAT"
67+
else
68+
echo "Usage: $prog [${comp}_options] file [file]"
69+
exit 1
70+
fi

mingw/bin/zforce

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
:
2+
#!/bin/sh
3+
# zforce: force a gz extension on all gzip files so that gzip will not
4+
# compress them twice.
5+
#
6+
# This can be useful for files with names truncated after a file transfer.
7+
# 12345678901234 is renamed to 12345678901.gz
8+
9+
PATH="/mingw/bin:$PATH"; export PATH
10+
x=`basename $0`
11+
if test $# = 0; then
12+
echo "force a '.gz' extension on all gzip files"
13+
echo usage: $x files...
14+
exit 1
15+
fi
16+
17+
res=0
18+
for i do
19+
if test ! -f "$i" ; then
20+
echo ${x}: $i not a file
21+
res=1
22+
continue
23+
fi
24+
test `expr "$i" : '.*[.-]z$'` -eq 0 || continue
25+
test `expr "$i" : '.*[.-]gz$'` -eq 0 || continue
26+
test `expr "$i" : '.*[.]t[ag]z$'` -eq 0 || continue
27+
28+
if gzip -l < "$i" 2>/dev/null | grep '^defl' > /dev/null; then
29+
30+
if test `expr "$i" : '^............'` -eq 12; then
31+
new=`expr "$i" : '\(.*\)...$`.gz
32+
else
33+
new="$i.gz"
34+
fi
35+
if mv "$i" "$new" 2>/dev/null; then
36+
echo $i -- replaced with $new
37+
continue
38+
fi
39+
res=1; echo ${x}: cannot rename $i to $new
40+
fi
41+
done
42+
exit $res

0 commit comments

Comments
 (0)