summaryrefslogtreecommitdiff
path: root/usr.bin/libtool/LT
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2012-07-13 13:45:35 +0000
committerMarc Espie <espie@cvs.openbsd.org>2012-07-13 13:45:35 +0000
commitdad172623eda40f20152b5ffd0f82c7fbec0fe2c (patch)
treeca7547af08f3b6f9bf60694bf996bbfba0f23dd8 /usr.bin/libtool/LT
parenta334aea3f6a6bfe3cb380b5b7ea6efcbebef70a3 (diff)
tidbit
Diffstat (limited to 'usr.bin/libtool/LT')
-rw-r--r--usr.bin/libtool/LT/LaFile.pm18
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;
}