diff options
-rw-r--r-- | Makefile.in | 8 | ||||
-rw-r--r-- | THANKS | 1 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rwxr-xr-x | help2man.PL | 18 | ||||
-rwxr-xr-x | help2man.h2m.PL | 9 | ||||
-rwxr-xr-x | help2man.html.PL | 19 |
6 files changed, 34 insertions, 26 deletions
diff --git a/Makefile.in b/Makefile.in index 74be6fc..84faf44 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,7 +88,7 @@ uninstall: fi clean: - -rm -f $(target) $(target).h2m $(target).*.h2m $(preload).so + -rm -f $(target) $(target).h2m $(target).*.h2m $(preload).so *.tmp[0-9]* -rm -rf localetmp mostlyclean: clean @@ -117,7 +117,7 @@ $(preload).so: $(srcdir)/$(preload).c man: $(target).1 $(target).1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL - $(MAKE) $(target).h2m + $(MAKE) $(target) $(target).h2m ./$(target) --include=$(target).h2m --output=$@ ./$(target) msg_l10n: $(addprefix po/,$(addsuffix .gmo,$(LINGUAS))) @@ -134,8 +134,8 @@ man_l10n: $(addprefix $(target).,$(addsuffix .1,$(LINGUAS))) $(target).%.1: $(srcdir)/$(target).PL $(srcdir)/$(target).h2m.PL \ $(srcdir)/po/%.po lang=$(patsubst $(target).%.1,%,$@); \ - $(MAKE) $(preload).so localetmp/$$lang/LC_MESSAGES/$(target).mo \ - $(target).$$lang.h2m; \ + $(MAKE) $(target) $(preload).so \ + localetmp/$$lang/LC_MESSAGES/$(target).mo $(target).$$lang.h2m; \ LD_PRELOAD=./$(preload).so LOCALEDIR=localetmp TEXTDOMAIN=help2man \ ./$(target) --include=$(call vpath_file,$(target).$$lang.h2m) \ --output=$@ ./$(target) @@ -25,6 +25,7 @@ Helge Kreutzmann <debian@helgefjell.de> Chris Leick <c.leick@vollbio.de> Werner Lemberg <wl@gnu.org> Lionel Elie Mamane <lionel@mamane.lu> +Richard Maw <richard.maw@codethink.co.uk> Jim Meyering <jim@meyering.net> Dave Morrison <dave@bnl.gov> Peter Moulder <reiter@netspace.net.au> diff --git a/debian/changelog b/debian/changelog index 12389de..48384b0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,8 +5,11 @@ help2man (1.40.8) unstable; urgency=low * Update Polish translation (thanks to Jakub Bogusz). * Update Russian translation (thanks to Yuri Kozlov). * Update Ukranian translation (thanks to Yuri Chornoivan). + * Modify self-extracting scripts to output to a temporary file. + * Ensure that help2man exists before building manual pages (as reported + by Richard Maw). - -- Brendan O'Dea <bod@debian.org> Sun, 08 Apr 2012 21:40:06 +1000 + -- Brendan O'Dea <bod@debian.org> Sun, 08 Apr 2012 23:10:20 +1000 help2man (1.40.7) unstable; urgency=low diff --git a/help2man.PL b/help2man.PL index 7e21196..d7ee1ff 100755 --- a/help2man.PL +++ b/help2man.PL @@ -16,7 +16,7 @@ use 5.008; use Config; use Getopt::Long; -my ($program, $version) = ('help2man', '1.40.7'); +my ($program, $version) = ('help2man', '1.40.8'); my %opts; die "Usage: $0 [--quiet] [--stdout] [--with-gettext] [--name] [--version]\n" @@ -28,6 +28,7 @@ print "$version\n" if $opts{version}; exit if $opts{name} or $opts{version}; my $target = $0; +my $tmp; if ($opts{stdout}) { *OUT = *STDOUT; @@ -37,8 +38,9 @@ else { $target =~ s!.*/!!; $target =~ s/\.PL$// or die "$0: can't determine target name\n"; - unlink $target or die "$0: can't unlink $target ($!)\n" if -e $target; - open OUT, ">$target" or die "$0: can't create $target ($!)\n"; + $tmp = "$target.tmp$$"; + unlink $tmp or die "$0: can't unlink $tmp ($!)\n" if -e $tmp; + open OUT, ">$tmp" or die "$0: can't create $tmp ($!)\n"; } print "Extracting $target (with variable substitutions)\n" @@ -787,16 +789,12 @@ sub convert_option } !NO!SUBS! -# Fix permissions and set timestamps to match the source +# Rename output and fix permissions unless ($opts{stdout}) { close OUT; - chmod 0555, $target or warn "$0: can't change mode of $target ($!)\n"; - utime +(stat DATA)[8,9], $target - or warn "$0: can't set time of $target ($!)\n"; + rename $tmp, $target or die "$0: can't rename $tmp to $target ($!)\n"; + chmod 0555, $target or warn "$0: can't change mode of $target ($!)\n"; } exit 0; - -# DATA handle used for mtime -__END__ diff --git a/help2man.h2m.PL b/help2man.h2m.PL index ed7818a..ab5ac6b 100755 --- a/help2man.h2m.PL +++ b/help2man.h2m.PL @@ -22,6 +22,7 @@ die "Usage: $0 [--quiet] [--stdout|--output=FILE] [--locale=STRING] ", my $DOMAIN = 'help2man'; my $target = $0; +my $tmp; if ($opts{stdout}) { *OUT = *STDOUT; @@ -44,8 +45,9 @@ else } } - unlink $target or die "$0: can't unlink $target ($!)\n" if -e $target; - open OUT, ">$target" or die "$0: can't create $target ($!)\n"; + $tmp = "$target.tmp$$"; + unlink $tmp or die "$0: can't unlink $tmp ($!)\n" if -e $tmp; + open OUT, ">$tmp" or die "$0: can't create $tmp ($!)\n"; } my $msg = "Extracting $target"; @@ -170,7 +172,8 @@ print OUT " ftp://ftp.gnu.org/gnu/help2man/\n"; unless ($opts{stdout}) { close OUT; - chmod 0444, $target or warn "$0: can't change mode of $target ($!)\n"; + rename $tmp, $target or die "$0: can't rename $tmp to $target ($!)\n"; + chmod 0444, $target or warn "$0: can't change mode of $target ($!)\n"; } exit 0; diff --git a/help2man.html.PL b/help2man.html.PL index 79e276c..d15bb0b 100755 --- a/help2man.html.PL +++ b/help2man.html.PL @@ -60,29 +60,32 @@ for ($body) # Write output my $target = $0; -my $out; +my $tmp; if ($opts{stdout}) { - $out = \*STDOUT; + *OUT = *STDOUT; $opts{quiet} = 1; } else { $target =~ s!.*/!!; - $target =~ s/\.PL$// or die "$0: can't determine target name\n"; - unlink $target or die "$0: can't unlink $target ($!)\n" - if -e $target; - open $out, ">$target" or die "$0: can't create $target ($!)\n"; + $target =~ s/\.PL$// or die "$0: can't determine target name\n"; + $tmp = "$target.tmp$$"; + unlink $tmp or die "$0: can't unlink $tmp ($!)\n" if -e $tmp; + open OUT, ">$tmp" or die "$0: can't create $tmp ($!)\n"; } print "Extracting $target (with GNU boilerplate)\n" unless $opts{quiet}; -print $out $header, $body, $footer; +print OUT $header, $body, $footer; # Fix output file permissions unless ($opts{stdout}) { - close $out; + close OUT; + rename $tmp, $target or die "$0: can't rename $tmp to $target ($!)\n"; chmod 0444, $target or warn "$0: can't change mode of $target ($!)\n"; } + +exit 0; |