diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-23 14:22:19 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-08-25 11:56:45 +0000 |
commit | d76a756b03840ef9339ecc30f16e8580c7f323ea (patch) | |
tree | 44be6418b643e6492621199e647f94c14a3071df /tools/configure | |
parent | 12bb328bb0be8efe54aae750c21938aab4d17539 (diff) |
clean up qconfig/qmodule.pri handling in configure
instead of saving the files away and restoring them afterwards, use the
new and shiny discard_from() function to throw away everything the files
might contain.
strictly speaking, this is not precise, as the pris may also use *=, -=,
and possibly other operations which cannot be trivially undone, but the
purpose is essentially to discard the special outputs of some features
which may affect subsequent tests, for which this is sufficient.
as a side effect, the failure to load qmodule.pri is not fatal any more
(like for qconfig.pri), to save the pointless effort of ensuring that it
exists.
Change-Id: I07625b60c4f2e27b21206b2c16d24ab111737395
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'tools/configure')
-rw-r--r-- | tools/configure/configureapp.cpp | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index f9782e0920..650ede7474 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -999,21 +999,6 @@ void Configure::buildQmake() void Configure::configure() { - static const char * const files[] = { "qmodule", "qconfig" }; - - for (int i = 0; i < 2; i++) { - QFile file(buildPath + "/mkspecs/" + files[i] + ".pri"); - QString oldfn = file.fileName() + ".old"; - if (file.exists() && !QFileInfo::exists(oldfn)) - QFile::rename(file.fileName(), oldfn); - if (!file.open(QFile::WriteOnly | QFile::Text)) { - cout << "Failed to create file " << qPrintable(file.fileName()) << endl; - dictionary[ "DONE" ] = "error"; - return; - } - file.close(); - } - FileWriter ci(buildPath + "/config.tests/configure.cfg"); ci << "# Feature defaults set by configure command line\n" << "config.input.qt_edition = " << dictionary["EDITION"] << "\n" @@ -1034,19 +1019,6 @@ void Configure::configure() cout << "Qmake failed, return code " << exitCode << endl << endl; dictionary[ "DONE" ] = "error"; } - - for (int i = 0; i < 2; i++) { - QFile file(buildPath + "/mkspecs/" + files[i] + ".pri"); - QFile oldFile(file.fileName() + ".old"); - if (oldFile.open(QIODevice::ReadOnly | QIODevice::Text) - && file.open(QIODevice::ReadOnly | QIODevice::Text) - && oldFile.readAll() == file.readAll()) { - file.remove(); - oldFile.rename(file.fileName()); - } else { - oldFile.remove(); - } - } } void Configure::generateMakefiles() |