[neon/neon/settings/Neon/release-lts] usr/lib/neon_update: let flathub enabler skip if the marker already exists
Harald Sitter
null at kde.org
Fri Oct 9 13:44:44 BST 2020
Git commit 81e4807a04406e28542becb6d4f5cc438cc10b05 by Harald Sitter.
Committed on 09/10/2020 at 12:44.
Pushed by sitter into branch 'Neon/release-lts'.
let flathub enabler skip if the marker already exists
since we now try to start the service after upgrades we need a way to
skip out if the repo was already added before. this primarily prevents
us from adding the repo again if the user removed it after we had added
it
M +4 -3 usr/lib/neon_update/neon_flathub.rb
https://invent.kde.org/neon/neon/settings/commit/81e4807a04406e28542becb6d4f5cc438cc10b05
diff --git a/usr/lib/neon_update/neon_flathub.rb b/usr/lib/neon_update/neon_flathub.rb
index 9b6b213..aa8ab7f 100755
--- a/usr/lib/neon_update/neon_flathub.rb
+++ b/usr/lib/neon_update/neon_flathub.rb
@@ -6,9 +6,10 @@
require 'fileutils'
+marker = '/var/lib/neon/flathub-set-up'
bin = '/usr/bin/flatpak'
-exit 0 unless File.executable?(bin)
+exit 0 unless File.executable?(bin) || File.exist?(marker)
# in seconds
def wait_time
@@ -25,8 +26,8 @@ end
if system(bin, 'remote-add', '--system', '--if-not-exists',
'flathub', 'https://flathub.org/repo/flathub.flatpakrepo')
- FileUtils.mkpath('/var/lib/neon/')
- FileUtils.touch('/var/lib/neon/flathub-set-up')
+ FileUtils.mkpath(File.dirname(marker))
+ FileUtils.touch(marker)
break
end
More information about the Neon-commits
mailing list