mirror of
https://github.com/QuasarApp/CQtDeployer.git
synced 2025-04-27 02:04:33 +00:00
ref #640 "added implementation of installDirDeb and installDirQIFW options"
This commit is contained in:
parent
43275660ca
commit
5837503a94
@ -3,7 +3,7 @@
|
||||
APPS=$BASH_ARRAY_APPLICATIONS
|
||||
APPS_SHORTCUTS=$BASH_ARRAY_SHORTCUTS_APPLICATIONS
|
||||
|
||||
TARGET_DIR=/opt/$PREFIX/
|
||||
TARGET_DIR=$CQT_INSTALL_DEB_DIR/$PREFIX/
|
||||
|
||||
#creating shortcut
|
||||
DEST_FILE=
|
||||
@ -21,7 +21,7 @@ function createShortCut {
|
||||
echo "Encoding=UTF-8" >> $DEST_FILE
|
||||
echo "Name=$DEST_NAME" >> $DEST_FILE
|
||||
echo "Type=Application" >> $DEST_FILE
|
||||
echo "Icon=/opt/$ICON" >> $DEST_FILE
|
||||
echo "Icon=$CQT_INSTALL_DEB_DIR/$ICON" >> $DEST_FILE
|
||||
echo "Terminal=false" >> $DEST_FILE
|
||||
echo "Exec=$SRC_FILE" >> $DEST_FILE
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<Title>$NAME</Title>
|
||||
<Publisher>$PUBLISHER</Publisher>
|
||||
<StartMenuDir>$NAME</StartMenuDir>
|
||||
<TargetDir>@HomeDir@/$NAME</TargetDir>
|
||||
<TargetDir>$CQT_INSTALL_DIR/$NAME</TargetDir>
|
||||
<InstallActionColumnVisible>true</InstallActionColumnVisible>
|
||||
<RemoveTargetDir>true</RemoveTargetDir>
|
||||
<ControlScript>controlScript.qs</ControlScript>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<Title>$NAME</Title>
|
||||
<Publisher>$PUBLISHER</Publisher>
|
||||
<StartMenuDir>$NAME</StartMenuDir>
|
||||
<TargetDir>@HomeDir@/$NAME</TargetDir>
|
||||
<TargetDir>$CQT_INSTALL_DIR/$NAME</TargetDir>
|
||||
<InstallActionColumnVisible>true</InstallActionColumnVisible>
|
||||
<RemoveTargetDir>true</RemoveTargetDir>
|
||||
<ControlScript>controlScript.qs</ControlScript>
|
||||
|
@ -144,8 +144,7 @@ bool Deb::cb() const {
|
||||
}
|
||||
|
||||
QString Deb::dataLocation(const DistroModule &module) const {
|
||||
return location(module) + "/opt/" + releativeLocation(module);
|
||||
|
||||
return location(module) + module.installDirDEB() + "/" + releativeLocation(module);
|
||||
}
|
||||
|
||||
QString Deb::location(const DistroModule &module) const {
|
||||
|
@ -74,6 +74,8 @@ bool iDistribution::unpackFile(const QFileInfo &resource,
|
||||
inputText.replace("$PUBLISHER", info.Publisher);
|
||||
inputText.replace("$HOMEPAGE", info.Homepage);
|
||||
inputText.replace("$PREFIX", info.Prefix);
|
||||
inputText.replace("$CQT_INSTALL_DIR", info.InstallDeirQIFW());
|
||||
inputText.replace("$CQT_INSTALL_DEB_DIR", info.InstallDirDEB);
|
||||
|
||||
|
||||
for (auto it = info.Custom.cbegin(); it != info.Custom.cend(); ++it) {
|
||||
@ -192,6 +194,10 @@ bool iDistribution::collectInfo(const DistroModule& pkg,
|
||||
if (!pkg.homePage().isEmpty())
|
||||
info.Homepage = pkg.homePage();
|
||||
|
||||
info.InstallDirDEB = "/opt";
|
||||
if (!pkg.installDirDEB().isEmpty())
|
||||
info.InstallDirDEB = pkg.installDirDEB();
|
||||
|
||||
info.Prefix = releativeLocation(pkg);
|
||||
|
||||
QString cmdArray = "[";
|
||||
|
@ -1 +1,6 @@
|
||||
#include "templateinfo.h"
|
||||
#include "quasarapp.h"
|
||||
|
||||
QString TemplateInfo::InstallDeirQIFW() const {
|
||||
return QuasarAppUtils::Params::getArg("installDirQIFW", "@HomeDir@");
|
||||
}
|
||||
|
@ -5,6 +5,9 @@
|
||||
#include <QHash>
|
||||
#include <deploy_global.h>
|
||||
|
||||
/**
|
||||
* @brief The TemplateInfo struct This structure contains information about distribution packages.
|
||||
*/
|
||||
struct DEPLOYSHARED_EXPORT TemplateInfo
|
||||
{
|
||||
QString Name;
|
||||
@ -15,6 +18,8 @@ struct DEPLOYSHARED_EXPORT TemplateInfo
|
||||
QString Publisher;
|
||||
QString Homepage;
|
||||
QString Prefix;
|
||||
QString InstallDirDEB;
|
||||
QString InstallDeirQIFW() const;
|
||||
|
||||
QHash<QString, QString> Custom;
|
||||
|
||||
|
@ -463,6 +463,9 @@ bool ConfigParser::initDistroStruct() {
|
||||
auto trData = QuasarAppUtils::Params::getArg("tr").
|
||||
split(DeployCore::getSeparator(0), splitbehavior);
|
||||
|
||||
auto installDirDeb = QuasarAppUtils::Params::getArg("installDirDeb").
|
||||
split(DeployCore::getSeparator(0), splitbehavior);
|
||||
|
||||
// init distro stucts for all targets
|
||||
if (binOut.size() && !parsePackagesPrivate(mainDistro, binOut, &DistroModule::setBinOutDir)) {
|
||||
packagesErrorLog("binOut");
|
||||
@ -544,6 +547,11 @@ bool ConfigParser::initDistroStruct() {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (installDirDeb.size() && !parsePackagesPrivate(mainDistro, installDirDeb, &DistroModule::setInstallDirDEB)) {
|
||||
packagesErrorLog("installDirDeb");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -148,6 +148,17 @@ void DistroModule::setKey(const QString &key) {
|
||||
_key = key;
|
||||
}
|
||||
|
||||
QString DistroModule::installDirDEB() const {
|
||||
if (_installDirDEB.isEmpty())
|
||||
return "/opt";
|
||||
|
||||
return _installDirDEB;
|
||||
}
|
||||
|
||||
void DistroModule::setInstallDirDEB(const QString &newInstallDir) {
|
||||
_installDirDEB = newInstallDir;
|
||||
}
|
||||
|
||||
QSet<QString> DistroModule::tr() const {
|
||||
return _tr;
|
||||
}
|
||||
|
@ -74,6 +74,9 @@ public:
|
||||
void setTr(const QSet<QString> &tr);
|
||||
void addTr(const QString &tr);
|
||||
|
||||
QString installDirDEB() const;
|
||||
void setInstallDirDEB(const QString &newInstallDir);
|
||||
|
||||
protected:
|
||||
void setKey(const QString &key);
|
||||
|
||||
@ -101,6 +104,8 @@ private:
|
||||
// extra translations
|
||||
QSet<QString> _tr;
|
||||
|
||||
QString _installDirDEB;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
@ -186,6 +186,9 @@ private slots:
|
||||
void testDisableRunScripts();
|
||||
void testQifOut();
|
||||
|
||||
// note: this test checking in manual mode only.
|
||||
void testInstallDirsOptions();
|
||||
|
||||
void customTest();
|
||||
};
|
||||
|
||||
@ -1533,6 +1536,26 @@ void deploytest::testQifOut() {
|
||||
"qif", "-qifOut", "QIF_OUT.exe"}, &result);
|
||||
}
|
||||
|
||||
void deploytest::testInstallDirsOptions() {
|
||||
#ifdef QT_DEBUG
|
||||
#ifdef Q_OS_UNIX
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC" , TestBinDir + "TestCPPOnly"};
|
||||
|
||||
#else
|
||||
QStringList binMulti = {TestBinDir + "TestOnlyC.exe" , TestBinDir + "TestCPPOnly.exe"};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
runTestParams({"-bin", binMulti.join(","), "clear",
|
||||
"qif", "deb",
|
||||
"-targetPackage", "pkg;TestCPPOnly",
|
||||
"-installDirDeb", "pkg;/var",
|
||||
"-installDirQIFW", "/opt"});
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
void deploytest::customTest() {
|
||||
//runTestParams({"-confFile", "",
|
||||
// "qifFromSystem"});
|
||||
|
Loading…
x
Reference in New Issue
Block a user