Changeset 926 for XmlTools2/trunk/xmlpatch.cpp
- Timestamp:
- Feb 5, 2014, 7:31:05 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XmlTools2/trunk/xmlpatch.cpp
r923 r926 100 100 for (pugi::xml_node currNodeToInsert = newNode.first_child(); currNodeToInsert; currNodeToInsert = currNodeToInsert.next_sibling()) 101 101 { 102 nodesToInsertion[j].append_copy(currNodeToInsert); // append the new node102 nodesToInsertion[j].append_copy(currNodeToInsert); // append the new node 103 103 } 104 104 … … 188 188 void XmlPatch::executeCommandOperation(const QString &commandString){ 189 189 190 QProcess newXmlToolsInstance;191 QString resultOutput;192 193 190 // Avoid infinite fork loops 194 if(commandString.contains(" -p ") || commandString.contains("--patch-files ")){191 if(commandString.contains("-p ") || commandString.contains("--patch-files ")){ 195 192 UtilXmlTools::displayErrorMessage("@COMMAND","Use of --patch-files option is not allowed inside a patch file"); 196 193 } 197 194 198 newXmlToolsInstance.start(GlobalVars::AppExecutable + " " + commandString); 199 newXmlToolsInstance.waitForFinished(-1); // wait for new instance to finish 200 201 resultOutput=newXmlToolsInstance.readAll(); 202 203 if(newXmlToolsInstance.exitCode()!=0){ 204 UtilXmlTools::displayErrorMessage("@COMMAND", "An error ocurred:\n" + resultOutput); 205 exit(1); 195 // Reserved to AEI 196 if(commandString.contains("--aei-patch-files-list ")){ 197 UtilXmlTools::displayErrorMessage("@COMMAND","Use of --aei-patch-files-list option is not allowed inside a patch file"); 206 198 } 207 199 208 200 std::cout << "@COMMAND patch operation output:\n" 209 << "########################################################################\n" 210 << resultOutput.toLatin1().constData() 211 << "########################################################################" 212 << std::endl; 201 << "########################################################################" 202 << std::endl; 203 204 OptionsParser myParser(Util::QStringToArgsArray(commandString)); 205 myParser.parse(); 206 207 std::cout 208 << "########################################################################" 209 << std::endl; 213 210 214 211 UtilXmlTools::displaySuccessMessage(1,"@COMMAND"); … … 426 423 else if(line.startsWith("@COMMAND")){ 427 424 428 command=getPatchParameterValue(line,"Arguments"); 425 command=GlobalVars::AppExecutable; 426 427 // Append files if forced to 428 if(!this->forceTargetFilesWildcard.isEmpty()){ 429 command+=" --files '"+this->forceTargetFilesWildcard+"' "; 430 } 431 432 command+=" "+getPatchParameterValue(line,"Options"); 433 434 // Add --no-backups and --no-verbose if patch was called with that arguments 435 if(!this->backupsEnabled){ 436 command.append(" --no-backups"); 437 } 438 439 if(!this->verboseEnabled){ 440 command.append(" --no-verbose"); 441 } 429 442 430 443 command.replace("'","\""); //replace apostrophe by quotes, to avoid problems … … 433 446 434 447 command.clear(); 448 filesWildcard.clear(); 435 449 } 436 450 else if(line.startsWith("@CUSTOM_CODE")){
Note:
See TracChangeset
for help on using the changeset viewer.