forked from qt-creator/qt-creator
Lua: Add support for gzip files
Change-Id: Id342364ffb71b8dd2e60a4332fd1d88a4951e08a Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -161,6 +161,7 @@ static Group installRecipe(
|
|||||||
emitResult(sourceAndCommand.error());
|
emitResult(sourceAndCommand.error());
|
||||||
return SetupResult::StopWithError;
|
return SetupResult::StopWithError;
|
||||||
}
|
}
|
||||||
|
unarchiver.setGZipFileDestName(installOptionsIt->name);
|
||||||
unarchiver.setSourceAndCommand(*sourceAndCommand);
|
unarchiver.setSourceAndCommand(*sourceAndCommand);
|
||||||
unarchiver.setDestDir(destination(appDataPath, *installOptionsIt));
|
unarchiver.setDestDir(destination(appDataPath, *installOptionsIt));
|
||||||
return SetupResult::Continue;
|
return SetupResult::Continue;
|
||||||
@@ -172,6 +173,12 @@ static Group installRecipe(
|
|||||||
if (result == DoneWith::Cancel)
|
if (result == DoneWith::Cancel)
|
||||||
return DoneResult::Error;
|
return DoneResult::Error;
|
||||||
|
|
||||||
|
const FilePath destDir = destination(appDataPath, *installOptionsIt);
|
||||||
|
const FilePath binary = destDir / installOptionsIt->name;
|
||||||
|
|
||||||
|
if (binary.isFile())
|
||||||
|
binary.setPermissions(QFile::ExeUser | QFile::ExeGroup | QFile::ExeOther);
|
||||||
|
|
||||||
expected_str<QJsonDocument> doc = getOrCreatePackageInfo(appDataPath);
|
expected_str<QJsonDocument> doc = getOrCreatePackageInfo(appDataPath);
|
||||||
if (!doc)
|
if (!doc)
|
||||||
return emitResult(doc.error());
|
return emitResult(doc.error());
|
||||||
@@ -180,7 +187,7 @@ static Group installRecipe(
|
|||||||
QJsonObject installedPackage;
|
QJsonObject installedPackage;
|
||||||
installedPackage["version"] = installOptionsIt->version;
|
installedPackage["version"] = installOptionsIt->version;
|
||||||
installedPackage["name"] = installOptionsIt->name;
|
installedPackage["name"] = installOptionsIt->name;
|
||||||
installedPackage["path"] = destination(appDataPath, *installOptionsIt).toFSPathString();
|
installedPackage["path"] = destDir.toFSPathString();
|
||||||
obj[installOptionsIt->name] = installedPackage;
|
obj[installOptionsIt->name] = installedPackage;
|
||||||
|
|
||||||
expected_str<void> res = savePackageInfo(appDataPath, QJsonDocument(obj));
|
expected_str<void> res = savePackageInfo(appDataPath, QJsonDocument(obj));
|
||||||
|
Reference in New Issue
Block a user