[PATCH 2/2] snapcraft.yaml: get version string from apt-cache to account for respins

Aaron Jauregui aaron.jauregui at canonical.com
Fri Mar 7 04:58:53 UTC 2025


Signed-off-by: Aaron Jauregui <aaron.jauregui at canonical.com>
---
 snapcraft.yaml | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/snapcraft.yaml b/snapcraft.yaml
index 8f2f721..4f4770c 100644
--- a/snapcraft.yaml
+++ b/snapcraft.yaml
@@ -129,11 +129,16 @@ parts:
     override-build: |
       craftctl default
       version=$(craftctl get version)
+      objects_ver=$(apt-cache show  linux-objects-nvidia-550-server-"${version%.*}"-generic| grep -e "^Version: " | head -n1 | awk  '{print $2}')
+
+      # make sure version strings match
+      [[ "$objects_ver" == "$version"* ]]
+
 
       # Duplicate libc causing conflicts, deleting to use system's libc
       rm -f -- "$CRAFT_PART_INSTALL/usr/lib/$(uname -m)-linux-gnu/libc.so.6"
-      apt-get download linux-objects-nvidia-550-server-"${version%.*}"-generic="$version" \
-          linux-signatures-nvidia-"${version%.*}"-generic="$version"
+      apt-get download linux-objects-nvidia-550-server-"${version%.*}"-generic="$objects_ver" \
+          linux-signatures-nvidia-"${version%.*}"-generic="$objects_ver"
       for i in *.deb; do dpkg-deb -x "$i" nvidia-objects ;  done
 
       mkdir -p "$CRAFT_PART_INSTALL"/bits
-- 
2.43.0




More information about the kernel-team mailing list