Commit 8b738840 authored by Andrew Branson's avatar Andrew Branson

[ssu] Add repos.d to allow other packages to install ssu domains. Fixes JB#47252

Also moved the example ini files into a subdirectory for clarity.
parent babcc97c
......@@ -10,8 +10,10 @@
/// The group ID ssu expects to run as. This is usually the GID of the main phone user
#define SSU_GROUP_ID 1000
/// Path to the main ssu configuration file
#define SSU_REPO_CONFIGURATION "/usr/share/ssu/repos.ini"
/// Path to the ssu domain configuration file
#define SSU_REPO_CONFIGURATION "/var/cache/ssu/repos.ini"
/// Path to config.d for ssu domain configurations
#define SSU_REPO_CONFIGURATION_DIR "/usr/share/ssu/repos.d"
/// Path to board / device family mappings file
#define SSU_BOARD_MAPPING_CONFIGURATION "/var/cache/ssu/board-mappings.ini"
/// Path to config.d for board mappings
......
......@@ -85,7 +85,7 @@ QPair<QString, QString> Ssu::credentials(const QString &scope)
QString Ssu::credentialsScope(const QString &repoName, bool rndRepo)
{
SsuCoreConfig *settings = SsuCoreConfig::instance();
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
// hardcoded magic for doing special privileges store repositories
if (repoName == "store" || repoName.startsWith("store-c-"))
......
......@@ -426,7 +426,7 @@ QStringList SsuDeviceInfo::repos(bool rnd, int filter)
result.append(QString("adaptation%1").arg(i));
// now read the release/rnd repos
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
QString repoKey = (rnd ? "default-repos/rnd" : "default-repos/release");
if (repoSettings.contains(repoKey))
result.append(repoSettings.value(repoKey).toStringList());
......
......@@ -61,7 +61,7 @@ int SsuRepoManager::add(const QString &repo, const QString &repoUrl)
QString SsuRepoManager::caCertificatePath(const QString &domain)
{
SsuCoreConfig *settings = SsuCoreConfig::instance();
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
QString ca = SsuVariables::variable(&repoSettings,
(domain.isEmpty() ? settings->domain() : domain) + "-domain",
......@@ -352,7 +352,7 @@ QStringList SsuRepoManager::repoVariables(QHash<QString, QString> *storageHash,
SsuVariables var;
SsuCoreConfig *settings = SsuCoreConfig::instance();
QStringList configSections;
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
// fill in all arbitrary repo specific variables from ssu.ini
var.variableSection(settings, "repository-url-variables", storageHash);
......@@ -431,7 +431,7 @@ QString SsuRepoManager::url(const QString &repoName, bool rndRepo,
repoParameters.insert("brand", settings->brand());
// variableSection does autodetection for the domain default section
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);
SsuSettings repoSettings(SSU_REPO_CONFIGURATION, SSU_REPO_CONFIGURATION_DIR);
SsuVariables var;
var.variableSection(&repoSettings, domain + "-domain", &repoParameters);
......
Name: ssu
Version: 0.43.10
Version: 0.44.6
Release: 1
Summary: SSU enabler for RND
Group: System/Base
......@@ -42,6 +42,7 @@ Requires: ssu-network-proxy
%dir %{_datarootdir}/%{name}
%dir %{_datarootdir}/%{name}/board-mappings.d
%dir %{_datarootdir}/%{name}/features.d
%dir %{_datarootdir}/%{name}/repos.d
%dir %{_sysconfdir}/%{name}/
%{_sysconfdir}/dbus-1/system.d/*.conf
%doc COPYING.GPL COPYING.LGPL COPYING.BSD
......@@ -180,6 +181,7 @@ cd build && make INSTALL_ROOT=%{buildroot} install
mkdir -p %{buildroot}/%{_sysconfdir}/zypp/credentials.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/board-mappings.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/features.d
mkdir -p %{buildroot}/%{_datarootdir}/%{name}/repos.d
mkdir -p %{buildroot}/%{_docdir}/%{name}
mkdir -p %{buildroot}/%{_sysconfdir}/%{name}
cd .. && cp -R doc/html/* %{buildroot}/%{_docdir}/%{name}/
......@@ -209,3 +211,6 @@ fi
if [ -f /usr/share/ssu/features.ini ]; then
rm -f /usr/share/ssu/features.ini
fi
if [ -f /usr/share/ssu/repos.ini ]; then
rm -f /usr/share/ssu/repos.ini
fi
......@@ -18,7 +18,7 @@ ssud.depends = libssu
ssuslipstream.depends = libssu
declarative.depends = libssu
config.files = ssu.ini
config.files = examples/ssu.ini
config.path = /etc/ssu
oneshot.files = ssu-update-repos
......@@ -27,7 +27,9 @@ oneshot.path = /usr/lib/oneshot.d
macros.files = macros.ssuks
macros.path = /etc/rpm/
static_config.files = repos.ini ssu-defaults.ini board-mappings.ini
static_config.files = examples/repos.ini \
examples/ssu-defaults.ini \
examples/board-mappings.ini
static_config.path = /usr/share/ssu
INSTALLS += config static_config oneshot macros
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