diff --git a/constants.h b/constants.h index f75ce85..2d35c04 100644 --- a/constants.h +++ b/constants.h @@ -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 diff --git a/board-mappings.ini b/examples/board-mappings.ini similarity index 100% rename from board-mappings.ini rename to examples/board-mappings.ini diff --git a/repos.ini b/examples/repos.ini similarity index 100% rename from repos.ini rename to examples/repos.ini diff --git a/ssu-defaults.ini b/examples/ssu-defaults.ini similarity index 100% rename from ssu-defaults.ini rename to examples/ssu-defaults.ini diff --git a/ssu.ini b/examples/ssu.ini similarity index 100% rename from ssu.ini rename to examples/ssu.ini diff --git a/libssu/ssu.cpp b/libssu/ssu.cpp index e811b0d..805d626 100644 --- a/libssu/ssu.cpp +++ b/libssu/ssu.cpp @@ -85,7 +85,7 @@ QPair 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-")) diff --git a/libssu/ssudeviceinfo.cpp b/libssu/ssudeviceinfo.cpp index b62ca3d..2ea5a1c 100644 --- a/libssu/ssudeviceinfo.cpp +++ b/libssu/ssudeviceinfo.cpp @@ -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()); diff --git a/libssu/ssurepomanager.cpp b/libssu/ssurepomanager.cpp index 127abda..97e668a 100644 --- a/libssu/ssurepomanager.cpp +++ b/libssu/ssurepomanager.cpp @@ -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 *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); diff --git a/rpm/ssu.spec b/rpm/ssu.spec index b586958..a035ff4 100644 --- a/rpm/ssu.spec +++ b/rpm/ssu.spec @@ -1,5 +1,5 @@ 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 diff --git a/ssu.pro b/ssu.pro index 5be9a7f..64df67d 100644 --- a/ssu.pro +++ b/ssu.pro @@ -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