Commit ed8a08f7 authored by Aard's avatar Aard

[ssuks] Allow URL postprocessing after KS generation

parent 52e8c464
......@@ -368,7 +368,27 @@ bool SsuKickstarter::write(QString kickstart){
foreach (const QString &section, commandSections){
kout << commandSection(section).join("\n") << endl << endl;
kout << repos().join("\n") << endl << endl;
// this allows simple search and replace postprocessing of the repos section
// to overcome shortcomings of the "keep image creation simple token based"
// approach
// TODO: QHash looks messy in the config, provide tool to edit it
QString repoSection = repos().join("\n");
if (deviceInfo.variable("kickstart-defaults", "urlPostprocess")
QHash<QString, QVariant> postproc =
deviceInfo.variable("kickstart-defaults", "urlPostprocess").toHash();
QHash<QString, QVariant>::const_iterator it = postproc.constBegin();
while (it != postproc.constEnd()){
QRegExp regex(it.key(), Qt::CaseSensitive, QRegExp::RegExp2);
repoSection.replace(regex, it.value().toString());
kout << repoSection << endl << endl;
kout << packagesSection("packages").join("\n") << endl << endl;
kout << packagesSection("attachment").join("\n") << endl << endl;
// TODO: now that extending scriptlet section is might make sense to make it configurable
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