Commit 2f09bbfd authored by Aard's avatar Aard

Allow arbitrary argument order for ssu ar

parent 354572ff
......@@ -144,10 +144,22 @@ void SsuRepoManager::update(){
// ... and create all repositories required for this device
foreach (const QString &repo, repos){
QFile repoFile(QString("%1/ssu_%2_%3.repo")
.arg(ZYPP_REPO_PATH)
.arg(repo)
.arg(rndMode ? "rnd" : "release"));
QString repoFilePath = QString("%1/ssu_%2_%3.repo")
.arg(ZYPP_REPO_PATH)
.arg(repo)
.arg(rndMode ? "rnd" : "release");
if (url(repo, rndMode) == ""){
// TODO, repositories should only be disabled if they're not required
// for this machine. For required repositories error is better
QTextStream qerr(stderr);
qerr << "Repository " << repo << " does not contain valid URL, skipping and disabling." << endl;
disable(repo);
QFile(repoFilePath).remove();
continue;
}
QFile repoFile(repoFilePath);
if (repoFile.open(QIODevice::WriteOnly | QIODevice::Text)){
QTextStream out(&repoFile);
......
......@@ -100,6 +100,7 @@ void RndSsuCli::optMode(QStringList opt){
void RndSsuCli::optModifyRepo(int action, QStringList opt){
SsuRepoManager repoManager;
QTextStream qout(stdout);
QTextStream qerr(stderr);
if (opt.count() == 3){
switch(action){
......@@ -125,7 +126,20 @@ void RndSsuCli::optModifyRepo(int action, QStringList opt){
break;
}
} else if (opt.count() == 4 && action == Add){
repoManager.add(opt.at(2), opt.at(3));
QString url, repo;
if (opt.at(2).indexOf(QRegExp("[a-z]*://", Qt::CaseInsensitive)) == 0){
url = opt.at(2);
repo = opt.at(3);
} else if (opt.at(3).indexOf(QRegExp("[a-z]*://", Qt::CaseInsensitive)) == 0){
url = opt.at(3);
repo = opt.at(2);
} else {
qerr << "Invalid parameters for 'ssu ar': URL required." << endl;
return;
}
repoManager.add(repo, url);
repoManager.update();
uidWarning();
}
......
* Wed Apr 10 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.31.4
- Allow arbitrary argument order for ssu ar
* Sat Apr 06 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.31.3
- Add warning when updating repos as non-root to ssu cli
- Rewrite repo files on flavour, release and mode changes
......
Name: ssu
Version: 0.31.3
Version: 0.31.4
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