|
|
|
@ -44,37 +44,43 @@ void normalisePackageDescriptionFileName(std::string& fileName)
|
|
|
|
|
|
|
|
|
|
void GeneratePatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName)
|
|
|
|
|
{
|
|
|
|
|
std::string cmd="xdelta.exe delta";
|
|
|
|
|
std::string cmd="xdelta delta";
|
|
|
|
|
cmd+=" "+srcFileName+" "+destFileName+" "+patchFileName;
|
|
|
|
|
nlinfo("executing system command: %s",cmd.c_str());
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","delta",srcFileName.c_str(),destFileName.c_str(),patchFileName.c_str(),NULL);
|
|
|
|
|
#else // NL_OS_WINDOWS
|
|
|
|
|
system (cmd.c_str());
|
|
|
|
|
sint error = system (cmd.c_str());
|
|
|
|
|
if (error)
|
|
|
|
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
|
|
|
|
#endif // NL_OS_WINDOWS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void ApplyPatch(const std::string& srcFileName,const std::string& destFileName,const std::string& patchFileName=std::string())
|
|
|
|
|
{
|
|
|
|
|
std::string cmd="xdelta.exe patch";
|
|
|
|
|
std::string cmd="xdelta patch";
|
|
|
|
|
cmd+=" "+patchFileName+" "+srcFileName+" "+destFileName;
|
|
|
|
|
nlinfo("executing system command: %s",cmd.c_str());
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
_spawnlp(_P_WAIT, "xdelta.exe","xdelta.exe","patch",patchFileName.c_str(),srcFileName.c_str(),destFileName.c_str(),NULL);
|
|
|
|
|
#else // NL_OS_WINDOWS
|
|
|
|
|
system (cmd.c_str());
|
|
|
|
|
sint error = system (cmd.c_str());
|
|
|
|
|
if (error)
|
|
|
|
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
|
|
|
|
#endif // NL_OS_WINDOWS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GenerateLZMA(const std::string sourceFile, const std::string &outputFile)
|
|
|
|
|
{
|
|
|
|
|
std::string cmd="lzma.exe e ";
|
|
|
|
|
std::string cmd="lzma e ";
|
|
|
|
|
cmd+=" "+sourceFile+" "+outputFile;
|
|
|
|
|
nlinfo("executing system command: %s",cmd.c_str());
|
|
|
|
|
#ifdef NL_OS_WINDOWS
|
|
|
|
|
_spawnlp(_P_WAIT, "lzma.exe","lzma.exe", "e", sourceFile.c_str(), outputFile.c_str(), NULL);
|
|
|
|
|
#else // NL_OS_WINDOWS
|
|
|
|
|
system (cmd.c_str());
|
|
|
|
|
sint error = system (cmd.c_str());
|
|
|
|
|
if (error)
|
|
|
|
|
nlwarning("'%s' failed with error code %d", cmd.c_str(), error);
|
|
|
|
|
#endif // NL_OS_WINDOWS
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|