diff options
author | BogDan Vatra <bogdan@kde.org> | 2013-12-28 17:11:28 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-02 15:46:35 +0100 |
commit | af05552ac76aaba0f2954313939b64fddab4ae5a (patch) | |
tree | b3c802fbb7a71b16459974889261a14f0c83dc73 | |
parent | 856ba53f77bc3d7b39c5e35d0249ead595dc0439 (diff) | |
download | qttools-af05552ac76aaba0f2954313939b64fddab4ae5a.tar.gz qttools-af05552ac76aaba0f2954313939b64fddab4ae5a.tar.bz2 qttools-af05552ac76aaba0f2954313939b64fddab4ae5a.zip |
Remove old qt libs if the qt installation folder is different.
Store and check the Qt instalattion folder.
Change-Id: I7a890da82d5b7a4ae467d157daa7c4e41b15a11b
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
-rw-r--r-- | src/androiddeployqt/main.cpp | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/androiddeployqt/main.cpp b/src/androiddeployqt/main.cpp index 9c407154..64ee5b90 100644 --- a/src/androiddeployqt/main.cpp +++ b/src/androiddeployqt/main.cpp @@ -1394,14 +1394,33 @@ bool fetchRemoteModifications(Options *options, const QString &directory) { options->fetchedRemoteModificationDates = true; - FILE *adbCommand = runAdb(*options, QLatin1String(" ls ") + directory); + FILE *adbCommand = runAdb(*options, QLatin1String(" shell cat ") + directory + QLatin1String("/modification.txt")); if (adbCommand == 0) return false; char buffer[512]; + QString qtPath; + while (fgets(buffer, sizeof(buffer), adbCommand) != 0) + qtPath += QString::fromUtf8(buffer, qstrlen(buffer)); + + pclose(adbCommand); + + if (options->qtInstallDirectory != qtPath) { + adbCommand = runAdb(*options, QLatin1String(" shell rm -r ") + directory); + if (options->verbose) { + fprintf(stdout, " -- Removing old Qt libs.\n"); + while (fgets(buffer, sizeof(buffer), adbCommand) != 0) + fprintf(stdout, "%s", buffer); + } + pclose(adbCommand); + } + + adbCommand = runAdb(*options, QLatin1String(" ls ") + directory); + if (adbCommand == 0) + return false; + while (fgets(buffer, sizeof(buffer), adbCommand) != 0) { QByteArray line = QByteArray::fromRawData(buffer, qstrlen(buffer)); - if (line.count() < (3 * 8 + 3)) continue; if (line.at(8) != ' ' @@ -1429,6 +1448,7 @@ bool fetchRemoteModifications(Options *options, const QString &directory) fprintf(stderr, "Cannot create modification timestamp.\n"); return false; } + file.write(options->qtInstallDirectory.toUtf8()); } return true; |