summaryrefslogtreecommitdiffstats
path: root/bin/syncqt
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@nokia.com>2011-10-11 12:46:33 +0200
committerQt by Nokia <qt-info@nokia.com>2011-10-11 13:25:40 +0200
commite6e39a2e584f88c381c54fba7d3347c399d85f2f (patch)
tree74362ebbe757656dc139ada8f70b65436e08e699 /bin/syncqt
parent0cb7a669898f809fb006ac1348d4a29581848b16 (diff)
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>
Diffstat (limited to 'bin/syncqt')
-rwxr-xr-xbin/syncqt14
1 files changed, 7 insertions, 7 deletions
diff --git a/bin/syncqt b/bin/syncqt
index 57f0e715e0..4c13eeec69 100755
--- a/bin/syncqt
+++ b/bin/syncqt
@@ -839,9 +839,9 @@ foreach my $lib (@modules_to_sync) {
#iteration info
my $dir = $modules{$lib};
my $module_version = "";
- my $module_major_version = "";
- my $module_minor_version = "";
- my $module_patch_version = "";
+ my $module_major_version = 0;
+ my $module_minor_version = 0;
+ my $module_patch_version = 0;
if (-e "$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+$//;
my @versions = split(/\./, $module_version);
- $module_major_version = $versions[0];
+ $module_major_version = int($versions[0]);
chomp $module_major_version;
- $module_minor_version = $versions[1];
+ $module_minor_version = int($versions[1]);
chomp $module_minor_version;
- $module_patch_version = $versions[2];
+ $module_patch_version = int($versions[2]);
chomp $module_patch_version;
}
}
@@ -940,7 +940,7 @@ foreach my $lib (@modules_to_sync) {
my $modulepriname = basename($modulepri);
# FIXME: this creates a file in the source location for shadow-builds
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";
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";