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
This commit is contained in:
parent
14c5bed304
commit
7d7a9ce192
|
@ -152,6 +152,8 @@ sub print_svn_version
|
||||||
my $svn_version;
|
my $svn_version;
|
||||||
my $needs_update = 1;
|
my $needs_update = 1;
|
||||||
|
|
||||||
|
if ($pkg_version) { return; }
|
||||||
|
|
||||||
if ($last && $revision) {
|
if ($last && $revision) {
|
||||||
$svn_version = "#define SVNVERSION \"" .
|
$svn_version = "#define SVNVERSION \"" .
|
||||||
$version_string . "\"\n";
|
$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 (<FILE>) {
|
while (<FILE>) {
|
||||||
chomp;
|
chomp;
|
||||||
|
@ -209,17 +215,18 @@ if (-d "./.svn") {
|
||||||
print "This is a build from SVN (or a SVN snapshot).\n";
|
print "This is a build from SVN (or a SVN snapshot).\n";
|
||||||
&read_svn_info(".");
|
&read_svn_info(".");
|
||||||
if ($pkg_version) {
|
if ($pkg_version) {
|
||||||
print "Generating package version. Ignoring $vconf_file.\n";
|
print "Generating package version. Ignoring $version_file\n";
|
||||||
&update_configure_in;
|
&update_configure_in;
|
||||||
&update_config_nmake;
|
&update_config_nmake;
|
||||||
} elsif ($version_pref{"enable"} == 0) {
|
} elsif ($version_pref{"enable"} == 0) {
|
||||||
print "Version tag disabled in $vconf_file.\n";
|
print "Version tag disabled in $vconf_file.\n";
|
||||||
} else {
|
} else {
|
||||||
print "SVN version tag will be computed.\n";
|
print "SVN version tag will be computed.\n";
|
||||||
&print_svn_version;
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
print "This is not a SVN build.\n";
|
print "This is not a SVN build.\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&print_svn_version;
|
||||||
|
|
||||||
__END__
|
__END__
|
||||||
|
|
Loading…
Reference in New Issue