+gzip (1.3.5-14) unstable; urgency=medium
+
+ * update section to match override
+ * patch from Matthew Chapman to avoid deleting input file before we're
+ sure the output file has been written without errors, closes: #366660
+ * patch from Reuben Thomas to fix zgrep return code,
+ closes: #292896, #192891, #190442
+ * enable gzexe compressed files to work on systems where tempfile is not
+ available while retaining preference for tempfile, closes: #334540
+
+ -- Bdale Garbee <bdale@gag.com> Tue, 20 Jun 2006 15:02:27 -0600
+
gzip (1.3.5-13) unstable; urgency=low
* patch from Reuben Thomas fixes problem passing zgrep filenames starting
Source: gzip
-Section: base
+Section: utils
Priority: required
Maintainer: Bdale Garbee <bdale@gag.com>
Build-Depends: debhelper (>= 5), texinfo
-Standards-Version: 3.6.2.2
+Standards-Version: 3.7.2
Package: gzip
Architecture: any
set -C
umask=`umask`
umask 77
-tmpfile=`tempfile -p gztmp -d /tmp` || exit 1
+tmpfile=`tempfile -p gztmp -d /tmp` || tmpfile=/tmp/gztmp.$$ || exit 1
if tail +$skip "$0" | /bin/gzip -cd >> $tmpfile; then
umask $umask
/bin/chmod 700 $tmpfile
close(ifd);
if (!to_stdout) {
- /* Copy modes, times, ownership, and remove the input file */
+ /* Copy modes, times, and ownership */
copy_stat(&istat);
if (close(ofd))
write_error();
+ remove_ofname = 0;
+
+ /* It's now safe to remove the input file: */
+ if (xunlink (ifname)) {
+ int e = errno;
+ WARN((stderr, "%s: ", progname));
+ if (!quiet) {
+ errno = e;
+ perror(ifname);
+ }
+ }
}
if (method == -1) {
if (!to_stdout) xunlink (ofname);
#ifndef NO_CHOWN
fchown(ofd, ifstat->st_uid, ifstat->st_gid); /* Copy ownership */
#endif
- remove_ofname = 0;
- /* It's now safe to remove the input file: */
- if (xunlink (ifname)) {
- int e = errno;
- WARN((stderr, "%s: ", progname));
- if (!quiet) {
- errno = e;
- perror(ifname);
- }
- }
}
#if ! NO_DIR
else
sed_script="s|^|${i}:|"
fi
- $grep $opt "$pat" | sed "$sed_script"
+ # Hack adapted from GPLed code at
+ # http://home.comcast.net/~j.p.h/cus-faq-2
+ # Has the same effect as the following two lines of bash:
+ #
+ # $grep $opt "$pat" | sed "$sed_script"
+ # exit ${PIPESTATUS[0]}
+ #
+ # Inside the `...`, fd4 goes to the pipe whose other end is read
+ # and passed to eval; fd1 is the normal standard output
+ # preserved the line before with exec 3>&1
+ exec 3>&1
+ eval `
+ exec 4>&1 >&3 3>&-
+ {
+ $grep $opt "$pat" 4>&-; echo "r=$?;" >&4
+ } | sed "$sed_script"
+ `
+ exit $r
fi
r=$?
test $res -lt $r && res=$r