diff options
author | Frederick Muriuki Muriithi | 2023-08-14 11:27:43 +0300 |
---|---|---|
committer | Frederick Muriuki Muriithi | 2023-08-14 11:27:43 +0300 |
commit | 2fb99e7b2fae1396bb53c5c231003c780a311941 (patch) | |
tree | 38d3ef7a552f6d3824ea1472d0ee283e1589f3ef | |
parent | afea61acbe5808939a4e147787122386d3e17377 (diff) | |
download | gn-auth-2fb99e7b2fae1396bb53c5c231003c780a311941.tar.gz |
Set version to hard-coded value in checkout
-rw-r--r-- | .guix/modules/gn/packages/gn-auth.scm | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/.guix/modules/gn/packages/gn-auth.scm b/.guix/modules/gn/packages/gn-auth.scm index 0ee7405..cd07d76 100644 --- a/.guix/modules/gn/packages/gn-auth.scm +++ b/.guix/modules/gn/packages/gn-auth.scm @@ -54,22 +54,25 @@ (define (get-latest-version) "Get latest version tag from repository." - (let ((%repo #f) - (%tags (list)) - (%repo-head #f)) - (begin (libgit2-init!) - (set! %repo (repository-open %source-dir)) - (set! %repo-head (reference-target (repository-head %repo))) - (tag-foreach %repo - (lambda (tname tref) - (set! %tags (list (cons tname (tag-lookup %repo tref)))) - 0)) - (libgit2-shutdown!) - (if (zero? (length %tags)) - (string-append "v0.0.0-" (substring (oid->string %repo-head) 0 8)) - (process-version - %repo-head - (list-last (sort-list %tags (lambda (item) (error item))))))))) + (if (git-predicate %source-dir) + (let ((%repo #f) + (%tags (list)) + (%repo-head #f)) + (begin (libgit2-init!) + (set! %repo (repository-open %source-dir)) + (set! %repo-head (reference-target (repository-head %repo))) + (tag-foreach %repo + (lambda (tname tref) + (set! %tags (list (cons tname (tag-lookup %repo tref)))) + 0)) + (libgit2-shutdown!) + (if (zero? (length %tags)) + (string-append "v0.0.0-" (substring (oid->string %repo-head) 0 8)) + (process-version + %repo-head + (list-last (sort-list %tags (lambda (item) (error item)))))))) + ;; Figure out a way to get the version in the checkouts when building + "v0.0.0")) (define vcs-file? (or (git-predicate %source-dir) |