[neon/neon/ubuntu-advantage-tools/Neon/release] debian: fix the traget path for the divert

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


Git commit 53d138f0840ff8bd893f0583e89c034c6d243ea5 by Carlos De Maine.
Committed on 21/06/2026 at 08:57.
Pushed by carlosdem into branch 'Neon/release'.

fix the traget path for the divert

M  +10   -3    debian/ubuntu-advantage-tools.postinst

https://invent.kde.org/neon/neon/ubuntu-advantage-tools/-/commit/53d138f0840ff8bd893f0583e89c034c6d243ea5

diff --git a/debian/ubuntu-advantage-tools.postinst b/debian/ubuntu-advantage-tools.postinst
index e461972..67004c2 100644
--- a/debian/ubuntu-advantage-tools.postinst
+++ b/debian/ubuntu-advantage-tools.postinst
@@ -15,9 +15,16 @@ fi
 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
 
-if [ -L "/etc/apt/apt.conf.d/20apt-esm-hook.conf" -o ! -e "/etc/apt/apt.conf.d/20apt-esm-hook.conf" ]
-then
-    ln --force --relative --symbolic "/etc/kde_neon/20apt-esm-hook.conf" "/etc/apt/apt.conf.d/20apt-esm-hook.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
+    return
+else
+    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"
 fi
 
 #DEBHELPER#



More information about the Neon-commits mailing list