Commit 1cf47e0a authored by Aard's avatar Aard

[sandbox] Drop old sandbox code to allow Qt5 build, breaking testcases for now

parent ed80440b
......@@ -12,14 +12,12 @@ public_headers = \
HEADERS = \
$${public_headers} \
sandbox_p.h \
ssucoreconfig.h \
mobility-booty/qofonoservice_linux_p.h \
mobility-booty/qsysteminfo_linux_common_p.h \
mobility-booty/qsysteminfo_dbus_p.h
SOURCES = \
sandbox.cpp \
ssu.cpp \
ssucoreconfig.cpp \
ssudeviceinfo.cpp \
......
......@@ -208,6 +208,7 @@ void Ssu::requestFinished(QNetworkReply *reply){
}
#endif
/// @TODO: indicate that the device is not registered if there's a 404 on credentials update url
// what sucks more, this or goto?
do {
if (settings->contains("home-url")){
......
......@@ -7,13 +7,11 @@ License: GPLv2
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/nemomobile/ssu
BuildRequires: pkgconfig(boardname)
BuildRequires: pkgconfig(QtCore)
BuildRequires: pkgconfig(QtDBus)
BuildRequires: pkgconfig(QtDeclarative)
BuildRequires: pkgconfig(QtNetwork)
BuildRequires: pkgconfig(QtXml)
BuildRequires: pkgconfig(Qt5Core)
BuildRequires: pkgconfig(Qt5DBus)
BuildRequires: pkgconfig(Qt5Network)
BuildRequires: pkgconfig(Qt5Xml)
BuildRequires: pkgconfig(libzypp)
BuildRequires: pkgconfig(qt-boostable)
BuildRequires: pkgconfig(libsystemd-journal)
BuildRequires: oneshot
BuildRequires: doxygen
......@@ -40,6 +38,7 @@ Requires: ssu-vendor-data
%package vendor-data-example
Summary: Sample vendor configuration data
Group: System/Base
Provides: ssu-vendor-data
%description vendor-data-example
%{summary}. A vendor (including Nemo) is supposed to put those configuration on device.
......@@ -65,19 +64,6 @@ Provides: rpm-macros
%{_bindir}/ssuks
%package rnd-ui
Summary: Shiny user interface for %{name}
Group: System/Base
%description rnd-ui
%{summary}. With ponies!
%files rnd-ui
%defattr(-,root,root,-)
%{_bindir}/rndregisterui
%{_datadir}/applications/*.desktop
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
......@@ -136,7 +122,7 @@ Group: Documentation
%build
mkdir -p build && cd build
qmake DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
qmake -qt=5 DEFINES+='TARGET_ARCH=\\\"\"%{_target_cpu}\"\\\"' -recursive ..
make %{?_smp_mflags}
cd .. && doxygen doc/Doxyfile
......
......@@ -21,8 +21,8 @@
*/
SsuKickstarter::SsuKickstarter(QString sandbox) {
pathPrefix = sandbox;
SsuKickstarter::SsuKickstarter() {
pathPrefix = SsuSettings::sandboxPrefix();
SsuDeviceInfo deviceInfo;
deviceModel = deviceInfo.deviceModel();
......
......@@ -21,7 +21,7 @@ class Q_CORE_EXPORT SsuKickstarter: public QObject {
*/
class SsuKickstarter {
public:
SsuKickstarter(QString sandbox="");
SsuKickstarter();
void setRepoParameters(QHash<QString, QString> parameters);
bool write(QString kickstart="");
......
......@@ -15,7 +15,6 @@
#include "ssukickstarter.h"
#include "constants.h"
#include "libssu/sandbox_p.h"
#include "ssuks.h"
......@@ -44,13 +43,14 @@ void SsuKs::run(){
}
QString sandbox;
Sandbox *sb;
if (repoParameters.contains("sandbox")){
setenv("SSU_SANDBOX_DIR", repoParameters.value("sandbox").toLatin1(), 1);
sandbox = repoParameters.value("sandbox");
repoParameters.remove("sandbox");
}
// work around sandbox not sandboxing directories
sandbox = SsuSettings::sandboxPrefix();
if (!sandbox.isEmpty()){
QDirIterator it(SSU_DATA_DIR, QDir::AllEntries|QDir::NoDot|QDir::NoDotDot, QDirIterator::Subdirectories);
while (it.hasNext()){
it.next();
......@@ -72,18 +72,9 @@ void SsuKs::run(){
QString("%1/%2")
.arg(sandbox)
.arg(SSU_BOARD_MAPPING_CONFIGURATION_DIR));
sb = new Sandbox(sandbox, Sandbox::UseDirectly, Sandbox::ThisProcess);
if (sb->activate())
qout << "Using sandbox at " << sandbox << endl;
else {
qout << "Failed to activate sandbox" << endl;
return;
}
}
SsuKickstarter kickstarter(sandbox);
SsuKickstarter kickstarter;
kickstarter.setRepoParameters(repoParameters);
kickstarter.write(fileName);
} else
......
......@@ -7,7 +7,6 @@ SUBDIRS = \
ut_deviceinfo \
ut_repomanager \
ut_rndssucli \
ut_sandbox \
ut_settings \
ut_ssuurlresolver \
ut_urlresolver \
......
......@@ -7,15 +7,16 @@
#include <QtTest/QtTest>
#include "libssu/sandbox_p.h"
#include "coreconfigtest.h"
int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/
CoreconfigTest coreconfigTest;
......
......@@ -7,15 +7,16 @@
#include <QtTest/QtTest>
#include "libssu/sandbox_p.h"
#include "deviceinfotest.h"
int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/
DeviceInfoTest deviceinfoTest;
......
......@@ -7,15 +7,16 @@
#include <QtTest/QtTest>
#include "libssu/sandbox_p.h"
#include "repomanagertest.h"
int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/
RepoManagerTest repomanagerTest;
......
......@@ -12,12 +12,12 @@
#include <QtTest/QtTest>
#include "libssu/sandbox_p.h"
#include "testutils/process.h"
typedef QStringList Args; // improve readability
void RndSsuCliTest::init(){
/*
Q_ASSERT(m_sandbox == 0);
m_sandbox = new Sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
......@@ -26,11 +26,14 @@ void RndSsuCliTest::init(){
QFAIL("Failed to activate sandbox");
}
setenv("LD_PRELOAD", qPrintable(QString("%1/libsandboxhook.so").arg(TESTS_PATH)), 1);
*/
}
void RndSsuCliTest::cleanup(){
/*
delete m_sandbox;
m_sandbox = 0;
*/
}
void RndSsuCliTest::testSubcommandFlavour(){
......
......@@ -136,7 +136,7 @@ void UpgradeTestHelper::fillDefaultSettings(QSettings *defaultSettings, const QL
defaultSettings->beginGroup(group);
foreach (const TestCase &testCase, testCases){
switch (testCase.history().at(revision - 1).toAscii()){
switch (testCase.history().at(revision - 1).toLatin1()){
case 'S': // (S)et value
lastSetValue[testCase.key()] = QString("v%1-default").arg(revision);
defaultSettings->setValue(testCase.key(), lastSetValue[testCase.key()]);
......
......@@ -7,15 +7,16 @@
#include <QtTest/QtTest>
#include "libssu/sandbox_p.h"
#include "urlresolvertest.cpp"
int main(int argc, char **argv){
/*
Sandbox sandbox(QString("%1/configroot").arg(TESTS_DATA_PATH),
Sandbox::UseAsSkeleton, Sandbox::ThisProcess);
if (!sandbox.activate()){
qFatal("Failed to activate sandbox");
}
*/
UrlResolverTest urlResolverTest;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment