This is an automated email from the git hooks/post-receive script.

hako pushed a commit to branch wip-zig-bootstrap
in repository guix.

The following commit(s) were added to refs/heads/wip-zig-bootstrap by this push:
     new d5b06f4cc6 squash! build-system: zig: Support Zig package manager.
d5b06f4cc6 is described below

commit d5b06f4cc6c88c6a03dac35d734d9c82dec9a87b
Author: Hilton Chain <[email protected]>
AuthorDate: Tue Dec 31 10:23:11 2024 +0800

    squash! build-system: zig: Support Zig package manager.
    
    Change-Id: I2f77092facb53246c96e627a169b6f21603b8b76
---
 guix/build/zig-build-system.scm | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/guix/build/zig-build-system.scm b/guix/build/zig-build-system.scm
index f380b10507..2b80ee89d9 100644
--- a/guix/build/zig-build-system.scm
+++ b/guix/build/zig-build-system.scm
@@ -101,16 +101,18 @@
                 (cut string-split <> #\:))
          '())))
   (define (strip-version input)
-    (let ((name+version (string-split input #\-)))
+    (let* ((name+version (string-split input #\-))
+           (penult (first (take-right name+version 2)))
+           (ultima (last name+version)))
       (string-join
        (drop-right name+version
                    (cond
                     ;; aaa-0.0.0
-                    ((= 3 (length (string-split (last name+version) #\.)))
+                    ((= 3 (length (string-split ultima #\.)))
                      1)
                     ;; bbb-0.0.0-0.0000000-output
-                    ((and (>= (length name+version) 4)
-                          (not (string-contains (last name+version) ".")))
+                    ((and (= 2 (length (string-split penult #\.)))
+                          (= 1 (length (string-split ultima #\.))))
                      3)
                     ;; ccc-0.0.0-output
                     ;; ddd-0.0.0-0.0000000

Reply via email to