Prevent 'Argument "" isn't numeric' warning when module version is missing
Change-Id: I2ecef7060c1e436e499221cac03266744a9ee309 Reviewed-on: http://codereview.qt-project.org/6432 Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
This commit is contained in:
parent
0cb7a66989
commit
e6e39a2e58
14
bin/syncqt
14
bin/syncqt
@ -839,9 +839,9 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
#iteration info
|
#iteration info
|
||||||
my $dir = $modules{$lib};
|
my $dir = $modules{$lib};
|
||||||
my $module_version = "";
|
my $module_version = "";
|
||||||
my $module_major_version = "";
|
my $module_major_version = 0;
|
||||||
my $module_minor_version = "";
|
my $module_minor_version = 0;
|
||||||
my $module_patch_version = "";
|
my $module_patch_version = 0;
|
||||||
|
|
||||||
if (-e "$modulepris{$lib}") {
|
if (-e "$modulepris{$lib}") {
|
||||||
my $content = fileContents($modulepris{$lib});
|
my $content = fileContents($modulepris{$lib});
|
||||||
@ -853,11 +853,11 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
$module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/;
|
$module_version =~ s/^\s*QT\..*\.VERSION\s*=\s*([^#]+).*$/$1/;
|
||||||
$module_version =~ s/\s+$//;
|
$module_version =~ s/\s+$//;
|
||||||
my @versions = split(/\./, $module_version);
|
my @versions = split(/\./, $module_version);
|
||||||
$module_major_version = $versions[0];
|
$module_major_version = int($versions[0]);
|
||||||
chomp $module_major_version;
|
chomp $module_major_version;
|
||||||
$module_minor_version = $versions[1];
|
$module_minor_version = int($versions[1]);
|
||||||
chomp $module_minor_version;
|
chomp $module_minor_version;
|
||||||
$module_patch_version = $versions[2];
|
$module_patch_version = int($versions[2]);
|
||||||
chomp $module_patch_version;
|
chomp $module_patch_version;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -940,7 +940,7 @@ foreach my $lib (@modules_to_sync) {
|
|||||||
my $modulepriname = basename($modulepri);
|
my $modulepriname = basename($modulepri);
|
||||||
# FIXME: this creates a file in the source location for shadow-builds
|
# FIXME: this creates a file in the source location for shadow-builds
|
||||||
my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h";
|
my $moduleversionheader = "$modules{$lib}/" . lc($lib) . "version.h";
|
||||||
my $modulehexstring = sprintf("0x%02X%02X%02X", int($module_major_version), int($module_minor_version), int($module_patch_version));
|
my $modulehexstring = sprintf("0x%02X%02X%02X", $module_major_version, $module_minor_version, $module_patch_version);
|
||||||
open MODULE_VERSION_HEADER_FILE, ">$moduleversionheader" or die "Can't open $moduleversionheader for writing";
|
open MODULE_VERSION_HEADER_FILE, ">$moduleversionheader" or die "Can't open $moduleversionheader for writing";
|
||||||
print MODULE_VERSION_HEADER_FILE "/* This file was generated by syncqt with the info from sync.profile. */\n";
|
print MODULE_VERSION_HEADER_FILE "/* This file was generated by syncqt with the info from sync.profile. */\n";
|
||||||
print MODULE_VERSION_HEADER_FILE "#ifndef QT_". uc($lib) . "_VERSION_H\n";
|
print MODULE_VERSION_HEADER_FILE "#ifndef QT_". uc($lib) . "_VERSION_H\n";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user