diff options
author | 2012-07-13 13:45:34 +0000 | |
---|---|---|
committer | 2012-07-13 13:45:34 +0000 | |
commit | 76505ababb6c40ec032ab8a45d3b07ca6f580bb3 (patch) | |
tree | 69e1e7a60da0b17b2b779c49e8a3271805de0956 | |
parent | minor cleanup (diff) | |
download | wireguard-openbsd-76505ababb6c40ec032ab8a45d3b07ca6f580bb3.tar.xz wireguard-openbsd-76505ababb6c40ec032ab8a45d3b07ca6f580bb3.zip |
tidbit
-rw-r--r-- | usr.bin/libtool/LT/LaFile.pm | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/usr.bin/libtool/LT/LaFile.pm b/usr.bin/libtool/LT/LaFile.pm index 94bbb72e3c1..df3051a2c4d 100644 --- a/usr.bin/libtool/LT/LaFile.pm +++ b/usr.bin/libtool/LT/LaFile.pm @@ -1,4 +1,4 @@ -# $OpenBSD: LaFile.pm,v 1.18 2012/07/13 13:25:12 espie Exp $ +# $OpenBSD: LaFile.pm,v 1.19 2012/07/13 13:45:34 espie Exp $ # Copyright (c) 2007-2010 Steven Mestdagh <steven@openbsd.org> # Copyright (c) 2012 Marc Espie <espie@openbsd.org> @@ -106,21 +106,19 @@ EOF sub write_shared_libs_log { my ($self, $origv) = @_; - my $libname = $self->stringize('libname'); - my $v = $self->stringize('current') .'.'. $self->stringize('revision'); if (!defined $ENV{SHARED_LIBS_LOG}) { return; } my $logfile = $ENV{SHARED_LIBS_LOG}; - my $fh; - if (! -f $logfile) { - open ($fh, '>', $logfile); - print $fh "# SHARED_LIBS+= <libname> <obsd version> # <orig version>\n"; - close $fh; - } - open ($fh, '>>', $logfile); + my $wantheader = ! -f $logfile; + open (my $fh, '>>', $logfile) or return; + my $v = join('.', $self->stringize('current'), + $self->stringize('revision')); + # Remove first leading 'lib', we don't want that in SHARED_LIBS_LOG. + my $libname = $self->stringize('libname'); $libname =~ s/^lib//; + print $fh "# SHARED_LIBS+= <libname> <obsd version> # <orig version>\n" if $wantheader; printf $fh "SHARED_LIBS +=\t%-20s %-8s # %s\n", $libname, $v, $origv; } |