From 0d128aded5e06f98fd8957ee79d5cb588f252914 Mon Sep 17 00:00:00 2001 From: Kurt Korbatits Date: Thu, 12 Jan 2012 11:17:21 +1000 Subject: [PATCH] qmake wasn't handling spaces in names when dealing with extra installs. When installing extra binaries the paths where not being escaped, causing stripping and deleting to fail when dealing with filenames that contained one or more spaces. Change-Id: Iba4517b1110f6af30f7e2662cb86024a8b7b81f7 Reviewed-by: Kurt Korbatits Reviewed-by: Lincoln Ramsay Reviewed-by: Oswald Buddenhagen --- qmake/generators/makefile.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp index 84525bce5d4..564d44d98f4 100644 --- a/qmake/generators/makefile.cpp +++ b/qmake/generators/makefile.cpp @@ -1300,15 +1300,15 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n cmd = "-$(INSTALL_PROGRAM)"; else cmd = "-$(INSTALL_FILE)"; - cmd += " " + escapeFilePath(wild) + " " + dst_file + "\n"; + cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file) + "\n"; target += cmd; if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) target += QString("\t-") + var("QMAKE_STRIP") + " " + - filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false)) + "\n"; + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))) + "\n"; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append(rm_dir_contents + " " + filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false))); + uninst.append(rm_dir_contents + " " + escapeFilePath(filePrefixRoot(root, fileFixify(dst + filestr, FileFixifyAbsolute, false)))); continue; } QString local_dirstr = Option::fixPathToLocalOS(dirstr, true); @@ -1332,11 +1332,11 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n } else { cmd = QString(fi.isExecutable() ? "-$(INSTALL_PROGRAM)" : "-$(INSTALL_FILE)"); } - cmd += " " + wild + " " + dst_file + "\n"; + cmd += " " + escapeFilePath(wild) + " " + escapeFilePath(dst_file) + "\n"; target += cmd; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append(rm_dir_contents + " " + 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++) { QString file = files[x]; @@ -1344,7 +1344,7 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n continue; if(!uninst.isEmpty()) uninst.append("\n\t"); - uninst.append(rm_dir_contents + " " + 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)); if(!target.isEmpty()) target += "\t"; @@ -1355,12 +1355,12 @@ MakefileGenerator::writeInstalls(QTextStream &t, const QString &installs, bool n dst_file += fi.fileName(); } QString cmd = QString(fi.isDir() ? "-$(INSTALL_DIR)" : "-$(INSTALL_FILE)") + " " + - dirstr + file + " " + dst_file + "\n"; + escapeFilePath(dirstr + file) + " " + escapeFilePath(dst_file) + "\n"; target += cmd; if(!project->isActiveConfig("debug") && !project->isActiveConfig("nostrip") && !fi.isDir() && fi.isExecutable() && !project->isEmpty("QMAKE_STRIP")) target += QString("\t-") + var("QMAKE_STRIP") + " " + - filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false)) + + escapeFilePath(filePrefixRoot(root, fileFixify(dst + file, FileFixifyAbsolute, false))) + "\n"; } }