From: Oswald Buddenhagen Date: Tue, 7 Aug 2012 14:35:11 +0000 (+0200) Subject: reshuffle assembly of uninstall commands X-Git-Tag: v5.0.0-beta1~368 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=350d5ff3dd043576c1ba4192648e43bc1ce89a2e;p=profile%2Fivi%2Fqtbase.git 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 --- diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 94bf964..533a11c 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;