From 807c3137361a75fd8a0308aa2977e980e181a77f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Thu, 26 Mar 2026 12:46:46 +0100 Subject: [PATCH 1/2] fix: allow UpdateOSLibs to handle packages without an MD5Sum MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Niccolò Fei --- dagger/maintenance/updatelibs.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/dagger/maintenance/updatelibs.go b/dagger/maintenance/updatelibs.go index 940bd340..48634da9 100644 --- a/dagger/maintenance/updatelibs.go +++ b/dagger/maintenance/updatelibs.go @@ -10,8 +10,8 @@ import ( ) // libsRegex matches library dependencies from apt-get output -// Format: library-name MD5Sum:checksum -var libsRegex = regexp.MustCompile(`(?m)^.*\s(lib\S*).*(MD5Sum:.*)$`) +// Format: 'url' library-name size [MD5Sum:checksum] +var libsRegex = regexp.MustCompile(`(?m)^.*\s(lib\S+\.deb)\s+\d+\s*(MD5Sum:\S+)?`) func updateOSLibsOnTarget( ctx context.Context, @@ -43,8 +43,12 @@ func updateOSLibsOnTarget( var result string for _, m := range matches { - if len(m) >= 3 { - result += m[1] + " " + m[2] + "\n" + if len(m) >= 2 { + line := m[1] + if len(m) >= 3 && m[2] != "" { + line += " " + m[2] + } + result += line + "\n" } } From a70cca3ca04f3ca4b7eddfe9d272847907bf1cc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Fei?= Date: Wed, 1 Apr 2026 16:08:50 +0200 Subject: [PATCH 2/2] chore: simplify how result lines are constructed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Gabriele Fedi Signed-off-by: Niccolò Fei --- dagger/maintenance/updatelibs.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/dagger/maintenance/updatelibs.go b/dagger/maintenance/updatelibs.go index 48634da9..292e8643 100644 --- a/dagger/maintenance/updatelibs.go +++ b/dagger/maintenance/updatelibs.go @@ -5,6 +5,7 @@ import ( "fmt" "path" "regexp" + "strings" "dagger/maintenance/internal/dagger" ) @@ -43,13 +44,8 @@ func updateOSLibsOnTarget( var result string for _, m := range matches { - if len(m) >= 2 { - line := m[1] - if len(m) >= 3 && m[2] != "" { - line += " " + m[2] - } - result += line + "\n" - } + line := strings.Join(m[1:], " ") + result += strings.TrimSuffix(line, " ") + "\n" } if result == "" {