Request for 7z instead of tgz, ref ryzom/ryzomcore#586

ryzomclassic-develop
kaetemi 5 years ago
parent 61974ec15c
commit fb3e97db1d

@ -120,7 +120,7 @@ bool untar(const NLMISC::CSString& destFile)
bool untarIfNeeded(const NLMISC::CSString& destFile)
{
if (destFile.right(4)==".tgz" || destFile.right(7)==".tar.gz")
if (destFile.right(4)==".tgz" || destFile.right(7)==".tar.gz" || destFile.right(3)==".7z")
{
return untar(destFile);
}

@ -64,13 +64,22 @@ namespace PATCHMAN
_Parent=NULL;
}
void CFileReceiver::init(NLNET::IModule* parent,const std::string& fileSpec)
{
CFileReceiverSkel::init(parent);
_Parent= parent;
_FileSpec= fileSpec;
_AdministeredModuleWrapper.init(dynamic_cast<CAdministeredModuleBase*>(parent));
}
void CFileReceiver::init(NLNET::IModule *parent, const std::string &fileSpec)
{
std::vector<std::string> fileSpecs;
fileSpecs.push_back(fileSpec);
init(parent, fileSpecs);
}
void CFileReceiver::init(NLNET::IModule *parent, const std::vector<std::string> &fileSpecs)
{
CFileReceiverSkel::init(parent);
_Parent = parent;
_FileSpecs.clear();
for (std::vector<std::string>::const_iterator it(fileSpecs.begin()), end(fileSpecs.end()); it != end; ++it)
_FileSpecs.push_back(*it);
_AdministeredModuleWrapper.init(dynamic_cast<CAdministeredModuleBase *>(parent));
}
bool CFileReceiver::haveIdleProxies() const
{
@ -144,7 +153,8 @@ namespace PATCHMAN
if (NLMISC::CSString(module->getModuleManifest()).contains(ManifestEntryIsFileRepository))
{
CFileRepositoryProxy spr(module);
spr.subscribe(_Parent,_FileSpec);
for (std::vector<NLMISC::CSString>::const_iterator it(_FileSpecs.begin()), end(_FileSpecs.end()); it != end; ++it)
spr.subscribe(_Parent, *it);
_log("Repository up: "+module->getModuleName());
_Proxies[module].Proxy= module;
}
@ -281,7 +291,8 @@ namespace PATCHMAN
// send the subscription request
CFileRepositoryProxy spr(sender);
spr.subscribe(_Parent,_FileSpec);
for (std::vector<NLMISC::CSString>::const_iterator it(_FileSpecs.begin()), end(_FileSpecs.end()); it != end; ++it)
spr.subscribe(_Parent, *it);
_log(NLMISC::toString("setupSubscriptions from: %s",sender->getModuleName().c_str()));
}

@ -50,6 +50,7 @@ namespace PATCHMAN
// ctor & init
CFileReceiver();
void init(NLNET::IModule* parent,const std::string& fileSpec="*/*");
void init(NLNET::IModule* parent,const std::vector<std::string> &fileSpecs);
// CModuleBase specialisation implementation
void onModuleUp(NLNET::IModuleProxy *module);
@ -120,7 +121,7 @@ namespace PATCHMAN
private:
// private data -----------------------------------------------------------
NLNET::IModule* _Parent;
NLMISC::CSString _FileSpec;
std::vector<NLMISC::CSString> _FileSpecs;
CAdministeredModuleWrapper _AdministeredModuleWrapper;
// some handy data types

@ -392,7 +392,10 @@ bool CServerPatchApplier::initModule(const TParsedCommandLine &initInfo)
// initialise the module base classes...
logMsg+= CAdministeredModuleBase::init(initInfo);
CFileReceiver::init(this,"*/*.tgz");
std::vector<std::string> fileSpecs;
fileSpecs.push_back("*/*.tgz");
fileSpecs.push_back("*/*.7z");
CFileReceiver::init(this, fileSpecs);
CDeploymentConfigurationSynchroniser::init(this);
// now that the base classes have been initialised, we can cumulate the module manifests
@ -403,7 +406,7 @@ bool CServerPatchApplier::initModule(const TParsedCommandLine &initInfo)
registerProgress(string("SPA Initialised: ")+logMsg+" "+_Manifest);
setStateVariable("State","Initialised");
broadcastStateInfo();
return true;
}
@ -865,7 +868,8 @@ bool CServerPatchApplier::_patchNextFile(const NLMISC::CSString& domainName,uint
NLMISC::CSString buildNumber= NLMISC::toString("%06u",nextVersion);
NLMISC::CSString baseFileName= *rit;
NLMISC::CSString tagFileName= baseFileName+".tag";
NLMISC::CSString tgzFileName= baseFileName+".tgz";
// NLMISC::CSString tgzFileName= baseFileName+".tgz";
NLMISC::CSString tgzFileName= baseFileName+".7z";
// if the archive file is missing then dispatch a request for it and give up
if (!NLMISC::CFile::fileExists(_Directories.getNextPatchDirectory(domainName)+tgzFileName))

Loading…
Cancel
Save