Commit 212ca68f4f7ce36cbca0090a371edc0a762df5e5
1 parent
31dbfc0e
2.0.2
git-svn-id: svn+q:///qpdf/trunk@634 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing
7 changed files
with
106 additions
and
28 deletions
ChangeLog
README.maintainer
configure.ac
| ... | ... | @@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script. |
| 2 | 2 | dnl This config.in requires autoconf 2.5 or greater. |
| 3 | 3 | |
| 4 | 4 | AC_PREREQ(2.60) |
| 5 | -AC_INIT(qpdf,2.0.1) | |
| 5 | +AC_INIT(qpdf,2.0.2) | |
| 6 | 6 | |
| 7 | 7 | dnl No AC_CONFIG_HEADERS. If this changes, update README.maintainer. |
| 8 | 8 | AC_CONFIG_FILES([autoconf.mk]) | ... | ... |
manual/qpdf-manual.xml
| ... | ... | @@ -5,8 +5,8 @@ |
| 5 | 5 | <!ENTITY mdash "—"> |
| 6 | 6 | <!ENTITY ndash "–"> |
| 7 | 7 | <!ENTITY nbsp " "> |
| 8 | -<!ENTITY swversion "2.0.1"> | |
| 9 | -<!ENTITY lastreleased "May 6, 2008"> | |
| 8 | +<!ENTITY swversion "2.0.2"> | |
| 9 | +<!ENTITY lastreleased "June 30, 2008"> | |
| 10 | 10 | ]> |
| 11 | 11 | <book> |
| 12 | 12 | <bookinfo> |
| ... | ... | @@ -1965,6 +1965,21 @@ print "\n"; |
| 1965 | 1965 | <title>Release Notes</title> |
| 1966 | 1966 | <variablelist> |
| 1967 | 1967 | <varlistentry> |
| 1968 | + <term>2.0.2: June 30, 2008</term> | |
| 1969 | + <listitem> | |
| 1970 | + <itemizedlist> | |
| 1971 | + <listitem> | |
| 1972 | + <para> | |
| 1973 | + Update test suite to work properly with a | |
| 1974 | + non-<comamnd>bash</comamnd> <filename>/bin/sh</filename> and | |
| 1975 | + with Perl 5.10. No changes were made to the actual qpdf | |
| 1976 | + source code itself for this release. | |
| 1977 | + </para> | |
| 1978 | + </listitem> | |
| 1979 | + </itemizedlist> | |
| 1980 | + </listitem> | |
| 1981 | + </varlistentry> | |
| 1982 | + <varlistentry> | |
| 1968 | 1983 | <term>2.0.1: May 6, 2008</term> |
| 1969 | 1984 | <listitem> |
| 1970 | 1985 | <itemizedlist> | ... | ... |
qpdf/qpdf.cc
| ... | ... | @@ -447,7 +447,7 @@ int main(int argc, char* argv[]) |
| 447 | 447 | // 1 2 3 4 5 6 7 8 |
| 448 | 448 | // 12345678901234567890123456789012345678901234567890123456789012345678901234567890 |
| 449 | 449 | std::cout |
| 450 | - << whoami << " version 2.0.1" << std::endl | |
| 450 | + << whoami << " version 2.0.2" << std::endl | |
| 451 | 451 | << "Copyright (c) 2005-2008 Jay Berkenbilt" |
| 452 | 452 | << std::endl |
| 453 | 453 | << "This software may be distributed under the terms of version 2 of the" | ... | ... |
qtest/bin/qtest-driver
qtest/module/TestDriver.pm
| ... | ... | @@ -139,7 +139,10 @@ sub get_tty_features |
| 139 | 139 | no strict; |
| 140 | 140 | local $^W = 0; |
| 141 | 141 | local *X; |
| 142 | - require 'sys/ioctl.ph'; | |
| 142 | + { | |
| 143 | + local $SIG{'__WARN__'} = sub {}; | |
| 144 | + require 'sys/ioctl.ph'; | |
| 145 | + } | |
| 143 | 146 | if ((defined &TIOCGWINSZ) && open(X, "+</dev/tty")) |
| 144 | 147 | { |
| 145 | 148 | my $winsize = ""; |
| ... | ... | @@ -671,6 +674,8 @@ sub runtest |
| 671 | 674 | my $pid = undef; |
| 672 | 675 | my $pid_killer = new TestDriver::PidKiller(\$pid); |
| 673 | 676 | my $in = new IO::Handle; |
| 677 | + my $use_tempfile = ($^O eq 'MSWin32'); | |
| 678 | + my $tempout_status = undef; | |
| 674 | 679 | if (defined $in_string) |
| 675 | 680 | { |
| 676 | 681 | &QTC::TC("testdriver", "TestDriver input string"); |
| ... | ... | @@ -687,11 +692,30 @@ sub runtest |
| 687 | 692 | } |
| 688 | 693 | elsif (defined $in_command) |
| 689 | 694 | { |
| 690 | - $pid = open($in, "-|"); | |
| 691 | - croak +__PACKAGE__, "->runtest: fork failed: $!\n" unless defined $pid; | |
| 695 | + my $tempfilename = "$tempdir/tempout"; | |
| 696 | + my $tempfile = undef; | |
| 697 | + if ($use_tempfile) | |
| 698 | + { | |
| 699 | + $tempfile = new IO::File(">$tempfilename") or | |
| 700 | + die +(+__PACKAGE__, | |
| 701 | + "->runtest: unable to create $tempfilename: $!\n"); | |
| 702 | + $pid = fork; | |
| 703 | + croak +__PACKAGE__, "->runtest: fork failed: $!\n" | |
| 704 | + unless defined $pid; | |
| 705 | + } | |
| 706 | + else | |
| 707 | + { | |
| 708 | + $pid = open($in, "-|"); | |
| 709 | + croak +__PACKAGE__, "->runtest: fork failed: $!\n" | |
| 710 | + unless defined $pid; | |
| 711 | + } | |
| 692 | 712 | if ($pid == 0) |
| 693 | 713 | { |
| 694 | 714 | # child |
| 715 | + if (defined $tempfile) | |
| 716 | + { | |
| 717 | + open(STDOUT, ">&", $tempfile); | |
| 718 | + } | |
| 695 | 719 | open(STDERR, ">&STDOUT"); |
| 696 | 720 | open(STDIN, '<', \ ""); |
| 697 | 721 | if (ref($in_command) eq 'ARRAY') |
| ... | ... | @@ -711,6 +735,19 @@ sub runtest |
| 711 | 735 | $in_command, "\n"); |
| 712 | 736 | } |
| 713 | 737 | } |
| 738 | + else | |
| 739 | + { | |
| 740 | + if (defined $tempfile) | |
| 741 | + { | |
| 742 | + waitpid($pid, 0); | |
| 743 | + $tempout_status = $?; | |
| 744 | + $pid = undef; | |
| 745 | + open($in, "<$tempfilename") or | |
| 746 | + croak +(+__PACKAGE__, | |
| 747 | + "->runtest: unable to read from" . | |
| 748 | + " input file $tempfilename: $!\n"); | |
| 749 | + } | |
| 750 | + } | |
| 714 | 751 | } |
| 715 | 752 | else |
| 716 | 753 | { |
| ... | ... | @@ -768,22 +805,25 @@ sub runtest |
| 768 | 805 | last if defined $exit_status; |
| 769 | 806 | } |
| 770 | 807 | $in->close(); |
| 808 | + if (defined $tempout_status) | |
| 809 | + { | |
| 810 | + $exit_status = $tempout_status; | |
| 811 | + } | |
| 771 | 812 | if (defined $in_command) |
| 772 | 813 | { |
| 773 | 814 | if (! defined $exit_status) |
| 774 | 815 | { |
| 775 | 816 | $exit_status = $?; |
| 776 | 817 | } |
| 777 | - if (($exit_status > 0) && ($exit_status < 256)) | |
| 818 | + if (WIFSIGNALED($exit_status)) | |
| 778 | 819 | { |
| 779 | 820 | &QTC::TC("testdriver", "TestDriver exit status signal"); |
| 780 | - $exit_status &= 127; # clear core dump flag | |
| 781 | - $exit_status = "SIG:$exit_status"; | |
| 821 | + $exit_status = "SIG:" . WTERMSIG($exit_status); | |
| 782 | 822 | } |
| 783 | - else | |
| 823 | + elsif (WIFEXITED($exit_status)) | |
| 784 | 824 | { |
| 785 | 825 | &QTC::TC("testdriver", "TestDriver exit status number"); |
| 786 | - $exit_status >>= 8; | |
| 826 | + $exit_status = WEXITSTATUS($exit_status); | |
| 787 | 827 | } |
| 788 | 828 | } |
| 789 | 829 | $? = 0; |
| ... | ... | @@ -1533,28 +1573,44 @@ sub rmrf |
| 1533 | 1573 | sub safe_pipe |
| 1534 | 1574 | { |
| 1535 | 1575 | my ($cmd, $outfile) = @_; |
| 1536 | - my $pid = open(C, "-|"); | |
| 1537 | 1576 | my $result = 0; |
| 1538 | 1577 | |
| 1539 | - if ($pid) | |
| 1578 | + if ($^O eq 'MSWin32') | |
| 1540 | 1579 | { |
| 1541 | - # parent | |
| 1542 | - my $out = new IO::File(">$outfile") or | |
| 1543 | - die +__PACKAGE__, ": can't open $outfile: $!\n"; | |
| 1544 | - binmode C; | |
| 1545 | - while (<C>) | |
| 1580 | + my @cmd = @$cmd; | |
| 1581 | + my $cmd_str = shift(@cmd); | |
| 1582 | + while (@cmd) | |
| 1546 | 1583 | { |
| 1547 | - $out->print($_); | |
| 1584 | + my $arg = shift(@cmd); | |
| 1585 | + $cmd_str .= " \"$arg\""; | |
| 1548 | 1586 | } |
| 1549 | - close(C); | |
| 1550 | - $result = $?; | |
| 1551 | - $out->close(); | |
| 1587 | + $cmd_str .= " > $outfile 2>&1"; | |
| 1588 | + $result = system($cmd_str); | |
| 1552 | 1589 | } |
| 1553 | 1590 | else |
| 1554 | 1591 | { |
| 1555 | - # child | |
| 1556 | - open(STDERR, ">&STDOUT"); | |
| 1557 | - exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n"; | |
| 1592 | + my $pid = open(C, "-|"); | |
| 1593 | + | |
| 1594 | + if ($pid) | |
| 1595 | + { | |
| 1596 | + # parent | |
| 1597 | + my $out = new IO::File(">$outfile") or | |
| 1598 | + die +__PACKAGE__, ": can't open $outfile: $!\n"; | |
| 1599 | + binmode C; | |
| 1600 | + while (<C>) | |
| 1601 | + { | |
| 1602 | + $out->print($_); | |
| 1603 | + } | |
| 1604 | + close(C); | |
| 1605 | + $result = $?; | |
| 1606 | + $out->close(); | |
| 1607 | + } | |
| 1608 | + else | |
| 1609 | + { | |
| 1610 | + # child | |
| 1611 | + open(STDERR, ">&STDOUT"); | |
| 1612 | + exec(@$cmd) || die +__PACKAGE__, ": $cmd->[0] failed: $!\n"; | |
| 1613 | + } | |
| 1558 | 1614 | } |
| 1559 | 1615 | |
| 1560 | 1616 | $result; | ... | ... |