forked from osmocom/wireshark
make-version: Clean up handling of VCSVERSION
Change-Id: If8228267da4a9290f5abf99c5ac518c3dec0a283 Reviewed-on: https://code.wireshark.org/review/18443 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
This commit is contained in:
parent
bdf99169cc
commit
33f8c27769
|
@ -587,30 +587,21 @@ sub update_versioned_files
|
|||
|
||||
sub new_version_h
|
||||
{
|
||||
my $VCS_REVISION;
|
||||
my $set_header = shift @_;
|
||||
|
||||
if (!$set_header) {
|
||||
$VCS_REVISION = "/* #undef VCSVERSION */\n";
|
||||
$VCS_REVISION .= "/* #undef VCSBRANCH */\n";
|
||||
return $VCS_REVISION;
|
||||
return "/* #undef VCSVERSION */\n";
|
||||
}
|
||||
|
||||
if ($git_description) {
|
||||
$VCS_REVISION = "#define VCSVERSION \"" .
|
||||
$git_description . "\"\n" .
|
||||
"#define VCSBRANCH \"" . $repo_branch . "\"\n";
|
||||
} elsif ($last_change && $num_commits) {
|
||||
$VCS_REVISION = "#define VCSVERSION \"" . $vcs_name . " Rev " .
|
||||
$num_commits . "\"\n" .
|
||||
"#define VCSBRANCH \"" . $repo_branch . "\"\n";
|
||||
} else {
|
||||
$VCS_REVISION = "#define VCSVERSION \"" . $vcs_name .
|
||||
" Rev Unknown\"\n" .
|
||||
"#define VCSBRANCH \"unknown\"\n";
|
||||
return "#define VCSVERSION \"$git_description from $repo_branch\"\n";
|
||||
}
|
||||
|
||||
return $VCS_REVISION;
|
||||
if ($last_change && $num_commits) {
|
||||
return "#define VCSVERSION \"$vcs_name Rev $num_commits from $repo_branch\"\n";
|
||||
}
|
||||
|
||||
return "#define VCSVERSION \"$vcs_name Rev Unknown from unknown\"\n";
|
||||
}
|
||||
|
||||
# Print the version control system's version to $version_file.
|
||||
|
@ -630,7 +621,7 @@ sub print_VCS_REVISION
|
|||
|
||||
$VCS_REVISION = new_version_h($set_header);
|
||||
if (open(OLDREV, "<$version_file")) {
|
||||
my $old_VCS_REVISION = <OLDREV> . <OLDREV>;
|
||||
my $old_VCS_REVISION = <OLDREV>;
|
||||
if ($old_VCS_REVISION eq $VCS_REVISION) {
|
||||
$needs_update = 0;
|
||||
}
|
||||
|
|
|
@ -377,7 +377,7 @@ const char *
|
|||
get_ws_vcs_version_info(void)
|
||||
{
|
||||
#ifdef VCSVERSION
|
||||
return VERSION " (" VCSVERSION " from " VCSBRANCH ")";
|
||||
return VERSION " (" VCSVERSION ")";
|
||||
#else
|
||||
return VERSION;
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue