[tracking] Simplify updatemanager job
- sed all the URI lines with a simple replacement - document policy requirements
This commit is contained in:
parent
9433311f24
commit
756e3084dc
@ -134,17 +134,15 @@ TrackingMachineUpdateManagerJob::prettyStatusMessage() const
|
||||
Calamares::JobResult
|
||||
TrackingMachineUpdateManagerJob::exec()
|
||||
{
|
||||
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" );
|
||||
int r = CalamaresUtils::System::instance()->targetEnvCall( "/bin/sh",
|
||||
static const auto script = QStringLiteral( "sed -i '/^URI/s,${MACHINE_ID},'`cat /etc/machine-id`',' /etc/update-manager/meta-release || true" );
|
||||
|
||||
auto res = CalamaresUtils::System::instance()->runCommand(
|
||||
CalamaresUtils::System::RunLocation::RunInTarget,
|
||||
QStringList { QStringLiteral( "/bin/sh" ) },
|
||||
QString(), // Working dir
|
||||
script,
|
||||
script, // standard input
|
||||
std::chrono::seconds( 1 ) );
|
||||
int r = res.first;
|
||||
|
||||
if ( r == 0 )
|
||||
{
|
||||
|
@ -34,8 +34,10 @@
|
||||
# Each area has a key *policy*, which is a Url to be opened when
|
||||
# the user clicks on the corresponding Help button for an explanation
|
||||
# of the details of that particular kind of tracking. If no policy
|
||||
# is set, the help button is hidden. The example policy links
|
||||
# go to Calamares' generic user manual.
|
||||
# is set, that tracking style is disabled. The example policy links
|
||||
# go to Calamares' generic user manual (which is a terrible idea
|
||||
# for distro's: you have GDPR obligations under most of these tracking
|
||||
# styles, so do your homework).
|
||||
#
|
||||
# Each area may have other configuration keys, depending on the
|
||||
# area and how it needs to be configured.
|
||||
@ -48,8 +50,7 @@
|
||||
---
|
||||
# This is the global policy; it is displayed as a link on the page.
|
||||
# If blank or commented out, no link is displayed on the tracking
|
||||
# page. It is recommended to either provide policy URLs for each
|
||||
# area, *or* one general link, and not to mix them.
|
||||
# page. You **must** provide policy links per-area as well.
|
||||
policy: "https://github.com/calamares/calamares/wiki/Use-Guide#installation-tracking"
|
||||
|
||||
# This is the default level to enable for tracking. If commented out,
|
||||
@ -79,9 +80,14 @@ install:
|
||||
# needs to be done. There is currently only one valid
|
||||
# style, "updatemanager", which edits two files in the installed
|
||||
# system to enable system-tracking.
|
||||
#
|
||||
# Per-style documentation:
|
||||
# - updatemanager replaces the literal string "${MACHINE_ID}" with the contents of
|
||||
# /etc/machine-id, in lines starting with "URI" in the file /etc/update-manager/meta-release
|
||||
machine:
|
||||
enabled: false
|
||||
style: updatemanager
|
||||
policy: "https://github.com/calamares/calamares/wiki/Use-Guide#machine-tracking"
|
||||
|
||||
# The user area is not yet implemented, and has no specific configuration.
|
||||
user:
|
||||
|
Loading…
Reference in New Issue
Block a user