Skip to content
Permalink
Browse files
Warn if kickstarter can't write kickstart file
  • Loading branch information
bwachter committed Apr 6, 2013
1 parent 44e6a2b commit 5a9a189512a050cbf1418e0dd315e47a4e8bb0d2
Showing with 21 additions and 7 deletions.
  1. +5 −0 rpm/ssu.changes
  2. +1 −1 rpm/ssu.spec
  3. +15 −6 ssuks/ssukickstarter.cpp
@@ -1,3 +1,8 @@
* 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
- Warn if kickstarter can't write kickstart file

* Fri Apr 05 2013 Bernd Wachter <bernd.wachter@jollamobile.com> - 0.31.2
- Add DisplayName for imager

@@ -1,5 +1,5 @@
Name: ssu
Version: 0.31.2
Version: 0.31.3
Release: 1
Summary: SSU enabler for RND
Group: System/Base
@@ -218,23 +218,32 @@ bool SsuKickstarter::write(QString kickstart){
if (!repoOverride.contains("deviceModel"))
repoOverride.insert("deviceModel", deviceInfo.deviceModel());

bool opened = false;
QString outputDir = repoOverride.value("outputdir");
if (!outputDir.isEmpty()) outputDir.append("/");

if (kickstart.isEmpty()){
if (repoOverride.contains("filename")){
QString fileName = QString("%1/%2")
.arg(repoOverride.value("outputdir"))
QString fileName = QString("%1%2")
.arg(outputDir)
.arg(var.resolveString(repoOverride.value("filename"), &repoOverride));

ks.setFileName(fileName);
ks.open(QIODevice::WriteOnly);
opened = ks.open(QIODevice::WriteOnly);
} else {
qerr << "No filename specified, and no default filename configured" << endl;
return false;
}
} else if (kickstart == "-")
ks.open(stdout, QIODevice::WriteOnly);
opened = ks.open(stdout, QIODevice::WriteOnly);
else {
ks.setFileName(repoOverride.value("outputdir") + kickstart);
ks.open(QIODevice::WriteOnly);
ks.setFileName(outputDir + kickstart);
opened = ks.open(QIODevice::WriteOnly);
}

if (!opened) {
qerr << "Unable to write output file " << ks.fileName() << ": " << ks.errorString() << endl;
return false;
}

QString displayName = QString("# DisplayName: %1 %2/%3 (%4) %5")

0 comments on commit 5a9a189

Please sign in to comment.