mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-29 11:14:33 +00:00
Merge branch 'v1.4' into v1.5
This commit is contained in:
commit
20012cbc45
@ -19,7 +19,7 @@ TEMPLATE = lib
|
|||||||
|
|
||||||
DEFINES += DEPLOY_LIBRARY
|
DEFINES += DEPLOY_LIBRARY
|
||||||
|
|
||||||
VERSION = 1.4.5.1
|
VERSION = 1.4.5.2
|
||||||
|
|
||||||
DEFINES += APP_VERSION='\\"$$VERSION\\"'
|
DEFINES += APP_VERSION='\\"$$VERSION\\"'
|
||||||
|
|
||||||
|
@ -498,6 +498,10 @@ bool ConfigParser::parseDeployMode() {
|
|||||||
QuasarAppUtils::Params::setEnable("deploySystem", true );
|
QuasarAppUtils::Params::setEnable("deploySystem", true );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!checkSnapPermisions()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
auto bin = QuasarAppUtils::Params::getStrArg("bin").
|
auto bin = QuasarAppUtils::Params::getStrArg("bin").
|
||||||
split(DeployCore::getSeparator(0));
|
split(DeployCore::getSeparator(0));
|
||||||
|
|
||||||
@ -760,8 +764,10 @@ void ConfigParser::initIgnoreList()
|
|||||||
|
|
||||||
if (!QuasarAppUtils::Params::isEndable("deploySystem-with-libc")) {
|
if (!QuasarAppUtils::Params::isEndable("deploySystem-with-libc")) {
|
||||||
|
|
||||||
envUnix.addEnv(Envirement::recursiveInvairement("/lib", 3));
|
envUnix.addEnv(Envirement::recursiveInvairement(DeployCore::transportPathToSnapRoot("/lib"), 3));
|
||||||
envUnix.addEnv(Envirement::recursiveInvairement("/usr/lib", 3));
|
envUnix.addEnv(Envirement::recursiveInvairement(DeployCore::transportPathToSnapRoot("/usr/lib"), 3));
|
||||||
|
|
||||||
|
|
||||||
ruleUnix.prority = SystemLib;
|
ruleUnix.prority = SystemLib;
|
||||||
ruleUnix.platform = Unix;
|
ruleUnix.platform = Unix;
|
||||||
ruleUnix.enfirement = envUnix;
|
ruleUnix.enfirement = envUnix;
|
||||||
@ -1067,7 +1073,7 @@ void ConfigParser::setExtraPath(const QStringList &value) {
|
|||||||
QDir dir;
|
QDir dir;
|
||||||
|
|
||||||
for (const auto &i : value) {
|
for (const auto &i : value) {
|
||||||
QFileInfo info(i);
|
QFileInfo info(DeployCore::transportPathToSnapRoot(i));
|
||||||
if (info.isDir()) {
|
if (info.isDir()) {
|
||||||
if (_config.targets().contains(info.absoluteFilePath())) {
|
if (_config.targets().contains(info.absoluteFilePath())) {
|
||||||
QuasarAppUtils::Params::log("skip the extra lib path because it is target!",
|
QuasarAppUtils::Params::log("skip the extra lib path because it is target!",
|
||||||
@ -1176,17 +1182,20 @@ iDistribution *ConfigParser::getDistribution() {
|
|||||||
|
|
||||||
void ConfigParser::initEnvirement() {
|
void ConfigParser::initEnvirement() {
|
||||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
|
|
||||||
auto path = env.value("PATH");
|
auto path = env.value("PATH");
|
||||||
|
|
||||||
_config.envirement.addEnv(env.value("LD_LIBRARY_PATH"));
|
if (!DeployCore::isSnap()) {
|
||||||
_config.envirement.addEnv(path);
|
|
||||||
|
_config.envirement.addEnv(env.value("LD_LIBRARY_PATH"));
|
||||||
|
_config.envirement.addEnv(path);
|
||||||
|
}
|
||||||
|
|
||||||
QStringList dirs;
|
QStringList dirs;
|
||||||
#ifdef Q_OS_LINUX
|
#ifdef Q_OS_LINUX
|
||||||
|
|
||||||
dirs.append(getDirsRecursive("/lib", 5));
|
dirs.append(getDirsRecursive(DeployCore::transportPathToSnapRoot("/lib"), 5));
|
||||||
dirs.append(getDirsRecursive("/usr/lib", 5));
|
dirs.append(getDirsRecursive(DeployCore::transportPathToSnapRoot("/usr/lib"), 5));
|
||||||
|
|
||||||
#else
|
#else
|
||||||
auto winPath = findWindowsPath(path);
|
auto winPath = findWindowsPath(path);
|
||||||
dirs.append(getDirsRecursive(winPath + "/System32", 2));
|
dirs.append(getDirsRecursive(winPath + "/System32", 2));
|
||||||
@ -1202,6 +1211,39 @@ void ConfigParser::initEnvirement() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ConfigParser::checkSnapPermisions() {
|
||||||
|
|
||||||
|
if (!DeployCore::isSnap())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
|
||||||
|
bool system = QuasarAppUtils::Params::isEndable("deploySystem") ||
|
||||||
|
QuasarAppUtils::Params::isEndable("extraLibs");
|
||||||
|
bool checkPath = QDir(DeployCore::snapRootFS()).entryList(QDir::AllEntries | QDir::NoDotAndDotDot).size();
|
||||||
|
|
||||||
|
if (system && !checkPath) {
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log("You use a deploySystem or extraLibs options,"
|
||||||
|
" but not added permision system-backup for cqtdeployer."
|
||||||
|
" Please add permision system-backup befor usong cqtdeployer."
|
||||||
|
" Add system-backup permision from console: ",
|
||||||
|
QuasarAppUtils::Error);
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
"'snap connect cqtdeployer:system-backup :system-backup'",
|
||||||
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
|
QuasarAppUtils::Params::log(
|
||||||
|
"GUI: Open the gnome system setting >> Applications >> CQtDeployer. "
|
||||||
|
"in menu rights and permisions enable system-backup.",
|
||||||
|
QuasarAppUtils::Info);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
QStringList ConfigParser::getDirsRecursive(const QString &path, int maxDepch, int depch) {
|
QStringList ConfigParser::getDirsRecursive(const QString &path, int maxDepch, int depch) {
|
||||||
return getSetDirsRecursive(path, maxDepch, depch).values();
|
return getSetDirsRecursive(path, maxDepch, depch).values();
|
||||||
}
|
}
|
||||||
|
@ -82,6 +82,8 @@ private:
|
|||||||
|
|
||||||
void initEnvirement();
|
void initEnvirement();
|
||||||
|
|
||||||
|
bool checkSnapPermisions();
|
||||||
|
|
||||||
QStringList getDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
QStringList getDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
||||||
QSet<QString> getSetDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
QSet<QString> getSetDirsRecursive(const QString &path, int maxDepch = -1, int depch = 0);
|
||||||
|
|
||||||
|
@ -99,7 +99,7 @@ bool DependenciesScanner::fillLibInfo(LibInfo &info, const QString &file) const
|
|||||||
|
|
||||||
void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res, QSet<QString>& libStack) {
|
void DependenciesScanner::recursiveDep(LibInfo &lib, QSet<LibInfo> &res, QSet<QString>& libStack) {
|
||||||
QuasarAppUtils::Params::log("get recursive dependencies of " + lib.fullPath(),
|
QuasarAppUtils::Params::log("get recursive dependencies of " + lib.fullPath(),
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Debug);
|
||||||
|
|
||||||
if (_scanedLibs.contains(lib.fullPath())) {
|
if (_scanedLibs.contains(lib.fullPath())) {
|
||||||
auto scanedLib = _scanedLibs.value(lib.fullPath());
|
auto scanedLib = _scanedLibs.value(lib.fullPath());
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QLibraryInfo>
|
#include <QLibraryInfo>
|
||||||
|
#include <QProcess>
|
||||||
#include <configparser.h>
|
#include <configparser.h>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
@ -102,12 +103,12 @@ DeployCore::QtModule DeployCore::getQtModule(const QString& path) {
|
|||||||
void DeployCore::addQtModule(DeployCore::QtModule &module, const QString &path) {
|
void DeployCore::addQtModule(DeployCore::QtModule &module, const QString &path) {
|
||||||
|
|
||||||
QuasarAppUtils::Params::log("current module " + QString::number(module),
|
QuasarAppUtils::Params::log("current module " + QString::number(module),
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Debug);
|
||||||
|
|
||||||
auto mod = getQtModule(path);
|
auto mod = getQtModule(path);
|
||||||
QuasarAppUtils::Params::log("add new module from path " + path +
|
QuasarAppUtils::Params::log("add new module from path " + path +
|
||||||
" module value " + QString::number(mod),
|
" module value " + QString::number(mod),
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Debug);
|
||||||
|
|
||||||
|
|
||||||
module = static_cast<DeployCore::QtModule>(
|
module = static_cast<DeployCore::QtModule>(
|
||||||
@ -531,6 +532,32 @@ char DeployCore::getEnvSeparator() {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool DeployCore::isSnap() {
|
||||||
|
return QProcessEnvironment::systemEnvironment().value("SNAP").size();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DeployCore::snapRootFS() {
|
||||||
|
return "/var/lib/snapd/hostfs";
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DeployCore::transportPathToSnapRoot(const QString &path) {
|
||||||
|
if (isSnap()) {
|
||||||
|
|
||||||
|
if (path.size() && path[0] != "/") {
|
||||||
|
auto absalutPath = QProcessEnvironment::systemEnvironment().value("PWD") + "/" + path;
|
||||||
|
if (!absalutPath.contains(DeployCore::snapRootFS())) {
|
||||||
|
return snapRootFS() + "/" + absalutPath;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!path.contains(DeployCore::snapRootFS())) {
|
||||||
|
return snapRootFS() + "/" + path;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
uint qHash(WinAPI i) {
|
uint qHash(WinAPI i) {
|
||||||
return static_cast<uint>(i);
|
return static_cast<uint>(i);
|
||||||
}
|
}
|
||||||
|
@ -190,6 +190,9 @@ public:
|
|||||||
static QString findProcess(const QString& env, const QString& proc);
|
static QString findProcess(const QString& env, const QString& proc);
|
||||||
|
|
||||||
|
|
||||||
|
static bool isSnap();
|
||||||
|
static QString snapRootFS();
|
||||||
|
static QString transportPathToSnapRoot(const QString &path);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // DEPLOYUTILS_H
|
#endif // DEPLOYUTILS_H
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "deploycore.h"
|
||||||
#include "distromodule.h"
|
#include "distromodule.h"
|
||||||
|
|
||||||
DistroModule::DistroModule() {
|
DistroModule::DistroModule() {
|
||||||
@ -25,7 +26,7 @@ void DistroModule::setQmlInput(const QSet<QString> &qmlInput) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DistroModule::addQmlInput(const QString &target) {
|
void DistroModule::addQmlInput(const QString &target) {
|
||||||
_qmlInput.insert(target);
|
_qmlInput.insert(DeployCore::transportPathToSnapRoot(target));
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DistroModule::name() const
|
QString DistroModule::name() const
|
||||||
@ -127,6 +128,6 @@ void DistroModule::setExtraPlugins(const QSet<QString> &extraPlugins)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void DistroModule::addExtraPlugins(const QString &extraPlugin) {
|
void DistroModule::addExtraPlugins(const QString &extraPlugin) {
|
||||||
_extraPlugins += extraPlugin;
|
_extraPlugins += DeployCore::transportPathToSnapRoot(extraPlugin);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -83,6 +83,14 @@ void Envirement::addEnv(const QStringList &listDirs) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Envirement::clear() {
|
||||||
|
if (_ignoreEnvList)
|
||||||
|
delete _ignoreEnvList;
|
||||||
|
|
||||||
|
_dataEnvironment.clear();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
bool Envirement::inThisEnvirement(const QString &file) const {
|
bool Envirement::inThisEnvirement(const QString &file) const {
|
||||||
QFileInfo info (file);
|
QFileInfo info (file);
|
||||||
|
|
||||||
|
@ -34,6 +34,8 @@ public:
|
|||||||
void addEnv(const QString &dir);
|
void addEnv(const QString &dir);
|
||||||
void addEnv(const QStringList &listDirs);
|
void addEnv(const QStringList &listDirs);
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
// return true if file exits in this envirement
|
// return true if file exits in this envirement
|
||||||
bool inThisEnvirement(const QString &file) const;
|
bool inThisEnvirement(const QString &file) const;
|
||||||
|
|
||||||
|
@ -330,7 +330,7 @@ void Extracter::extractLib(const QString &file,
|
|||||||
|
|
||||||
assert(depMap);
|
assert(depMap);
|
||||||
QuasarAppUtils::Params::log("extract lib :" + file,
|
QuasarAppUtils::Params::log("extract lib :" + file,
|
||||||
QuasarAppUtils::Info);
|
QuasarAppUtils::Debug);
|
||||||
|
|
||||||
auto data = _scaner->scan(file);
|
auto data = _scaner->scan(file);
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ bool FileManager::copyFolder(const QString &from, const QString &to, const QStri
|
|||||||
if (!skipFilter.isEmpty()) {
|
if (!skipFilter.isEmpty()) {
|
||||||
QuasarAppUtils::Params::log(
|
QuasarAppUtils::Params::log(
|
||||||
item.absoluteFilePath() + " ignored by filter " + skipFilter,
|
item.absoluteFilePath() + " ignored by filter " + skipFilter,
|
||||||
QuasarAppUtils::VerboseLvl::Info);
|
QuasarAppUtils::VerboseLvl::Debug);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto config = DeployCore::_config;
|
auto config = DeployCore::_config;
|
||||||
@ -319,7 +319,7 @@ bool FileManager::copyFolder(const QString &from, const QString &to, const QStri
|
|||||||
if (auto rule = config->ignoreList.isIgnore(info)) {
|
if (auto rule = config->ignoreList.isIgnore(info)) {
|
||||||
QuasarAppUtils::Params::log(
|
QuasarAppUtils::Params::log(
|
||||||
item.absoluteFilePath() + " ignored by rule " + rule->label,
|
item.absoluteFilePath() + " ignored by rule " + rule->label,
|
||||||
QuasarAppUtils::VerboseLvl::Info);
|
QuasarAppUtils::VerboseLvl::Debug);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -461,7 +461,7 @@ bool FileManager::copyFiles(const QStringList &source,
|
|||||||
if (!skipFilter.isEmpty()) {
|
if (!skipFilter.isEmpty()) {
|
||||||
QuasarAppUtils::Params::log(
|
QuasarAppUtils::Params::log(
|
||||||
info.absoluteFilePath() + " ignored by filter " + skipFilter,
|
info.absoluteFilePath() + " ignored by filter " + skipFilter,
|
||||||
QuasarAppUtils::VerboseLvl::Info);
|
QuasarAppUtils::VerboseLvl::Debug);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
auto config = DeployCore::_config;
|
auto config = DeployCore::_config;
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
||||||
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
||||||
<Name>CQtDeployer</Name>
|
<Name>CQtDeployer</Name>
|
||||||
<Version>1.4.5.1</Version>
|
<Version>1.4.5.2</Version>
|
||||||
<Title>CQtDeployer</Title>
|
<Title>CQtDeployer</Title>
|
||||||
<Publisher>QuasarApp</Publisher>
|
<Publisher>QuasarApp</Publisher>
|
||||||
<StartMenuDir>CQtDeployer</StartMenuDir>
|
<StartMenuDir>CQtDeployer</StartMenuDir>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
<WizardDefaultWidth>640px</WizardDefaultWidth>
|
||||||
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
<WizardDefaultHeight>400px</WizardDefaultHeight>
|
||||||
<Name>CQtDeployer</Name>
|
<Name>CQtDeployer</Name>
|
||||||
<Version>1.4.5.1</Version>
|
<Version>1.4.5.2</Version>
|
||||||
<Title>CQtDeployer</Title>
|
<Title>CQtDeployer</Title>
|
||||||
<Publisher>QuasarApp</Publisher>
|
<Publisher>QuasarApp</Publisher>
|
||||||
<StartMenuDir>CQtDeployer</StartMenuDir>
|
<StartMenuDir>CQtDeployer</StartMenuDir>
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
<Package>
|
<Package>
|
||||||
<DisplayName>CQtDeployer 1.4</DisplayName>
|
<DisplayName>CQtDeployer 1.4</DisplayName>
|
||||||
<Description>CQtDeployer 1.4</Description>
|
<Description>CQtDeployer 1.4</Description>
|
||||||
<Version>1.4.5.1</Version>
|
<Version>1.4.5.2</Version>
|
||||||
<Default>true</Default>
|
<Default>true</Default>
|
||||||
<ForcedInstallation>false</ForcedInstallation>
|
<ForcedInstallation>false</ForcedInstallation>
|
||||||
<Script>installscript.js</Script>
|
<Script>installscript.js</Script>
|
||||||
<ReleaseDate>2020-08-22</ReleaseDate>
|
<ReleaseDate>2020-08-28</ReleaseDate>
|
||||||
<SortingPriority>201</SortingPriority>
|
<SortingPriority>201</SortingPriority>
|
||||||
<Translations>
|
<Translations>
|
||||||
<Translation>ru.qm</Translation>
|
<Translation>ru.qm</Translation>
|
||||||
|
2
doc/wiki
2
doc/wiki
@ -1 +1 @@
|
|||||||
Subproject commit 68f4daac00f7780cbae69b18ed83d0837fd93e04
|
Subproject commit 838727b12b3d1e6367dd85aa3002d68f0c505a9e
|
@ -1,5 +1,5 @@
|
|||||||
[Desktop Entry]
|
[Desktop Entry]
|
||||||
Version=1.4.5.1
|
Version=1.4.5.2
|
||||||
Name=CQtDeployer
|
Name=CQtDeployer
|
||||||
Comment=CQtDeployer Help.
|
Comment=CQtDeployer Help.
|
||||||
Exec=cqtdeployer
|
Exec=cqtdeployer
|
||||||
@ -10,6 +10,6 @@ Categories=Application;
|
|||||||
X-GNOME-Bugzilla-Bugzilla=GNOME
|
X-GNOME-Bugzilla-Bugzilla=GNOME
|
||||||
X-GNOME-Bugzilla-Product=CQtDeployer
|
X-GNOME-Bugzilla-Product=CQtDeployer
|
||||||
X-GNOME-Bugzilla-Component=General
|
X-GNOME-Bugzilla-Component=General
|
||||||
X-GNOME-Bugzilla-Version=1.4.5.1
|
X-GNOME-Bugzilla-Version=1.4.5.2
|
||||||
StartupNotify=true
|
StartupNotify=true
|
||||||
Name[ru_RU]=CQtDeployer
|
Name[ru_RU]=CQtDeployer
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
name: cqtdeployer # you probably want to 'snapcraft register <name>'
|
name: cqtdeployer # you probably want to 'snapcraft register <name>'
|
||||||
version: '1.4.5.1' # just for humans, typically '1.2+git' or '1.3.2'
|
version: '1.4.5.2' # just for humans, typically '1.2+git' or '1.3.2'
|
||||||
summary: deploy your qt projects # 79 char long summary
|
summary: deploy your qt projects # 79 char long summary
|
||||||
description: |
|
description: |
|
||||||
Console app for deploy qt libs.
|
Console app for deploy qt libs.
|
||||||
@ -21,11 +21,11 @@ icon: snap/gui/icon.png
|
|||||||
apps:
|
apps:
|
||||||
cqtdeployer:
|
cqtdeployer:
|
||||||
command: desktop-launch $SNAP/cqtdeployer.sh
|
command: desktop-launch $SNAP/cqtdeployer.sh
|
||||||
plugs: [home, removable-media, process-control]
|
plugs: [home, removable-media, process-control, system-backup]
|
||||||
|
|
||||||
cqt:
|
cqt:
|
||||||
command: desktop-launch $SNAP/cqt.sh
|
command: desktop-launch $SNAP/cqt.sh
|
||||||
plugs: [home, removable-media, process-control]
|
plugs: [home, removable-media, process-control, system-backup]
|
||||||
|
|
||||||
parts:
|
parts:
|
||||||
cqtdeployer:
|
cqtdeployer:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user