From 212ca68f4f7ce36cbca0090a371edc0a762df5e5 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Mon, 30 Jun 2008 14:48:16 +0000 Subject: [PATCH] 2.0.2 git-svn-id: svn+q:///qpdf/trunk@634 71b93d88-0707-0410-a8cf-f5a4172ac649 --- ChangeLog | 7 +++ README.maintainer | 2 +- configure.ac | 2 +- manual/qpdf-manual.xml | 19 ++++++- qpdf/qpdf.cc | 2 +- qtest/bin/qtest-driver | 2 +- qtest/module/TestDriver.pm | 100 +++++++++++++++++++++++++++++-------- 7 files changed, 106 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index bcde7f52..deb9ee43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-30 Jay Berkenbilt + + * 2.0.2: release + + * updated embedded qtest to version 1.2 (includes previous + changes) + 2008-06-07 Jay Berkenbilt * qpdf/qtest/qpdf/diff-encrypted: change == to = so that the test diff --git a/README.maintainer b/README.maintainer index 2f79e9d2..9e51a3b8 100644 --- a/README.maintainer +++ b/README.maintainer @@ -13,7 +13,7 @@ Release Reminders qpdf/qpdf.cc manual/qpdf-manual.xml - make_dist does this automatically. + make_dist verifies this consistency. * Each year, update copyright notices. Just search for Copyright. Last updated: 2008. diff --git a/configure.ac b/configure.ac index efdcfd1b..0122f107 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. dnl This config.in requires autoconf 2.5 or greater. AC_PREREQ(2.60) -AC_INIT(qpdf,2.0.1) +AC_INIT(qpdf,2.0.2) dnl No AC_CONFIG_HEADERS. If this changes, update README.maintainer. AC_CONFIG_FILES([autoconf.mk]) diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index d9b3b2ee..dd126f14 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -5,8 +5,8 @@ - - + + ]> @@ -1964,6 +1964,21 @@ print "\n"; Release Notes + + 2.0.2: June 30, 2008 + + + + + Update test suite to work properly with a + non-bash /bin/sh and + with Perl 5.10. No changes were made to the actual qpdf + source code itself for this release. + + + + + 2.0.1: May 6, 2008 diff --git a/qpdf/qpdf.cc b/qpdf/qpdf.cc index bfd27d55..b95b9ca8 100644 --- a/qpdf/qpdf.cc +++ b/qpdf/qpdf.cc @@ -447,7 +447,7 @@ int main(int argc, char* argv[]) // 1 2 3 4 5 6 7 8 // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 std::cout - << whoami << " version 2.0.1" << std::endl + << whoami << " version 2.0.2" << std::endl << "Copyright (c) 2005-2008 Jay Berkenbilt" << std::endl << "This software may be distributed under the terms of version 2 of the" diff --git a/qtest/bin/qtest-driver b/qtest/bin/qtest-driver index 1af99291..723a3e3f 100755 --- a/qtest/bin/qtest-driver +++ b/qtest/bin/qtest-driver @@ -33,7 +33,7 @@ require TestDriver; if ((@ARGV == 1) && ($ARGV[0] eq '--version')) { - print "$whoami version 1.1\n"; + print "$whoami version 1.2\n"; exit 0; } if ((@ARGV == 1) && ($ARGV[0] eq '--print-path')) diff --git a/qtest/module/TestDriver.pm b/qtest/module/TestDriver.pm index 6e1fa313..ea421702 100644 --- a/qtest/module/TestDriver.pm +++ b/qtest/module/TestDriver.pm @@ -139,7 +139,10 @@ sub get_tty_features no strict; local $^W = 0; local *X; - require 'sys/ioctl.ph'; + { + local $SIG{'__WARN__'} = sub {}; + require 'sys/ioctl.ph'; + } if ((defined &TIOCGWINSZ) && open(X, "+runtest: fork failed: $!\n" unless defined $pid; + my $tempfilename = "$tempdir/tempout"; + my $tempfile = undef; + if ($use_tempfile) + { + $tempfile = new IO::File(">$tempfilename") or + die +(+__PACKAGE__, + "->runtest: unable to create $tempfilename: $!\n"); + $pid = fork; + croak +__PACKAGE__, "->runtest: fork failed: $!\n" + unless defined $pid; + } + else + { + $pid = open($in, "-|"); + croak +__PACKAGE__, "->runtest: fork failed: $!\n" + unless defined $pid; + } if ($pid == 0) { # child + if (defined $tempfile) + { + open(STDOUT, ">&", $tempfile); + } open(STDERR, ">&STDOUT"); open(STDIN, '<', \ ""); if (ref($in_command) eq 'ARRAY') @@ -711,6 +735,19 @@ sub runtest $in_command, "\n"); } } + else + { + if (defined $tempfile) + { + waitpid($pid, 0); + $tempout_status = $?; + $pid = undef; + open($in, "<$tempfilename") or + croak +(+__PACKAGE__, + "->runtest: unable to read from" . + " input file $tempfilename: $!\n"); + } + } } else { @@ -768,22 +805,25 @@ sub runtest last if defined $exit_status; } $in->close(); + if (defined $tempout_status) + { + $exit_status = $tempout_status; + } if (defined $in_command) { if (! defined $exit_status) { $exit_status = $?; } - if (($exit_status > 0) && ($exit_status < 256)) + if (WIFSIGNALED($exit_status)) { &QTC::TC("testdriver", "TestDriver exit status signal"); - $exit_status &= 127; # clear core dump flag - $exit_status = "SIG:$exit_status"; + $exit_status = "SIG:" . WTERMSIG($exit_status); } - else + elsif (WIFEXITED($exit_status)) { &QTC::TC("testdriver", "TestDriver exit status number"); - $exit_status >>= 8; + $exit_status = WEXITSTATUS($exit_status); } } $? = 0; @@ -1533,28 +1573,44 @@ sub rmrf sub safe_pipe { my ($cmd, $outfile) = @_; - my $pid = open(C, "-|"); my $result = 0; - if ($pid) + if ($^O eq 'MSWin32') { - # parent - my $out = new IO::File(">$outfile") or - die +__PACKAGE__, ": can't open $outfile: $!\n"; - binmode C; - while () + my @cmd = @$cmd; + my $cmd_str = shift(@cmd); + while (@cmd) { - $out->print($_); + my $arg = shift(@cmd); + $cmd_str .= " \"$arg\""; } - close(C); - $result = $?; - $out->close(); + $cmd_str .= " > $outfile 2>&1"; + $result = system($cmd_str); } else { - # child - open(STDERR, ">&STDOUT"); - exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n"; + my $pid = open(C, "-|"); + + if ($pid) + { + # parent + my $out = new IO::File(">$outfile") or + die +__PACKAGE__, ": can't open $outfile: $!\n"; + binmode C; + while () + { + $out->print($_); + } + close(C); + $result = $?; + $out->close(); + } + else + { + # child + open(STDERR, ">&STDOUT"); + exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n"; + } } $result;