21#include "ssuslipstream.h"
23#include <QCoreApplication>
37void SsuSlipstream::run()
39 QTextStream err(stderr, QIODevice::WriteOnly);
41 QString partition = QString::fromUtf8(qgetenv(
"SSU_SLIPSTREAM_PARTITION"));
43 if (partition.isEmpty()) {
44 err <<
"Nothing to do\n";
45 QCoreApplication::exit(1);
51 QPair<QString, QString> credentials = ssu.
credentials(
"store");
52 QString release = ssu.
release(
false);
54 QString release_override = QString::fromUtf8(qgetenv(
"SSU_SLIPSTREAM_RELEASE"));
55 if (!release_override.isEmpty()) {
56 err << QString(
"Forcing release to: %1\n").arg(release_override);
57 release = release_override;
60 SsuCoreConfig *settings = SsuCoreConfig::instance();
61 const QString KEY(
"slipstream-url");
62 QString ssuCredentialsUrl = settings->value(KEY, ssu.
repoUrl(KEY)).toString();
64 if (ssuCredentialsUrl.isEmpty()) {
65 err <<
"URL for slipstream update not set (config key 'slipstream-url')\n";
66 QCoreApplication::exit(1);
70 QUrl url(ssuCredentialsUrl);
71 url.setUserName(credentials.first);
72 url.setPassword(credentials.second);
74 QTextStream out(stdout, QIODevice::WriteOnly);
75 out << url.toString() <<
'/' << release <<
'/' << partition <<
'\n';
77 QTimer::singleShot(0, QCoreApplication::instance(), SLOT(quit()));
QString repoUrl(const QString &repoName, bool rndRepo=false, QHash< QString, QString > repoParameters=QHash< QString, QString >(), QHash< QString, QString > parametersOverride=QHash< QString, QString >())
QPair< QString, QString > credentials(const QString &scope)
Q_INVOKABLE QString release(bool rnd=false)
See SsuCoreConfig::release.