forked from qt-creator/qt-creator
Added some addition output to qpatch
Done with Roberto
This commit is contained in:
@@ -77,6 +77,7 @@ int main(int argc, char *argv[])
|
|||||||
std::cerr << "qpatch: error: file `" << qPrintable(fileName) << "' not writable" << std::endl;
|
std::cerr << "qpatch: error: file `" << qPrintable(fileName) << "' not writable" << std::endl;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
std::cout << "patching file `" << qPrintable(fileName) << "'" << std::endl;
|
||||||
|
|
||||||
forever {
|
forever {
|
||||||
int start = source.indexOf(qtDirPath, index);
|
int start = source.indexOf(qtDirPath, index);
|
||||||
@@ -121,6 +122,10 @@ int main(int argc, char *argv[])
|
|||||||
index = endOfString;
|
index = endOfString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (index == 0) {
|
||||||
|
std::cerr << "qpatch: warning: file `" << qPrintable(fileName) << "' didn't contain string to patch" << std::endl;
|
||||||
|
}
|
||||||
|
|
||||||
if (index != source.size())
|
if (index != source.size())
|
||||||
file.write(source.constData() + index, source.size() - index);
|
file.write(source.constData() + index, source.size() - index);
|
||||||
}
|
}
|
||||||
@@ -147,6 +152,8 @@ int main(int argc, char *argv[])
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::cout << "patching text file `" << qPrintable(fileName) << "'" << std::endl;
|
||||||
|
|
||||||
source.replace(qtDirPath, newQtPath);
|
source.replace(qtDirPath, newQtPath);
|
||||||
file.write(source);
|
file.write(source);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user