diff options
author | Oswald Buddenhagen <oswald.buddenhagen@nokia.com> | 2012-08-07 16:35:11 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-08-08 12:04:49 +0200 |
commit | 350d5ff3dd043576c1ba4192648e43bc1ce89a2e (patch) | |
tree | 22ce17cba94496e3ba3522d6af0ca35028e6542b /qmake/generators | |
parent | 14d0dc1dca50399933ec23b07eb168003878e0cc (diff) |
reshuffle assembly of uninstall commands
make a proper stringlist of commands, and join it in reverse order
only at the end. the reversal ensures that we can cleanly fold up
directory hierarchies we may build.
Change-Id: I9a241361588a6965283aec5258e1d622b35514e0
Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
Diffstat (limited to 'qmake/generators')
-rw-r--r-- | qmake/generators/makefile.cpp | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 94bf964cf4..533a11c129 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1202,7 +1202,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n dst += Option::dir_sep; } - QStringList tmp, uninst = project->values((*it) + ".uninstall"); + QStringList tmp, uninst; //other tmp = project->values((*it) + ".extra"); if(tmp.isEmpty()) @@ -1255,8 +1255,6 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) target += QString("\t-") + var("QMAKE_STRIP") + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))) + "\n"; - if(!uninst.isEmpty()) - uninst.append("\n\t"); uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false)))); continue; } @@ -1282,16 +1280,12 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n } cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file) + "\n"; target += cmd; - if(!uninst.isEmpty()) - uninst.append("\n\t"); uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false)))); } for(int x = 0; x < files.count(); x++) { QString file = files[x]; if(file == "." || file == "..") //blah continue; - if(!uninst.isEmpty()) - uninst.append("\n\t"); uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false)))); QFileInfo fi(fileInfo(dirstr + file)); if(!target.isEmpty()) @@ -1314,10 +1308,11 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n } } //default? - if(do_default) { + if (do_default) target = defaultInstall((*it)); - uninst = project->values((*it) + ".uninstall"); - } + QString puninst = project->values((*it) + ".uninstall").join(" "); + if (!puninst.isEmpty()) + uninst << puninst; if(!target.isEmpty() || project->values((*it) + ".CONFIG").indexOf("dummy_install") != -1) { if(noBuild || project->values((*it) + ".CONFIG").indexOf("no_build") != -1) @@ -1343,8 +1338,10 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n } t << target << endl << endl; if(!uninst.isEmpty()) { - t << "uninstall_" << (*it) << ": FORCE\n\t" << uninst.join(" ") - << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " " << endl << endl; + t << "uninstall_" << (*it) << ": FORCE"; + for (int i = uninst.size(); --i >= 0; ) + t << "\n\t" << uninst.at(i); + t << "\n\t-$(DEL_DIR) " << filePrefixRoot(root, dst) << " " << endl << endl; } t << endl; |