mirror of
https://github.com/parchlinux/calamares.git
synced 2025-06-27 01:15:38 -04:00
[tracking] Tidy code some more
This commit is contained in:
parent
8186d5730a
commit
d76c33bd3a
1 changed files with 13 additions and 5 deletions
|
@ -124,24 +124,32 @@ TrackingMachineNeonJob::prettyStatusMessage() const
|
|||
Calamares::JobResult
|
||||
TrackingMachineNeonJob::exec()
|
||||
{
|
||||
int r = CalamaresUtils::System::instance()->targetEnvCall( "/bin/sh",
|
||||
QString(), // Working dir
|
||||
QString(
|
||||
R"x(MACHINE_ID=`cat /etc/machine-id`
|
||||
static const auto script = QStringLiteral(
|
||||
R"x(
|
||||
MACHINE_ID=`cat /etc/machine-id`
|
||||
sed -i "s,URI =.*,URI = http://releases.neon.kde.org/meta-release/${MACHINE_ID}," /etc/update-manager/meta-release
|
||||
sed -i "s,URI_LTS =.*,URI_LTS = http://releases.neon.kde.org/meta-release-lts/${MACHINE_ID}," /etc/update-manager/meta-release
|
||||
true
|
||||
)x" ),
|
||||
)x" );
|
||||
int r = CalamaresUtils::System::instance()->targetEnvCall( "/bin/sh",
|
||||
QString(), // Working dir
|
||||
script,
|
||||
std::chrono::seconds( 1 ) );
|
||||
|
||||
if ( r == 0 )
|
||||
{
|
||||
return Calamares::JobResult::ok();
|
||||
}
|
||||
else if ( r > 0 )
|
||||
{
|
||||
return Calamares::JobResult::error(
|
||||
tr( "Error in machine feedback configuration." ),
|
||||
tr( "Could not configure machine feedback correctly, script error %1." ).arg( r ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
return Calamares::JobResult::error(
|
||||
tr( "Error in machine feedback configuration." ),
|
||||
tr( "Could not configure machine feedback correctly, Calamares error %1." ).arg( r ) );
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue