Commit e4fc89e2 authored by Aard's avatar Aard

Add debug split special handling for -debuginfo repositories

parent 01033c93
......@@ -144,12 +144,21 @@ void SsuRepoManager::update(){
// ... and create all repositories required for this device
foreach (const QString &repo, repos){
// repo should be used where a unique identifier for silly human brains, or
// zypper is required. repoName contains the shortened form for ssu use
QString repoName = repo;
QString debugSplit;
if (repo.endsWith("-debuginfo")){
debugSplit = "&debug";
repoName = repo.left(repo.size() - 10);
}
QString repoFilePath = QString("%1/ssu_%2_%3.repo")
.arg(ZYPP_REPO_PATH)
.arg(repo)
.arg(rndMode ? "rnd" : "release");
if (url(repo, rndMode) == ""){
if (url(repoName, rndMode) == ""){
// TODO, repositories should only be disabled if they're not required
// for this machine. For required repositories error is better
QTextStream qerr(stderr);
......@@ -173,9 +182,9 @@ void SsuRepoManager::update(){
<< "enabled=1" << endl;
if (rndMode)
out << "baseurl=plugin:ssu?rnd&repo=" << repo << endl;
out << "baseurl=plugin:ssu?rnd&repo=" << repoName << debugSplit << endl;
else
out << "baseurl=plugin:ssu?repo=" << repo << endl;
out << "baseurl=plugin:ssu?repo=" << repoName << debugSplit << endl;
out.flush();
}
......@@ -234,8 +243,15 @@ QString SsuRepoManager::url(QString repoName, bool rndRepo,
QSettings repoSettings(SSU_REPO_CONFIGURATION, QSettings::IniFormat);
SsuDeviceInfo deviceInfo;
// set debugSplit for incorrectly configured debuginfo repositories (debugSplit
// should already be passed by the url resolver); might be overriden later on,
// if required
if (repoName.endsWith("-debuginfo") && !repoParameters.contains("debugSplit"))
repoParameters.insert("debugSplit", "debug");
configSections = repoVariables(&repoParameters, rndRepo);
// Override device model (and therefore all the family, ... stuff)
if (parametersOverride.contains("model"))
deviceInfo.setDeviceModel(parametersOverride.value("model"));
......
......@@ -18,7 +18,10 @@ class SsuRepoManager: public QObject {
public:
SsuRepoManager();
/**
* Add a repository
* Add a repository. Note: Repositories ending with -debuginfo receive special
* treatment. They'll get saved with the full name to make zypper and the user
* happy, but internally the -debuginfo will be stripped, and the debugSplit
* parameter set to debug instead.
*/
void add(QString repo, QString repoUrl="");
/**
......
......@@ -303,7 +303,14 @@ void RndSsuCli::optRepos(QStringList opt){
if (micMode){
repos = deviceInfo.repos(rndRepo, SsuDeviceInfo::BoardFilter);
foreach (const QString &repo, repos){
QString repoUrl = ssu.repoUrl(repo, rndRepo, repoParameters, repoOverride);
QString repoName = repo;
if (repo.endsWith("-debuginfo")){
repoName = repo.left(repo.size() - 10);
repoParameters.insert("debugSplit", "debug");
} else if (repoParameters.value("debugSplit") == "debug")
repoParameters.remove("debugSplit");
QString repoUrl = ssu.repoUrl(repoName, rndRepo, repoParameters, repoOverride);
qout << "repo --name=" << repo << "-"
<< (rndRepo ? repoOverride.value("rndRelease")
: repoOverride.value("release"))
......@@ -333,7 +340,14 @@ void RndSsuCli::optRepos(QStringList opt){
qout.setFieldAlignment(QTextStream::AlignLeft);
foreach (const QString &repo, repos){
QString repoUrl = ssu.repoUrl(repo, rndRepo, repoParameters, repoOverride);
QString repoName = repo;
if (repo.endsWith("-debuginfo")){
repoName = repo.left(repo.size() - 10);
repoParameters.insert("debugSplit", "debug");
} else if (repoParameters.value("debugSplit") == "debug")
repoParameters.remove("debugSplit");
QString repoUrl = ssu.repoUrl(repoName, rndRepo, repoParameters, repoOverride);
qout << " - " << qSetFieldWidth(longestField) << repo << qSetFieldWidth(0) << " ... " << repoUrl << endl;
}
......
* Fri Apr 12 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.32
- Add debug-split special handling for -debuginfo repositories
* Wed Apr 10 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.31.5
- Add model option to ssu, add -s (short) output for scripts to some options
......
Name: ssu
Version: 0.31.5
Version: 0.32
Release: 1
Summary: SSU enabler for RND
Group: System/Base
......
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