[neon/neon/livecd-rootfs/Neon/release] live-build/auto: Fix unminimize to correctly list packages (LP: #1996489)

Utkarsh Gupta null at kde.org
Mon Jan 22 10:51:41 GMT 2024


Git commit 67dd334c25e7cdaf6ba8542e311ebe937dd51205 by Utkarsh Gupta, on behalf of Utkarsh Gupta.
Committed on 04/10/2023 at 10:18.
Pushed by carlosdem into branch 'Neon/release'.

Fix unminimize to correctly list packages (LP: #1996489)

Prior to dpkg/1.21.0, there was a bug where dpkg -V/--verify
couldn't list all the correct packages correctly but with
that being fix and in archive since Jammy, this works perfectly
but the syntax to report the missing files have changed. It
just prints 'missing' now. With that new format, we can now
fix the regex to simply list the packages.

With this patch, the unminimize script works flawlessly
on a minimized image.

(cherry picked from commit 78a98c683573a1f7983afae54e2f187eeae127c7)

M  +4    -4    live-build/auto/build

https://invent.kde.org/neon/neon/livecd-rootfs/-/commit/67dd334c25e7cdaf6ba8542e311ebe937dd51205

diff --git a/live-build/auto/build b/live-build/auto/build
index 279ce344..8dd8c7d0 100755
--- a/live-build/auto/build
+++ b/live-build/auto/build
@@ -241,18 +241,18 @@ if [ -f /etc/dpkg/dpkg.cfg.d/excludes ] || [ -f /etc/dpkg/dpkg.cfg.d/excludes.dp
     dpkg -S /usr/share/man/ |sed 's|, |\n|g;s|: [^:]*$||' | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
     echo "Reinstalling packages with system documentation in /usr/share/doc/ .."
     # This step processes the packages which still have missing documentation
-    dpkg --verify --verify-format rpm | awk '/..5......   \/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
+    dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/doc/ {print $2}' | sed 's|/[^/]*$||' | sort | uniq \
          | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
     echo "Restoring system translations..."
     # This step processes the packages which still have missing translations
-    dpkg --verify --verify-format rpm | awk '/..5......   \/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort |uniq \
+    dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/locale/ {print $2}' | sed 's|/[^/]*$||' | sort | uniq \
          | xargs dpkg -S | sed 's|, |\n|g;s|: [^:]*$||' | uniq | DEBIAN_FRONTEND=noninteractive xargs apt-get install --reinstall -y
-    if dpkg --verify --verify-format rpm | awk '/..5......   \/usr\/share\/doc/ {exit 1}'; then
+    if dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/doc/ {exit 1}'; then
         echo "Documentation has been restored successfully."
         rm /etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp
     else
         echo "There are still files missing from /usr/share/doc/:"
-        dpkg --verify --verify-format rpm | awk '/..5......   \/usr\/share\/doc/ {print " " $2}'
+        dpkg --verify --verify-format rpm | awk '$2 ~ /\/usr\/share\/doc/ {print " " $2}'
         echo "You may want to try running this script again or you can remove"
         echo "/etc/dpkg/dpkg.cfg.d/excludes.dpkg-tmp and restore the files manually."
     fi



More information about the Neon-commits mailing list