[kde-linux/kde-linux] mkosi.extra/usr/lib: Handle addons in install-new-flatpaks

Philip Grant <[email protected]>
Newsgroups gmane.comp.kde.cvs
Message-ID <[email protected]>
Git commit 439c5c9642f116a3dde61ad3cfc1f1f71da83fee by Philip Grant.
Committed on 28/07/2026 at 17:30.
Pushed by ngraham into branch 'master'.

Handle addons in install-new-flatpaks

M  +8    -4    mkosi.extra/usr/lib/install-new-flatpaks
M  +4    -1    mkosi.extra/usr/lib/seed-preinstalled-flatpak-list

https://invent.kde.org/kde-linux/kde-linux/-/commit/439c5c9642f116a3dde61ad3cfc1f1f71da83fee

diff --git a/mkosi.extra/usr/lib/install-new-flatpaks b/mkosi.extra/usr/lib/install-new-flatpaks
index 621827d7..4f1c72c7 100755
--- a/mkosi.extra/usr/lib/install-new-flatpaks
+++ b/mkosi.extra/usr/lib/install-new-flatpaks
@@ -5,15 +5,19 @@
 set -eu
 
 FACTORY_DIR="/usr/share/factory/var/lib/flatpak/app"
+FACTORY_RUNTIME_DIR="/usr/share/factory/var/lib/flatpak/runtime"
 REPO_CONFIG="/usr/share/factory/var/lib/flatpak/repo/config"
 DEFAULT_REMOTE="flathub"
-INSTALLED_APPS=$(tr '\n' ' ' <<< $(flatpak list --app --columns=application))
+INSTALLED_APPS=$(tr '\n' ' ' <<< $(flatpak list --columns=application))
 EVER_PREINSTALLED_APPS_FILE="/var/lib/kde-linux/ever-preinstalled-flatpak-apps"
 EVER_PREINSTALLED_APPS=$(tr '\n' ' ' < $EVER_PREINSTALLED_APPS_FILE)
 
-echo "Looking in $FACTORY_DIR for new pre-installed apps that need installing…"
+echo "Looking in $FACTORY_DIR and $FACTORY_RUNTIME_DIR for new pre-installed apps and addons that need installing…"
 
-for APP in "$FACTORY_DIR"/*; do
+APPS=$(ls $FACTORY_DIR)
+ADDONS=$(find $FACTORY_RUNTIME_DIR -maxdepth 1 -type d -name "*.Addon.*" -printf "%f\n")
+
+for APP in $APPS $ADDONS; do
 
     # trim trailing slash
     APP=$(basename "$APP")
@@ -35,7 +39,7 @@ for APP in "$FACTORY_DIR"/*; do
 
     # See if we have a special repo to install it from
     NON_RDNS_NAME="${APP#*.*.}"
-    SPECIAL_APP_REMOTE_NAME=$(rg "$NON_RDNS_NAME" "$REPO_CONFIG" | head -n 1 | cut -d '"' -f 2 || true)
+    SPECIAL_APP_REMOTE_NAME=$(rg "\[remote.*${NON_RDNS_NAME}" "$REPO_CONFIG" | head -n 1 | cut -d '"' -f 2 || true)
     if [[ -n "$SPECIAL_APP_REMOTE_NAME" ]]; then
         echo "$APP needs to be installed from a special repo: $SPECIAL_APP_REMOTE_NAME"
         REMOTE="$SPECIAL_APP_REMOTE_NAME"
diff --git a/mkosi.extra/usr/lib/seed-preinstalled-flatpak-list b/mkosi.extra/usr/lib/seed-preinstalled-flatpak-list
index 8dbf495e..bca62cac 100755
--- a/mkosi.extra/usr/lib/seed-preinstalled-flatpak-list
+++ b/mkosi.extra/usr/lib/seed-preinstalled-flatpak-list
@@ -25,7 +25,10 @@ org.mozilla.firefox
 EOF
 else
     # This is a brand new system. The set of apps that have ever been preinstalled on the system
-    # is exactly those in /usr/share/factory/var/lib/flatpak/app
+    # is exactly those in /usr/share/factory/var/lib/flatpak/app. We also need to identify
+    # addons in /usr/share/factory/var/lib/flatpak/runtime, which we do based on naming convention.
     echo "New KDE Linux install: using preinstalled app list from factory directory"
     ls /usr/share/factory/var/lib/flatpak/app > $EVER_PREINSTALLED_APPS_FILE
+    find /usr/share/factory/var/lib/flatpak/runtime \
+        -maxdepth 1 -type d -name "*.Addon.*" -printf "%f\n" >> $EVER_PREINSTALLED_APPS_FILE
 fi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.