From 47dc1883f1f730f9576ae0e6090ead01732ff4ff Mon Sep 17 00:00:00 2001 From: Bdale Garbee Date: Mon, 4 Feb 2008 21:46:42 -0700 Subject: [PATCH] Imported Debian patch 1.3.12-5 --- debian/changelog | 10 ++++++ debian/control | 8 +++++ debian/gzip-win32.dirs | 1 + debian/rules | 81 +++++++++++++++++++++++++++++------------- gzip.c | 63 ++++++++++++++++---------------- zgrep.in | 2 +- 6 files changed, 109 insertions(+), 56 deletions(-) create mode 100644 debian/gzip-win32.dirs diff --git a/debian/changelog b/debian/changelog index b0f7187..d748e6c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,13 @@ +gzip (1.3.12-5) unstable; urgency=low + + * patch for zgrep.in from Daniel Kobras, closes: #434429 + * patch from upstream to fix compilation with mingw32, and patch from + Robert Millan to build a win32 executable if mingw32 is available, all + to fix a preseeding problem in the win32-loader for Debian Installer. + closes: #457867 + + -- Bdale Garbee Mon, 04 Feb 2008 21:46:42 -0700 + gzip (1.3.12-4) unstable; urgency=low * incorporate diffs from NMUs, closes: #434275, #433845, #438675 diff --git a/debian/control b/debian/control index cd72528..3adea2d 100644 --- a/debian/control +++ b/debian/control @@ -3,6 +3,7 @@ Section: utils Priority: required Maintainer: Bdale Garbee Build-Depends: debhelper (>= 5), texinfo +Build-Depends-Indep: mingw32 Standards-Version: 3.7.3 XS-DM-Upload-Allowed: yes @@ -19,3 +20,10 @@ Description: The GNU compression utility . This package can also decompress '.Z' files created with 'compress'. +Package: gzip-win32 +Architecture: all +Priority: extra +Suggests: wine +Description: The GNU compression utility (win32 build) + This is a win32 version of gzip. It's meant to be used by the win32-loader + component of Debian-Installer. diff --git a/debian/gzip-win32.dirs b/debian/gzip-win32.dirs new file mode 100644 index 0000000..56f2ee8 --- /dev/null +++ b/debian/gzip-win32.dirs @@ -0,0 +1 @@ +usr/share/win32 diff --git a/debian/rules b/debian/rules index a6d19bf..44ea806 100755 --- a/debian/rules +++ b/debian/rules @@ -21,23 +21,37 @@ endif configure: configure-stamp configure-stamp: dh_testdir - CFLAGS=$(CFLAGS) ./configure \ + mkdir -p build + cd build && CFLAGS=$(CFLAGS) ../configure \ --prefix=/usr --bindir=/bin \ --infodir=`pwd`/debian/gzip/usr/share/info \ --mandir=`pwd`/debian/gzip/usr/share/man $(CONFARGS) touch configure-stamp -build: configure-stamp build-stamp -build-stamp: +configure-win32: configure-win32-stamp +configure-win32-stamp: dh_testdir - $(MAKE) + mkdir -p build-win32 + cd build-win32 && ../configure --host=i586-mingw32msvc + touch configure-win32-stamp + +build: build-stamp +build-stamp: configure-stamp + dh_testdir + $(MAKE) -C build touch build-stamp +build-win32: build-win32-stamp +build-win32-stamp: configure-win32-stamp + dh_testdir + $(MAKE) -C build-win32 + touch build-win32-stamp + clean: dh_testdir dh_testroot - -rm -f build-stamp configure-stamp - make distclean || exit 0 + -rm -f build-stamp build-win32-stamp configure-stamp configure-win32-stamp + -rm -rf build build-win32 dh_clean install: build @@ -46,34 +60,53 @@ install: build dh_clean -k dh_installdirs - make install prefix=debian/gzip/usr bindir=debian/gzip/bin + $(MAKE) -C build install prefix=`pwd`/debian/gzip/usr bindir=`pwd`/debian/gzip/bin install -o root -g root -m 0644 debian/gzip.lintian \ debian/gzip/usr/share/lintian/overrides/gzip -binary-indep: build install - -binary-arch: build install +install-win32: build-win32 dh_testdir dh_testroot - dh_installdocs README* TODO - dh_installmanpages - dh_installinfo doc/gzip.info - dh_installchangelogs ChangeLog - dh_link - dh_strip - dh_compress + dh_clean -k + dh_installdirs + + install -m 0755 build-win32/gzip.exe debian/gzip-win32/usr/share/win32/ + +binary-indep: build-win32 install-win32 + dh_testdir -i + dh_testroot -i + dh_installdocs -i README* TODO + dh_installchangelogs -i ChangeLog + dh_compress -i + dh_fixperms -i + dh_installdeb -i + dh_gencontrol -i + dh_md5sums -i + dh_builddeb -i + +binary-arch: build install + dh_testdir -s + dh_testroot -s + dh_installdocs -s README* TODO + dh_installmanpages -s + dh_installinfo -s doc/gzip.info + dh_installchangelogs -s ChangeLog + dh_link -s + dh_strip -s + dh_compress -s ln -s gunzip.1.gz debian/gzip/usr/share/man/man1/uncompress.1.gz ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zegrep.1.gz ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zfgrep.1.gz - dh_fixperms + dh_fixperms -s # You may want to make some executables suid here. - dh_makeshlibs - dh_installdeb - dh_shlibdeps - dh_gencontrol - dh_md5sums - dh_builddeb + dh_makeshlibs -s + dh_installdeb -s + dh_shlibdeps -s + dh_gencontrol -s + dh_md5sums -s + dh_builddeb -s binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install configure +.PHONY: build-win32 install-win32 configure-win32 diff --git a/gzip.c b/gzip.c index affde9e..b45fc88 100644 --- a/gzip.c +++ b/gzip.c @@ -233,6 +233,30 @@ unsigned inptr; /* index of next byte to be processed in inbuf */ unsigned outcnt; /* bytes in output buffer */ int rsync = 0; /* make ryncable chunks */ +static int handled_sig[] = + { + /* SIGINT must be first, as 'foreground' depends on it. */ + SIGINT + +#ifdef SIGHUP + , SIGHUP +#endif +#ifdef SIGPIPE + , SIGPIPE +#else +# define SIGPIPE 0 +#endif +#ifdef SIGTERM + , SIGTERM +#endif +#ifdef SIGXCPU + , SIGXCPU +#endif +#ifdef SIGXFSZ + , SIGXFSZ +#endif + }; + struct option longopts[] = { /* { name has_arg *flag val } */ @@ -1760,30 +1784,7 @@ local void treat_dir (fd, dir) static void install_signal_handlers () { - static int sig[] = - { - /* SIGINT must be first, as 'foreground' depends on it. */ - SIGINT - -#ifdef SIGHUP - , SIGHUP -#endif -#ifdef SIGPIPE - , SIGPIPE -#else -# define SIGPIPE 0 -#endif -#ifdef SIGTERM - , SIGTERM -#endif -#ifdef SIGXCPU - , SIGXCPU -#endif -#ifdef SIGXFSZ - , SIGXFSZ -#endif - }; - int nsigs = sizeof sig / sizeof sig[0]; + int nsigs = sizeof handled_sig / sizeof handled_sig[0]; int i; #if SA_NOCLDSTOP @@ -1792,9 +1793,9 @@ install_signal_handlers () sigemptyset (&caught_signals); for (i = 0; i < nsigs; i++) { - sigaction (sig[i], NULL, &act); + sigaction (handled_sig[i], NULL, &act); if (act.sa_handler != SIG_IGN) - sigaddset (&caught_signals, sig[i]); + sigaddset (&caught_signals, handled_sig[i]); } act.sa_handler = abort_gzip_signal; @@ -1802,20 +1803,20 @@ install_signal_handlers () act.sa_flags = 0; for (i = 0; i < nsigs; i++) - if (sigismember (&caught_signals, sig[i])) + if (sigismember (&caught_signals, handled_sig[i])) { if (i == 0) foreground = 1; - sigaction (sig[i], &act, NULL); + sigaction (handled_sig[i], &act, NULL); } #else for (i = 0; i < nsigs; i++) - if (signal (sig[i], SIG_IGN) != SIG_IGN) + if (signal (handled_sig[i], SIG_IGN) != SIG_IGN) { if (i == 0) foreground = 1; - signal (sig[i], abort_gzip_signal); - siginterrupt (sig[i], 1); + signal (handled_sig[i], abort_gzip_signal); + siginterrupt (handled_sig[i], 1); } #endif } diff --git a/zgrep.in b/zgrep.in index e889ceb..5cca345 100644 --- a/zgrep.in +++ b/zgrep.in @@ -105,7 +105,7 @@ while test $# -ne 0; do files_with_matches=1;; (-L | --files-witho*) files_without_matches=1;; - (--no-f*) + (-h | --no-f*) no_filename=1;; (-V | --v | --ve | --ver | --vers | --versi | --versio | --version) echo "$version" || exit 2 -- 2.43.0