reshuffle assembly of install commands as well
don't make a single string, but a string list which is join()ed in the end. this is a tad slower, but the code is way easier to work with. Change-Id: I1ff7168c2770998761a6081be8080c743ddc94a1 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
This commit is contained in:
parent
350d5ff3dd
commit
ff192b3c62
@ -1194,7 +1194,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
|
|
||||||
bool do_default = true;
|
bool do_default = true;
|
||||||
const QString root = "$(INSTALL_ROOT)";
|
const QString root = "$(INSTALL_ROOT)";
|
||||||
QString target, dst;
|
QString dst;
|
||||||
if(project->values((*it) + ".CONFIG").indexOf("no_path") == -1 &&
|
if(project->values((*it) + ".CONFIG").indexOf("no_path") == -1 &&
|
||||||
project->values((*it) + ".CONFIG").indexOf("dummy_install") == -1) {
|
project->values((*it) + ".CONFIG").indexOf("dummy_install") == -1) {
|
||||||
dst = fileFixify(unescapeFilePath(project->values(pvar).first()), FileFixifyAbsolute, false);
|
dst = fileFixify(unescapeFilePath(project->values(pvar).first()), FileFixifyAbsolute, false);
|
||||||
@ -1202,23 +1202,19 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
dst += Option::dir_sep;
|
dst += Option::dir_sep;
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList tmp, uninst;
|
QStringList tmp, inst, uninst;
|
||||||
//other
|
//other
|
||||||
tmp = project->values((*it) + ".extra");
|
tmp = project->values((*it) + ".extra");
|
||||||
if(tmp.isEmpty())
|
if(tmp.isEmpty())
|
||||||
tmp = project->values((*it) + ".commands"); //to allow compatible name
|
tmp = project->values((*it) + ".commands"); //to allow compatible name
|
||||||
if(!tmp.isEmpty()) {
|
if(!tmp.isEmpty()) {
|
||||||
do_default = false;
|
do_default = false;
|
||||||
if(!target.isEmpty())
|
inst << tmp.join(" ");
|
||||||
target += "\n\t";
|
|
||||||
target += tmp.join(" ");
|
|
||||||
}
|
}
|
||||||
//masks
|
//masks
|
||||||
tmp = findFilesInVPATH(project->values((*it) + ".files"), VPATH_NoFixify);
|
tmp = findFilesInVPATH(project->values((*it) + ".files"), VPATH_NoFixify);
|
||||||
tmp = fileFixify(tmp, FileFixifyAbsolute);
|
tmp = fileFixify(tmp, FileFixifyAbsolute);
|
||||||
if(!tmp.isEmpty()) {
|
if(!tmp.isEmpty()) {
|
||||||
if(!target.isEmpty())
|
|
||||||
target += "\n";
|
|
||||||
do_default = false;
|
do_default = false;
|
||||||
for(QStringList::Iterator wild_it = tmp.begin(); wild_it != tmp.end(); ++wild_it) {
|
for(QStringList::Iterator wild_it = tmp.begin(); wild_it != tmp.end(); ++wild_it) {
|
||||||
QString wild = Option::fixPathToTargetOS((*wild_it), false, false);
|
QString wild = Option::fixPathToTargetOS((*wild_it), false, false);
|
||||||
@ -1234,8 +1230,6 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
if(is_target || exists(wild)) { //real file or target
|
if(is_target || exists(wild)) { //real file or target
|
||||||
QString file = wild;
|
QString file = wild;
|
||||||
QFileInfo fi(fileInfo(wild));
|
QFileInfo fi(fileInfo(wild));
|
||||||
if(!target.isEmpty())
|
|
||||||
target += "\t";
|
|
||||||
QString dst_file = filePrefixRoot(root, dst);
|
QString dst_file = filePrefixRoot(root, dst);
|
||||||
if(fi.isDir() && project->isActiveConfig("copy_dir_files")) {
|
if(fi.isDir() && project->isActiveConfig("copy_dir_files")) {
|
||||||
if(!dst_file.endsWith(Option::dir_sep))
|
if(!dst_file.endsWith(Option::dir_sep))
|
||||||
@ -1249,12 +1243,12 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
cmd = "-$(INSTALL_PROGRAM)";
|
cmd = "-$(INSTALL_PROGRAM)";
|
||||||
else
|
else
|
||||||
cmd = "-$(INSTALL_FILE)";
|
cmd = "-$(INSTALL_FILE)";
|
||||||
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file) + "\n";
|
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
|
||||||
target += cmd;
|
inst << cmd;
|
||||||
if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") &&
|
if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") &&
|
||||||
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
|
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
|
||||||
target += QString("\t-") + var("QMAKE_STRIP") + " " +
|
inst << QString("-") + var("QMAKE_STRIP") + " " +
|
||||||
escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))) + "\n";
|
escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false)));
|
||||||
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))));
|
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -1262,8 +1256,6 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
QStringList files = QDir(local_dirstr).entryList(QStringList(filestr));
|
QStringList files = QDir(local_dirstr).entryList(QStringList(filestr));
|
||||||
const QStringList &installConfigValues = project->values((*it) + ".CONFIG");
|
const QStringList &installConfigValues = project->values((*it) + ".CONFIG");
|
||||||
if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
|
if (installConfigValues.contains("no_check_exist") && files.isEmpty()) {
|
||||||
if(!target.isEmpty())
|
|
||||||
target += "\t";
|
|
||||||
QString dst_file = filePrefixRoot(root, dst);
|
QString dst_file = filePrefixRoot(root, dst);
|
||||||
QString cmd;
|
QString cmd;
|
||||||
if (installConfigValues.contains("directory")) {
|
if (installConfigValues.contains("directory")) {
|
||||||
@ -1278,8 +1270,8 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
} else {
|
} else {
|
||||||
cmd = QLatin1String("-$(INSTALL_FILE)");
|
cmd = QLatin1String("-$(INSTALL_FILE)");
|
||||||
}
|
}
|
||||||
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file) + "\n";
|
cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file);
|
||||||
target += cmd;
|
inst << cmd;
|
||||||
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))));
|
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))));
|
||||||
}
|
}
|
||||||
for(int x = 0; x < files.count(); x++) {
|
for(int x = 0; x < files.count(); x++) {
|
||||||
@ -1288,8 +1280,6 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
continue;
|
continue;
|
||||||
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false))));
|
uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false))));
|
||||||
QFileInfo fi(fileInfo(dirstr + file));
|
QFileInfo fi(fileInfo(dirstr + file));
|
||||||
if(!target.isEmpty())
|
|
||||||
target += "\t";
|
|
||||||
QString dst_file = filePrefixRoot(root, fileFixify(dst, FileFixifyAbsolute, false));
|
QString dst_file = filePrefixRoot(root, fileFixify(dst, FileFixifyAbsolute, false));
|
||||||
if(fi.isDir() && project->isActiveConfig("copy_dir_files")) {
|
if(fi.isDir() && project->isActiveConfig("copy_dir_files")) {
|
||||||
if(!dst_file.endsWith(Option::dir_sep))
|
if(!dst_file.endsWith(Option::dir_sep))
|
||||||
@ -1297,19 +1287,21 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n
|
|||||||
dst_file += fi.fileName();
|
dst_file += fi.fileName();
|
||||||
}
|
}
|
||||||
QString cmd = QString(fi.isDir() ? "-$(INSTALL_DIR)" : "-$(INSTALL_FILE)") + " " +
|
QString cmd = QString(fi.isDir() ? "-$(INSTALL_DIR)" : "-$(INSTALL_FILE)") + " " +
|
||||||
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file) + "\n";
|
escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file);
|
||||||
target += cmd;
|
inst << cmd;
|
||||||
if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") &&
|
if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") &&
|
||||||
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
|
!fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP"))
|
||||||
target += QString("\t-") + var("QMAKE_STRIP") + " " +
|
inst << QString("-") + var("QMAKE_STRIP") + " " +
|
||||||
escapeFilePath(filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false))) +
|
escapeFilePath(filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false)));
|
||||||
"\n";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
QString target;
|
||||||
//default?
|
//default?
|
||||||
if (do_default)
|
if (do_default)
|
||||||
target = defaultInstall((*it));
|
target = defaultInstall((*it));
|
||||||
|
else
|
||||||
|
target = inst.join("\n\t");
|
||||||
QString puninst = project->values((*it) + ".uninstall").join(" ");
|
QString puninst = project->values((*it) + ".uninstall").join(" ");
|
||||||
if (!puninst.isEmpty())
|
if (!puninst.isEmpty())
|
||||||
uninst << puninst;
|
uninst << puninst;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user