[neon/neon/ubuntu-advantage-tools/Neon/release] debian: make more use of $*_path variables

Carlos De Maine null at kde.org
Sun Jun 21 10:55:39 BST 2026


Git commit 64245ca0522e7bfb99180871a1a925898541d923 by Carlos De Maine.
Committed on 21/06/2026 at 09:55.
Pushed by carlosdem into branch 'Neon/release'.

make more use of $*_path variables

M  +8    -8    debian/ubuntu-advantage-tools.postinst

https://invent.kde.org/neon/neon/ubuntu-advantage-tools/-/commit/64245ca0522e7bfb99180871a1a925898541d923

diff --git a/debian/ubuntu-advantage-tools.postinst b/debian/ubuntu-advantage-tools.postinst
index 5048e2e..b57f9e6 100644
--- a/debian/ubuntu-advantage-tools.postinst
+++ b/debian/ubuntu-advantage-tools.postinst
@@ -11,22 +11,22 @@ then
     mkdir --parents "$(dirname "/etc/kde_neon/")"
 fi
 
-# dpkg-divert the service away as well
-dpkg-divert --rename --remove /etc/apt/apt.conf.d/20apt-esm-hook.conf  || true
-dpkg-divert --no-rename --add --package ubuntu-advantage-tools --divert /etc/kde_neon/20apt-esm-hook.conf.distrib /etc/apt/apt.conf.d/20apt-esm-hook-neon.conf
-
 link_path="/etc/apt/apt.conf.d/20apt-esm-hook.conf"
 target_path="/etc/kde_neon/20apt-esm-hook-neon.conf"
 
-if [[ -L "$link_path" && "$link_path" -ef "$target_path" ]]; then
+dpkg-divert --rename --remove "$link_path"  || true
+dpkg-divert --no-rename --add --package ubuntu-advantage-tools --divert "${target_path}.distrib" "$target_path"
+
+
+if [ -L "$link_path" ] && [ "$link_path" -ef "$target_path" ] ; then
     return
 else
-    if [[ -L "$link_path" ]]; then
+    if [ -L "$link_path" ] ; then
         rm "$link_path"
     fi
-    ln --force --relative --symbolic "/etc/kde_neon/20apt-esm-hook-neon.conf" "/etc/apt/apt.conf.d/20apt-esm-hook.conf"
+    ln --force --relative --symbolic "$target_path" "$link_path"
 fi
 
 #DEBHELPER#
 
-exit 0
\ No newline at end of file
+exit 0


More information about the Neon-commits mailing list