make fileFixify() calling convention somewhat sane
instead of allowing arbitrary input and output base paths, restrict them to the project input and output dirs (in any permutation), which are the only cases ever used anyway. this permits much clearer call sites, and allows later optimizations. Change-Id: I48d149a4417af5c858e66ec57c476a5bc6b17f17 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
This commit is contained in:
parent
6234dec41f
commit
4c96367410
@ -105,7 +105,7 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
{
|
{
|
||||||
if(project->isActiveConfig("generate_pbxbuild_makefile")) {
|
if(project->isActiveConfig("generate_pbxbuild_makefile")) {
|
||||||
QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"),
|
QString mkwrap = fileFixify(pbx_dir + Option::dir_sep + ".." + Option::dir_sep + project->first("MAKEFILE"),
|
||||||
qmake_getpwd());
|
FileFixifyToIndir);
|
||||||
QFile mkwrapf(mkwrap);
|
QFile mkwrapf(mkwrap);
|
||||||
if(mkwrapf.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if(mkwrapf.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
debug_msg(1, "pbuilder: Creating file: %s", mkwrap.toLatin1().constData());
|
debug_msg(1, "pbuilder: Creating file: %s", mkwrap.toLatin1().constData());
|
||||||
@ -184,13 +184,13 @@ ProjectBuilderMakefileGenerator::writeSubDirs(QTextStream &t)
|
|||||||
bool in_root = true;
|
bool in_root = true;
|
||||||
QString name = qmake_getpwd();
|
QString name = qmake_getpwd();
|
||||||
if(project->isActiveConfig("flat")) {
|
if(project->isActiveConfig("flat")) {
|
||||||
QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
|
QString flat_file = fileFixify(name, FileFixifyBackwards | FileFixifyRelative);
|
||||||
if(flat_file.indexOf(Option::dir_sep) != -1) {
|
if(flat_file.indexOf(Option::dir_sep) != -1) {
|
||||||
QStringList dirs = flat_file.split(Option::dir_sep);
|
QStringList dirs = flat_file.split(Option::dir_sep);
|
||||||
name = dirs.back();
|
name = dirs.back();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QString flat_file = fileFixify(name, oldpwd, oldoutpwd, FileFixifyRelative);
|
QString flat_file = fileFixify(name, FileFixifyBackwards | FileFixifyRelative);
|
||||||
if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) {
|
if(QDir::isRelativePath(flat_file) && flat_file.indexOf(Option::dir_sep) != -1) {
|
||||||
QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP");
|
QString last_grp("QMAKE_SUBDIR_PBX_HEIR_GROUP");
|
||||||
QStringList dirs = flat_file.split(Option::dir_sep);
|
QStringList dirs = flat_file.split(Option::dir_sep);
|
||||||
@ -560,7 +560,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
// Since we can't fileFixify inside ProjectBuilderSources::files(), we resolve the absolute paths here
|
// Since we can't fileFixify inside ProjectBuilderSources::files(), we resolve the absolute paths here
|
||||||
project->values("QMAKE_INTERNAL_INCLUDED_FILES") = ProStringList(
|
project->values("QMAKE_INTERNAL_INCLUDED_FILES") = ProStringList(
|
||||||
fileFixify(project->values("QMAKE_INTERNAL_INCLUDED_FILES").toQStringList(),
|
fileFixify(project->values("QMAKE_INTERNAL_INCLUDED_FILES").toQStringList(),
|
||||||
QString(), Option::output_dir, FileFixifyAbsolute));
|
FileFixifyFromOutdir | FileFixifyAbsolute));
|
||||||
|
|
||||||
//DUMP SOURCES
|
//DUMP SOURCES
|
||||||
QMap<QString, ProStringList> groups;
|
QMap<QString, ProStringList> groups;
|
||||||
@ -618,7 +618,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
ProStringList &root_group_list = project->values("QMAKE_PBX_GROUPS");
|
ProStringList &root_group_list = project->values("QMAKE_PBX_GROUPS");
|
||||||
|
|
||||||
const QStringList &files = fileFixify(sources.at(source).files(project),
|
const QStringList &files = fileFixify(sources.at(source).files(project),
|
||||||
QString(), Option::output_dir, FileFixifyAbsolute);
|
FileFixifyFromOutdir | FileFixifyAbsolute);
|
||||||
for(int f = 0; f < files.count(); ++f) {
|
for(int f = 0; f < files.count(); ++f) {
|
||||||
QString file = files[f];
|
QString file = files[f];
|
||||||
if(!sources.at(source).compilerName().isNull() &&
|
if(!sources.at(source).compilerName().isNull() &&
|
||||||
@ -634,7 +634,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
|
|
||||||
if (!project->isActiveConfig("flat")) {
|
if (!project->isActiveConfig("flat")) {
|
||||||
// Build group hierarchy for file references that match the source our build dir
|
// Build group hierarchy for file references that match the source our build dir
|
||||||
QString relativePath = fileFixify(file, qmake_getpwd(), QString(), FileFixifyRelative);
|
QString relativePath = fileFixify(file, FileFixifyToIndir | FileFixifyRelative);
|
||||||
if (QDir::isRelativePath(relativePath) && relativePath.startsWith(QLatin1String("../")))
|
if (QDir::isRelativePath(relativePath) && relativePath.startsWith(QLatin1String("../")))
|
||||||
relativePath = fileFixify(file, FileFixifyRelative); // Try build dir
|
relativePath = fileFixify(file, FileFixifyRelative); // Try build dir
|
||||||
|
|
||||||
@ -764,7 +764,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if(added && !(added % 3))
|
if(added && !(added % 3))
|
||||||
mkt << "\\\n\t";
|
mkt << "\\\n\t";
|
||||||
++added;
|
++added;
|
||||||
const QString file_name = fileFixify(fn, Option::output_dir, Option::output_dir);
|
const QString file_name = fileFixify(fn, FileFixifyFromOutdir);
|
||||||
mkt << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
|
mkt << ' ' << escapeDependencyPath(Option::fixPathToTargetOS(
|
||||||
replaceExtraCompilerVariables(tmp_out.first().toQString(), file_name, QString(), NoShell)));
|
replaceExtraCompilerVariables(tmp_out.first().toQString(), file_name, QString(), NoShell)));
|
||||||
}
|
}
|
||||||
@ -921,7 +921,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if(!path.isEmpty() && !libdirs.contains(path))
|
if(!path.isEmpty() && !libdirs.contains(path))
|
||||||
libdirs += path;
|
libdirs += path;
|
||||||
}
|
}
|
||||||
library = fileFixify(library, Option::output_dir, Option::output_dir);
|
library = fileFixify(library, FileFixifyFromOutdir);
|
||||||
QString key = keyFor(library);
|
QString key = keyFor(library);
|
||||||
if (!project->values("QMAKE_PBX_LIBRARIES").contains(key)) {
|
if (!project->values("QMAKE_PBX_LIBRARIES").contains(key)) {
|
||||||
bool is_frmwrk = (library.endsWith(".framework"));
|
bool is_frmwrk = (library.endsWith(".framework"));
|
||||||
@ -1076,7 +1076,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if (!project->isEmpty("DESTDIR")) {
|
if (!project->isEmpty("DESTDIR")) {
|
||||||
QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE");
|
QString phase_key = keyFor("QMAKE_PBX_TARGET_COPY_PHASE");
|
||||||
QString destDir = fileFixify(project->first("DESTDIR").toQString(),
|
QString destDir = fileFixify(project->first("DESTDIR").toQString(),
|
||||||
QString(), Option::output_dir, FileFixifyAbsolute);
|
FileFixifyFromOutdir | FileFixifyAbsolute);
|
||||||
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
|
project->values("QMAKE_PBX_BUILDPHASES").append(phase_key);
|
||||||
t << "\t\t" << phase_key << " = {\n"
|
t << "\t\t" << phase_key << " = {\n"
|
||||||
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
|
<< "\t\t\t" << writeSettings("isa", "PBXShellScriptBuildPhase", SettingsNoQuote) << ";\n"
|
||||||
@ -1470,7 +1470,7 @@ ProjectBuilderMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
if ((project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) ||
|
if ((project->first("TEMPLATE") == "app" && project->isActiveConfig("app_bundle")) ||
|
||||||
(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
|
(project->first("TEMPLATE") == "lib" && !project->isActiveConfig("staticlib") &&
|
||||||
project->isActiveConfig("lib_bundle"))) {
|
project->isActiveConfig("lib_bundle"))) {
|
||||||
QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), qmake_getpwd());
|
QString plist = fileFixify(project->first("QMAKE_INFO_PLIST").toQString(), FileFixifyToIndir);
|
||||||
if (!plist.isEmpty()) {
|
if (!plist.isEmpty()) {
|
||||||
if (exists(plist))
|
if (exists(plist))
|
||||||
t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", fileFixify(plist)) << ";\n";
|
t << "\t\t\t\t" << writeSettings("INFOPLIST_FILE", fileFixify(plist)) << ";\n";
|
||||||
|
@ -162,8 +162,6 @@ MakefileGenerator::initOutPaths()
|
|||||||
v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
|
v["QMAKE_ABSOLUTE_SOURCE_PATH"].clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString currentDir = qmake_getpwd(); //just to go back to
|
|
||||||
|
|
||||||
//some builtin directories
|
//some builtin directories
|
||||||
if(project->isEmpty("PRECOMPILED_DIR") && !project->isEmpty("OBJECTS_DIR"))
|
if(project->isEmpty("PRECOMPILED_DIR") && !project->isEmpty("OBJECTS_DIR"))
|
||||||
v["PRECOMPILED_DIR"] = v["OBJECTS_DIR"];
|
v["PRECOMPILED_DIR"] = v["OBJECTS_DIR"];
|
||||||
@ -177,7 +175,7 @@ MakefileGenerator::initOutPaths()
|
|||||||
const ProString orig_path = v[dkey].first();
|
const ProString orig_path = v[dkey].first();
|
||||||
|
|
||||||
ProString &pathRef = v[dkey].first();
|
ProString &pathRef = v[dkey].first();
|
||||||
pathRef = fileFixify(pathRef.toQString(), Option::output_dir, Option::output_dir);
|
pathRef = fileFixify(pathRef.toQString(), FileFixifyFromOutdir);
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// We don't want to add a separator for DLLDESTDIR on Windows (###why?)
|
// We don't want to add a separator for DLLDESTDIR on Windows (###why?)
|
||||||
@ -192,7 +190,7 @@ MakefileGenerator::initOutPaths()
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
QString path = project->first(dkey).toQString(); //not to be changed any further
|
QString path = project->first(dkey).toQString(); //not to be changed any further
|
||||||
path = fileFixify(path, currentDir, Option::output_dir);
|
path = fileFixify(path, FileFixifyBackwards);
|
||||||
debug_msg(3, "Fixed output_dir %s (%s) into %s", dirs[x],
|
debug_msg(3, "Fixed output_dir %s (%s) into %s", dirs[x],
|
||||||
orig_path.toLatin1().constData(), path.toLatin1().constData());
|
orig_path.toLatin1().constData(), path.toLatin1().constData());
|
||||||
if(!mkdir(path))
|
if(!mkdir(path))
|
||||||
@ -210,7 +208,7 @@ MakefileGenerator::initOutPaths()
|
|||||||
for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
|
for (ProStringList::ConstIterator it2 = tmp.begin(); it2 != tmp.end(); ++it2) {
|
||||||
ProStringList &inputs = project->values((*it2).toKey());
|
ProStringList &inputs = project->values((*it2).toKey());
|
||||||
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
|
for (ProStringList::Iterator input = inputs.begin(); input != inputs.end(); ++input) {
|
||||||
QString finp = fileFixify((*input).toQString(), Option::output_dir, Option::output_dir);
|
QString finp = fileFixify((*input).toQString(), FileFixifyFromOutdir);
|
||||||
*input = ProString(finp);
|
*input = ProString(finp);
|
||||||
QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell);
|
QString path = replaceExtraCompilerVariables(tmp_out, finp, QString(), NoShell);
|
||||||
path = Option::normalizePath(path);
|
path = Option::normalizePath(path);
|
||||||
@ -220,7 +218,7 @@ MakefileGenerator::initOutPaths()
|
|||||||
// Make out path only if it does not contain makefile variables
|
// Make out path only if it does not contain makefile variables
|
||||||
if(!path.contains("${"))
|
if(!path.contains("${"))
|
||||||
if(path != "." &&
|
if(path != "." &&
|
||||||
!mkdir(fileFixify(path, qmake_getpwd(), Option::output_dir)))
|
!mkdir(fileFixify(path, FileFixifyBackwards)))
|
||||||
warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
|
warn_msg(WarnLogic, "%s: Cannot access directory '%s'",
|
||||||
(*it).toLatin1().constData(), path.toLatin1().constData());
|
(*it).toLatin1().constData(), path.toLatin1().constData());
|
||||||
}
|
}
|
||||||
@ -276,7 +274,7 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(!(flags & VPATH_NoFixify))
|
if(!(flags & VPATH_NoFixify))
|
||||||
file = fileFixify(file, qmake_getpwd(), Option::output_dir);
|
file = fileFixify(file, FileFixifyBackwards);
|
||||||
|
|
||||||
if(exists(file)) {
|
if(exists(file)) {
|
||||||
++val_it;
|
++val_it;
|
||||||
@ -314,7 +312,7 @@ MakefileGenerator::findFilesInVPATH(ProStringList l, uchar flags, const QString
|
|||||||
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
|
dir = regex.left(regex.lastIndexOf(Option::dir_sep) + 1);
|
||||||
real_dir = dir;
|
real_dir = dir;
|
||||||
if(!(flags & VPATH_NoFixify))
|
if(!(flags & VPATH_NoFixify))
|
||||||
real_dir = fileFixify(real_dir, qmake_getpwd(), Option::output_dir) + '/';
|
real_dir = fileFixify(real_dir, FileFixifyBackwards) + '/';
|
||||||
regex.remove(0, dir.length());
|
regex.remove(0, dir.length());
|
||||||
}
|
}
|
||||||
if(real_dir.isEmpty() || exists(real_dir)) {
|
if(real_dir.isEmpty() || exists(real_dir)) {
|
||||||
@ -495,10 +493,10 @@ MakefileGenerator::init()
|
|||||||
sub.toLatin1().constData());
|
sub.toLatin1().constData());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
inn = fileFixify(tinn.first().toQString(), qmake_getpwd());
|
inn = fileFixify(tinn.first().toQString(), FileFixifyToIndir);
|
||||||
outn = fileFixify(toutn.first().toQString(), qmake_getpwd(), Option::output_dir);
|
outn = fileFixify(toutn.first().toQString(), FileFixifyBackwards);
|
||||||
} else {
|
} else {
|
||||||
inn = fileFixify(sub, qmake_getpwd());
|
inn = fileFixify(sub, FileFixifyToIndir);
|
||||||
if (!QFile::exists(inn)) {
|
if (!QFile::exists(inn)) {
|
||||||
// random insanity for backwards compat: .in file specified with absolute out dir
|
// random insanity for backwards compat: .in file specified with absolute out dir
|
||||||
inn = fileFixify(sub);
|
inn = fileFixify(sub);
|
||||||
@ -508,7 +506,7 @@ MakefileGenerator::init()
|
|||||||
inn.toLatin1().constData());
|
inn.toLatin1().constData());
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
outn = fileFixify(inn.left(inn.length()-3), qmake_getpwd(), Option::output_dir);
|
outn = fileFixify(inn.left(inn.length() - 3), FileFixifyBackwards);
|
||||||
}
|
}
|
||||||
|
|
||||||
const ProKey confign(sub + ".CONFIG");
|
const ProKey confign(sub + ".CONFIG");
|
||||||
@ -687,7 +685,7 @@ MakefileGenerator::init()
|
|||||||
if(tmp_out.indexOf("$") == -1) {
|
if(tmp_out.indexOf("$") == -1) {
|
||||||
if(!verifyExtraCompiler((*it), QString())) //verify
|
if(!verifyExtraCompiler((*it), QString())) //verify
|
||||||
continue;
|
continue;
|
||||||
QString out = fileFixify(tmp_out.toQString(), Option::output_dir, Option::output_dir);
|
QString out = fileFixify(tmp_out.toQString(), FileFixifyFromOutdir);
|
||||||
bool pre_dep = (config.indexOf("target_predeps") != -1);
|
bool pre_dep = (config.indexOf("target_predeps") != -1);
|
||||||
if (v.contains(vokey)) {
|
if (v.contains(vokey)) {
|
||||||
const ProStringList &var_out = v.value(vokey);
|
const ProStringList &var_out = v.value(vokey);
|
||||||
@ -728,7 +726,7 @@ MakefileGenerator::init()
|
|||||||
if (!verifyExtraCompiler((*it).toQString(), inpf)) //verify
|
if (!verifyExtraCompiler((*it).toQString(), inpf)) //verify
|
||||||
continue;
|
continue;
|
||||||
QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell);
|
QString out = replaceExtraCompilerVariables(tmp_out.toQString(), inpf, QString(), NoShell);
|
||||||
out = fileFixify(out, Option::output_dir, Option::output_dir);
|
out = fileFixify(out, FileFixifyFromOutdir);
|
||||||
bool pre_dep = (config.indexOf("target_predeps") != -1);
|
bool pre_dep = (config.indexOf("target_predeps") != -1);
|
||||||
if (v.contains(vokey)) {
|
if (v.contains(vokey)) {
|
||||||
const ProStringList &var_out = project->values(vokey);
|
const ProStringList &var_out = project->values(vokey);
|
||||||
@ -886,7 +884,7 @@ MakefileGenerator::processPrlFile(QString &file)
|
|||||||
// meta_file = fileFixify(meta_file);
|
// meta_file = fileFixify(meta_file);
|
||||||
QString real_meta_file = Option::normalizePath(meta_file);
|
QString real_meta_file = Option::normalizePath(meta_file);
|
||||||
if(!meta_file.isEmpty()) {
|
if(!meta_file.isEmpty()) {
|
||||||
QString f = fileFixify(real_meta_file, qmake_getpwd(), Option::output_dir);
|
QString f = fileFixify(real_meta_file, FileFixifyBackwards);
|
||||||
if(QMakeMetaInfo::libExists(f)) {
|
if(QMakeMetaInfo::libExists(f)) {
|
||||||
QMakeMetaInfo libinfo(project);
|
QMakeMetaInfo libinfo(project);
|
||||||
debug_msg(1, "Processing PRL file: %s", real_meta_file.toLatin1().constData());
|
debug_msg(1, "Processing PRL file: %s", real_meta_file.toLatin1().constData());
|
||||||
@ -1101,7 +1099,7 @@ MakefileGenerator::prlFileName(bool fixify)
|
|||||||
if(fixify) {
|
if(fixify) {
|
||||||
if(!project->isEmpty("DESTDIR"))
|
if(!project->isEmpty("DESTDIR"))
|
||||||
ret.prepend(project->first("DESTDIR").toQString());
|
ret.prepend(project->first("DESTDIR").toQString());
|
||||||
ret = fileFixify(ret, qmake_getpwd(), Option::output_dir);
|
ret = fileFixify(ret, FileFixifyBackwards);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -1507,7 +1505,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources)
|
|||||||
QString dir;
|
QString dir;
|
||||||
if (project->isActiveConfig("object_parallel_to_source")) {
|
if (project->isActiveConfig("object_parallel_to_source")) {
|
||||||
// The source paths are relative to the output dir, but we need source-relative paths
|
// The source paths are relative to the output dir, but we need source-relative paths
|
||||||
QString sourceRelativePath = fileFixify(sfn, qmake_getpwd(), Option::output_dir);
|
QString sourceRelativePath = fileFixify(sfn, FileFixifyBackwards);
|
||||||
|
|
||||||
if (sourceRelativePath.startsWith(".." + Option::dir_sep))
|
if (sourceRelativePath.startsWith(".." + Option::dir_sep))
|
||||||
sourceRelativePath = fileFixify(sourceRelativePath, FileFixifyAbsolute);
|
sourceRelativePath = fileFixify(sourceRelativePath, FileFixifyAbsolute);
|
||||||
@ -1523,7 +1521,7 @@ MakefileGenerator::createObjectList(const ProStringList &sources)
|
|||||||
|
|
||||||
if (!noIO()) {
|
if (!noIO()) {
|
||||||
// Ensure that the final output directory of each object exists
|
// Ensure that the final output directory of each object exists
|
||||||
QString outRelativePath = fileFixify(dir, qmake_getpwd(), Option::output_dir);
|
QString outRelativePath = fileFixify(dir, FileFixifyBackwards);
|
||||||
if (!mkdir(outRelativePath))
|
if (!mkdir(outRelativePath))
|
||||||
warn_msg(WarnLogic, "Cannot create directory '%s'", outRelativePath.toLatin1().constData());
|
warn_msg(WarnLogic, "Cannot create directory '%s'", outRelativePath.toLatin1().constData());
|
||||||
}
|
}
|
||||||
@ -1795,7 +1793,7 @@ MakefileGenerator::writeExtraTargets(QTextStream &t)
|
|||||||
}
|
}
|
||||||
const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
|
const ProStringList &config = project->values(ProKey(*it + ".CONFIG"));
|
||||||
if (config.indexOf("fix_target") != -1)
|
if (config.indexOf("fix_target") != -1)
|
||||||
targ = fileFixify(targ, Option::output_dir, Option::output_dir);
|
targ = fileFixify(targ, FileFixifyFromOutdir);
|
||||||
if (config.indexOf("phony") != -1)
|
if (config.indexOf("phony") != -1)
|
||||||
deps += QLatin1String(" FORCE");
|
deps += QLatin1String(" FORCE");
|
||||||
t << escapeDependencyPath(targ) << ":" << deps;
|
t << escapeDependencyPath(targ) << ":" << deps;
|
||||||
@ -1812,7 +1810,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
|
const ProStringList &quc = project->values("QMAKE_EXTRA_COMPILERS");
|
||||||
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
|
for (ProStringList::ConstIterator it = quc.begin(); it != quc.end(); ++it) {
|
||||||
QString tmp_out = fileFixify(project->first(ProKey(*it + ".output")).toQString(),
|
QString tmp_out = fileFixify(project->first(ProKey(*it + ".output")).toQString(),
|
||||||
Option::output_dir, Option::output_dir);
|
FileFixifyFromOutdir);
|
||||||
const QString tmp_cmd = project->values(ProKey(*it + ".commands")).join(' ');
|
const QString tmp_cmd = project->values(ProKey(*it + ".commands")).join(' ');
|
||||||
const QString tmp_dep_cmd = project->values(ProKey(*it + ".depend_command")).join(' ');
|
const QString tmp_dep_cmd = project->values(ProKey(*it + ".depend_command")).join(' ');
|
||||||
QString dep_cd_cmd;
|
QString dep_cd_cmd;
|
||||||
@ -1923,7 +1921,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
}
|
}
|
||||||
QStringList deps, inputs;
|
QStringList deps, inputs;
|
||||||
if(!tmp_dep.isEmpty())
|
if(!tmp_dep.isEmpty())
|
||||||
deps += fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
|
deps += fileFixify(tmp_dep, FileFixifyFromOutdir);
|
||||||
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
for (ProStringList::ConstIterator input = tmp_inputs.begin(); input != tmp_inputs.end(); ++input) {
|
||||||
QString inpf = (*input).toQString();
|
QString inpf = (*input).toQString();
|
||||||
deps += findDependencies(inpf);
|
deps += findDependencies(inpf);
|
||||||
@ -1998,7 +1996,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":";
|
t << escapeDependencyPath(Option::fixPathToTargetOS(out)) << ":";
|
||||||
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
|
// compiler.CONFIG+=explicit_dependencies means that ONLY compiler.depends gets to cause Makefile dependencies
|
||||||
if (config.indexOf("explicit_dependencies") != -1) {
|
if (config.indexOf("explicit_dependencies") != -1) {
|
||||||
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, Option::output_dir, Option::output_dir)));
|
t << " " << valList(escapeDependencyPaths(fileFixify(tmp_dep, FileFixifyFromOutdir)));
|
||||||
} else {
|
} else {
|
||||||
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
|
t << " " << valList(escapeDependencyPaths(inputs)) << " " << valList(escapeDependencyPaths(deps));
|
||||||
}
|
}
|
||||||
@ -2012,7 +2010,7 @@ MakefileGenerator::writeExtraCompilerTargets(QTextStream &t)
|
|||||||
deps << in;
|
deps << in;
|
||||||
QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell));
|
QString out = Option::fixPathToTargetOS(replaceExtraCompilerVariables(tmp_out, inpf, QString(), NoShell));
|
||||||
if(!tmp_dep.isEmpty()) {
|
if(!tmp_dep.isEmpty()) {
|
||||||
QStringList pre_deps = fileFixify(tmp_dep, Option::output_dir, Option::output_dir);
|
QStringList pre_deps = fileFixify(tmp_dep, FileFixifyFromOutdir);
|
||||||
for(int i = 0; i < pre_deps.size(); ++i)
|
for(int i = 0; i < pre_deps.size(); ++i)
|
||||||
deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell);
|
deps << replaceExtraCompilerVariables(pre_deps.at(i), inpf, out, NoShell);
|
||||||
}
|
}
|
||||||
@ -2330,7 +2328,7 @@ MakefileGenerator::findSubDirsSubTargets() const
|
|||||||
if(fileInfo(st->in_directory).isRelative())
|
if(fileInfo(st->in_directory).isRelative())
|
||||||
st->out_directory = st->in_directory;
|
st->out_directory = st->in_directory;
|
||||||
else
|
else
|
||||||
st->out_directory = fileFixify(st->in_directory, qmake_getpwd(), Option::output_dir);
|
st->out_directory = fileFixify(st->in_directory, FileFixifyBackwards);
|
||||||
const ProKey mkey(fixedSubdir + ".makefile");
|
const ProKey mkey(fixedSubdir + ".makefile");
|
||||||
if (!project->isEmpty(mkey)) {
|
if (!project->isEmpty(mkey)) {
|
||||||
st->makefile = project->first(mkey).toQString();
|
st->makefile = project->first(mkey).toQString();
|
||||||
@ -2808,22 +2806,20 @@ MakefileGenerator::escapeDependencyPaths(const ProStringList &paths) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
QStringList
|
QStringList
|
||||||
MakefileGenerator::fileFixify(const QStringList& files, const QString &out_dir, const QString &in_dir,
|
MakefileGenerator::fileFixify(const QStringList &files, FileFixifyTypes fix, bool canon) const
|
||||||
FileFixifyType fix, bool canon) const
|
|
||||||
{
|
{
|
||||||
if(files.isEmpty())
|
if(files.isEmpty())
|
||||||
return files;
|
return files;
|
||||||
QStringList ret;
|
QStringList ret;
|
||||||
for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
|
for(QStringList::ConstIterator it = files.begin(); it != files.end(); ++it) {
|
||||||
if(!(*it).isEmpty())
|
if(!(*it).isEmpty())
|
||||||
ret << fileFixify((*it), out_dir, in_dir, fix, canon);
|
ret << fileFixify((*it), fix, canon);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString
|
QString
|
||||||
MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const QString &in_d,
|
MakefileGenerator::fileFixify(const QString &file, FileFixifyTypes fix, bool canon) const
|
||||||
FileFixifyType fix, bool canon) const
|
|
||||||
{
|
{
|
||||||
if(file.isEmpty())
|
if(file.isEmpty())
|
||||||
return file;
|
return file;
|
||||||
@ -2837,9 +2833,10 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
|
|||||||
else
|
else
|
||||||
warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData());
|
warn_msg(WarnLogic, "Unable to expand ~ in %s", ret.toLatin1().constData());
|
||||||
}
|
}
|
||||||
if(fix == FileFixifyAbsolute || (fix == FileFixifyDefault && project->isActiveConfig("no_fixpath"))) {
|
if ((fix & FileFixifyAbsolute)
|
||||||
if(fix == FileFixifyAbsolute && QDir::isRelativePath(ret)) { //already absolute
|
|| (!(fix & FileFixifyRelative) && project->isActiveConfig("no_fixpath"))) {
|
||||||
QString pwd = QDir(qmake_getpwd()).absoluteFilePath(in_d);
|
if ((fix & FileFixifyAbsolute) && QDir::isRelativePath(ret)) {
|
||||||
|
QString pwd = !(fix & FileFixifyFromOutdir) ? project->projectDir() : Option::output_dir;
|
||||||
{
|
{
|
||||||
QFileInfo in_fi(fileInfo(pwd));
|
QFileInfo in_fi(fileInfo(pwd));
|
||||||
if (in_fi.exists())
|
if (in_fi.exists())
|
||||||
@ -2851,8 +2848,8 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
|
|||||||
}
|
}
|
||||||
ret = Option::fixPathToTargetOS(ret, false, canon);
|
ret = Option::fixPathToTargetOS(ret, false, canon);
|
||||||
} else { //fix it..
|
} else { //fix it..
|
||||||
QString out_dir = QDir(Option::output_dir).absoluteFilePath(out_d);
|
QString out_dir = (fix & FileFixifyToIndir) ? project->projectDir() : Option::output_dir;
|
||||||
QString in_dir = QDir(qmake_getpwd()).absoluteFilePath(in_d);
|
QString in_dir = !(fix & FileFixifyFromOutdir) ? project->projectDir() : Option::output_dir;
|
||||||
{
|
{
|
||||||
QFileInfo in_fi(fileInfo(in_dir));
|
QFileInfo in_fi(fileInfo(in_dir));
|
||||||
if(in_fi.exists())
|
if(in_fi.exists())
|
||||||
@ -2914,8 +2911,8 @@ MakefileGenerator::fileFixify(const QString& file, const QString &out_d, const Q
|
|||||||
}
|
}
|
||||||
if(ret.isEmpty())
|
if(ret.isEmpty())
|
||||||
ret = ".";
|
ret = ".";
|
||||||
debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s] [%s::%s]", fix, canon, orig_file.toLatin1().constData(),
|
debug_msg(3, "Fixed[%d,%d] %s :: to :: %s [%s::%s]",
|
||||||
ret.toLatin1().constData(), in_d.toLatin1().constData(), out_d.toLatin1().constData(),
|
int(fix), canon, orig_file.toLatin1().constData(), ret.toLatin1().constData(),
|
||||||
qmake_getpwd().toLatin1().constData(), Option::output_dir.toLatin1().constData());
|
qmake_getpwd().toLatin1().constData(), Option::output_dir.toLatin1().constData());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@ -2924,7 +2921,7 @@ QMakeLocalFileName
|
|||||||
MakefileGenerator::fixPathForFile(const QMakeLocalFileName &file, bool forOpen)
|
MakefileGenerator::fixPathForFile(const QMakeLocalFileName &file, bool forOpen)
|
||||||
{
|
{
|
||||||
if(forOpen)
|
if(forOpen)
|
||||||
return QMakeLocalFileName(fileFixify(file.real(), qmake_getpwd(), Option::output_dir));
|
return QMakeLocalFileName(fileFixify(file.real(), FileFixifyBackwards));
|
||||||
return QMakeLocalFileName(fileFixify(file.real()));
|
return QMakeLocalFileName(fileFixify(file.real()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2979,7 +2976,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
|
|||||||
if(QDir::isRelativePath(dir)) {
|
if(QDir::isRelativePath(dir)) {
|
||||||
if(!dir.endsWith(Option::dir_sep))
|
if(!dir.endsWith(Option::dir_sep))
|
||||||
dir += Option::dir_sep;
|
dir += Option::dir_sep;
|
||||||
QString shadow = fileFixify(dir + dep.local(), pwd, Option::output_dir);
|
QString shadow = fileFixify(dir + dep.local(), FileFixifyBackwards);
|
||||||
if(exists(shadow)) {
|
if(exists(shadow)) {
|
||||||
ret = QMakeLocalFileName(shadow);
|
ret = QMakeLocalFileName(shadow);
|
||||||
goto found_dep_from_heuristic;
|
goto found_dep_from_heuristic;
|
||||||
@ -3015,7 +3012,7 @@ MakefileGenerator::findFileForDep(const QMakeLocalFileName &dep, const QMakeLoca
|
|||||||
QString out = Option::fixPathToTargetOS(
|
QString out = Option::fixPathToTargetOS(
|
||||||
replaceExtraCompilerVariables(tmp_out.toQString(), (*input).toQString(), QString(), NoShell));
|
replaceExtraCompilerVariables(tmp_out.toQString(), (*input).toQString(), QString(), NoShell));
|
||||||
if (out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) {
|
if (out == dep.real() || out.section(Option::dir_sep, -1) == dep_basename) {
|
||||||
ret = QMakeLocalFileName(fileFixify(out, qmake_getpwd(), Option::output_dir));
|
ret = QMakeLocalFileName(fileFixify(out, FileFixifyBackwards));
|
||||||
goto found_dep_from_heuristic;
|
goto found_dep_from_heuristic;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3132,7 +3129,7 @@ MakefileGenerator::pkgConfigFileName(bool fixify)
|
|||||||
if(fixify) {
|
if(fixify) {
|
||||||
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
|
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
|
||||||
ret.prepend(project->first("DESTDIR").toQString());
|
ret.prepend(project->first("DESTDIR").toQString());
|
||||||
ret = fileFixify(ret, qmake_getpwd(), Option::output_dir);
|
ret = fileFixify(ret, FileFixifyBackwards);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -224,16 +224,22 @@ protected:
|
|||||||
ProStringList fixLibFlags(const ProKey &var);
|
ProStringList fixLibFlags(const ProKey &var);
|
||||||
virtual ProString fixLibFlag(const ProString &lib);
|
virtual ProString fixLibFlag(const ProString &lib);
|
||||||
|
|
||||||
|
public:
|
||||||
//file fixification to unify all file names into a single pattern
|
//file fixification to unify all file names into a single pattern
|
||||||
enum FileFixifyType { FileFixifyAbsolute, FileFixifyRelative, FileFixifyDefault };
|
enum FileFixifyType {
|
||||||
QString fileFixify(const QString& file, const QString &out_dir=QString(),
|
FileFixifyFromIndir = 0,
|
||||||
const QString &in_dir=QString(), FileFixifyType fix=FileFixifyDefault, bool canon=true) const;
|
FileFixifyFromOutdir = 1,
|
||||||
inline QString fileFixify(const QString& file, FileFixifyType fix, bool canon=true) const
|
FileFixifyToOutDir = 0,
|
||||||
{ return fileFixify(file, QString(), QString(), fix, canon); }
|
FileFixifyToIndir = 2,
|
||||||
QStringList fileFixify(const QStringList& files, const QString &out_dir=QString(),
|
FileFixifyBackwards = FileFixifyFromOutdir | FileFixifyToIndir,
|
||||||
const QString &in_dir=QString(), FileFixifyType fix=FileFixifyDefault, bool canon=true) const;
|
FileFixifyDefault = 0,
|
||||||
inline QStringList fileFixify(const QStringList& files, FileFixifyType fix, bool canon=true) const
|
FileFixifyAbsolute = 4,
|
||||||
{ return fileFixify(files, QString(), QString(), fix, canon); }
|
FileFixifyRelative = 8
|
||||||
|
};
|
||||||
|
Q_DECLARE_FLAGS(FileFixifyTypes, FileFixifyType)
|
||||||
|
protected:
|
||||||
|
QString fileFixify(const QString &file, FileFixifyTypes fix = FileFixifyDefault, bool canon = true) const;
|
||||||
|
QStringList fileFixify(const QStringList &files, FileFixifyTypes fix = FileFixifyDefault, bool canon = true) const;
|
||||||
|
|
||||||
QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst);
|
QString installMetaFile(const ProKey &replace_rule, const QString &src, const QString &dst);
|
||||||
|
|
||||||
@ -259,6 +265,7 @@ public:
|
|||||||
bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); }
|
bool isWindowsShell() const { return Option::dir_sep == QLatin1String("\\"); }
|
||||||
QString shellQuote(const QString &str);
|
QString shellQuote(const QString &str);
|
||||||
};
|
};
|
||||||
|
Q_DECLARE_OPERATORS_FOR_FLAGS(MakefileGenerator::FileFixifyTypes)
|
||||||
|
|
||||||
inline void MakefileGenerator::setNoIO(bool o)
|
inline void MakefileGenerator::setNoIO(bool o)
|
||||||
{ no_io = o; }
|
{ no_io = o; }
|
||||||
|
@ -379,7 +379,7 @@ ProjectGenerator::addConfig(const QString &cfg, bool add)
|
|||||||
bool
|
bool
|
||||||
ProjectGenerator::addFile(QString file)
|
ProjectGenerator::addFile(QString file)
|
||||||
{
|
{
|
||||||
file = fileFixify(file, qmake_getpwd());
|
file = fileFixify(file, FileFixifyToIndir);
|
||||||
QString dir;
|
QString dir;
|
||||||
int s = file.lastIndexOf(Option::dir_sep);
|
int s = file.lastIndexOf(Option::dir_sep);
|
||||||
if(s != -1)
|
if(s != -1)
|
||||||
|
@ -107,7 +107,7 @@ UnixMakefileGenerator::writeDefaultVariables(QTextStream &t)
|
|||||||
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
|
project->values("QMAKE_DISTDIR") = project->first("QMAKE_DISTNAME");
|
||||||
t << "DISTDIR = " << escapeFilePath(fileFixify(
|
t << "DISTDIR = " << escapeFilePath(fileFixify(
|
||||||
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
|
(project->isEmpty("OBJECTS_DIR") ? ProString(".tmp/") : project->first("OBJECTS_DIR")) + project->first("QMAKE_DISTDIR"),
|
||||||
Option::output_dir, Option::output_dir, FileFixifyAbsolute)) << endl;
|
FileFixifyFromOutdir | FileFixifyAbsolute)) << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@ -377,7 +377,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(!d_file.isEmpty()) {
|
if(!d_file.isEmpty()) {
|
||||||
d_file = odir + ".deps/" + fileFixify(d_file, pwd, Option::output_dir) + ".d";
|
d_file = odir + ".deps/" + fileFixify(d_file, FileFixifyBackwards) + ".d";
|
||||||
QString d_file_d = escapeDependencyPath(d_file);
|
QString d_file_d = escapeDependencyPath(d_file);
|
||||||
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
|
QStringList deps = findDependencies((*it).toQString()).filter(QRegExp(
|
||||||
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
|
"((^|/)" + Option::h_moc_mod + "|" + Option::cpp_moc_ext + "$)"));
|
||||||
@ -1396,7 +1396,7 @@ UnixMakefileGenerator::libtoolFileName(bool fixify)
|
|||||||
if(fixify) {
|
if(fixify) {
|
||||||
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
|
if(QDir::isRelativePath(ret) && !project->isEmpty("DESTDIR"))
|
||||||
ret.prepend(project->first("DESTDIR").toQString());
|
ret.prepend(project->first("DESTDIR").toQString());
|
||||||
ret = fileFixify(ret, qmake_getpwd(), Option::output_dir);
|
ret = fileFixify(ret, FileFixifyBackwards);
|
||||||
}
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
@ -2337,7 +2337,7 @@ bool VCFilter::addExtraCompiler(const VCFilterFile &info)
|
|||||||
for (int i = 0; i < extradeps.count(); ++i) {
|
for (int i = 0; i < extradeps.count(); ++i) {
|
||||||
QString dd = extradeps.at(i).simplified();
|
QString dd = extradeps.at(i).simplified();
|
||||||
if (!dd.isEmpty())
|
if (!dd.isEmpty())
|
||||||
deps += Project->fileFixify(dd, QString(), Option::output_dir);
|
deps += Project->fileFixify(dd, MakefileGenerator::FileFixifyFromOutdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1588,7 +1588,7 @@ void VcprojGenerator::initResourceFiles()
|
|||||||
QT_PCLOSE(proc);
|
QT_PCLOSE(proc);
|
||||||
if(!indeps.isEmpty())
|
if(!indeps.isEmpty())
|
||||||
deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '),
|
deps += fileFixify(indeps.replace('\n', ' ').simplified().split(' '),
|
||||||
QString(), Option::output_dir);
|
FileFixifyFromOutdir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ bool QMakeProject::read(const QString &project, LoadFlags what)
|
|||||||
QString absproj = (project == QLatin1String("-"))
|
QString absproj = (project == QLatin1String("-"))
|
||||||
? QLatin1String("(stdin)")
|
? QLatin1String("(stdin)")
|
||||||
: QDir::cleanPath(QDir(qmake_getpwd()).absoluteFilePath(project));
|
: QDir::cleanPath(QDir(qmake_getpwd()).absoluteFilePath(project));
|
||||||
|
m_projectDir = QFileInfo(absproj).path();
|
||||||
return boolRet(evaluateFile(absproj, QMakeHandler::EvalProjectFile, what));
|
return boolRet(evaluateFile(absproj, QMakeHandler::EvalProjectFile, what));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,6 +41,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
class QMakeProject : private QMakeEvaluator
|
class QMakeProject : private QMakeEvaluator
|
||||||
{
|
{
|
||||||
QString m_projectFile;
|
QString m_projectFile;
|
||||||
|
QString m_projectDir;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
QMakeProject();
|
QMakeProject();
|
||||||
@ -49,6 +50,7 @@ public:
|
|||||||
bool read(const QString &project, LoadFlags what = LoadAll);
|
bool read(const QString &project, LoadFlags what = LoadAll);
|
||||||
|
|
||||||
QString projectFile() const { return m_projectFile; }
|
QString projectFile() const { return m_projectFile; }
|
||||||
|
QString projectDir() const { return m_projectDir; }
|
||||||
QString sourceRoot() const { return m_sourceRoot.isEmpty() ? m_buildRoot : m_sourceRoot; }
|
QString sourceRoot() const { return m_sourceRoot.isEmpty() ? m_buildRoot : m_sourceRoot; }
|
||||||
QString buildRoot() const { return m_buildRoot; }
|
QString buildRoot() const { return m_buildRoot; }
|
||||||
QString confFile() const { return m_conffile; }
|
QString confFile() const { return m_conffile; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user