From 7d7a9ce1921226a6ece210581327ad45e403c16a Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Thu, 16 Dec 2004 19:06:52 +0000 Subject: From Thomas Boehne: Fix the version.conf status message and improve code readability. Fix a bug in my previous checkin, so that svnversion.h will be created even when the ".svn/" directory isn't present. svn path=/trunk/; revision=12762 --- make-version.pl | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'make-version.pl') diff --git a/make-version.pl b/make-version.pl index b4c6e23af4..15b74d3600 100755 --- a/make-version.pl +++ b/make-version.pl @@ -152,6 +152,8 @@ sub print_svn_version my $svn_version; my $needs_update = 1; + if ($pkg_version) { return; } + if ($last && $revision) { $svn_version = "#define SVNVERSION \"" . $version_string . "\"\n"; @@ -187,7 +189,11 @@ sub get_config { } - open(FILE, "<$vconf_file") || print STDERR "Version configuration file $vconf_file not found. Using defaults.\n" && return 1; + if (! open(FILE, "<$vconf_file")) { + print STDERR "Version configuration file $vconf_file not " + . "found. Using defaults.\n"; + return 1; + } while () { chomp; @@ -209,17 +215,18 @@ if (-d "./.svn") { print "This is a build from SVN (or a SVN snapshot).\n"; &read_svn_info("."); if ($pkg_version) { - print "Generating package version. Ignoring $vconf_file.\n"; + print "Generating package version. Ignoring $version_file\n"; &update_configure_in; &update_config_nmake; } elsif ($version_pref{"enable"} == 0) { print "Version tag disabled in $vconf_file.\n"; } else { print "SVN version tag will be computed.\n"; - &print_svn_version; } } else { print "This is not a SVN build.\n"; } +&print_svn_version; + __END__ -- cgit v1.2.3