From 61974ec15c9d4a20526fce3a70229ec69b647216 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Sat, 11 Apr 2020 11:19:36 +0800 Subject: [PATCH] Add 7z support to server patch, ref ryzom/ryzomcore#586 --- .../patchman_service/spa_server_patch_applier.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp b/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp index cd3703766..a5583aabc 100644 --- a/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp +++ b/ryzom/server/src/patchman_service/spa_server_patch_applier.cpp @@ -205,7 +205,18 @@ static bool untar(const NLMISC::CSString& tarFile,const NLMISC::CSString& destin DROP_IF(!ok,"Patching error - failed to change directory to: "+destinationDirectory,return false); NLMISC::CSString cmd; - cmd+= "tar xzfv "+tarFile; + if (NLMISC::endsWith(tarFile.c_str(), ".7z") + || NLMISC::endsWith(tarFile.c_str(), ".7Z")) + { + // sudo apt install p7zip-full + cmd += "7z x " + tarFile; + } + else + { + cmd += "tar xzfv " + tarFile; + } + + nldebug("- system: %s",cmd.c_str()); ok= system(cmd.c_str())==0;