From 366ef4119fe8336a11648e6631f3134e4525a46c Mon Sep 17 00:00:00 2001 From: Cor Legemaat Date: Mon, 30 Mar 2026 14:10:45 +0200 Subject: [PATCH] Fix submodule update. Optimize rust cargo integration. --- ebuild/cli.scm | 1 + ebuild/gen.scm | 30 ++++++++++++++++++++++++------ ebuild/gen/nodejs.scm | 2 ++ ebuild/repo.scm | 11 +++-------- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/ebuild/cli.scm b/ebuild/cli.scm index 3d90906..5cce2af 100644 --- a/ebuild/cli.scm +++ b/ebuild/cli.scm @@ -143,6 +143,7 @@ git repository.") (option-ref options 'ebuild-clean) (option-ref options 'cache-clean)) (begin (display "Warning, ignoring min-interval to clean files!") + (newline) (current-time)) (subtract-duration (current-time) diff --git a/ebuild/gen.scm b/ebuild/gen.scm index b7bb3fb..cbd026c 100644 --- a/ebuild/gen.scm +++ b/ebuild/gen.scm @@ -348,8 +348,14 @@ '())) '())))) +(define-public ebuild-default-post-ebuild + (lambda (ebuild parms) + (system* "ebuild" ebuild "manifest") + '())) + (define-public ebuild-default-post - (lambda (ebuilds parms) + (lambda* (ebuilds parms + #:key (ebuild-callback ebuild-default-post-ebuild)) ;; (display "parms:") (newline) ;; (pretty-print parms) ;; (display "ebuild-created:") (newline) @@ -366,13 +372,23 @@ (out-file ebuild) "\" does not exists!!!"))) (if (string-suffix? ".ebuild" (out-file ebuild)) - (system* "ebuild" (out-file ebuild) "manifest"))))) + (ebuild-callback (out-file ebuild) parms) + '())))) (cond ((null? ebuilds) '()) ((assoc-ref ebuilds 'pkg-files) - (map run-post (assoc-ref ebuilds 'pkgfiles))) + (assoc-set! ebuilds + 'distfiles + (append (append-map run-post + (assoc-ref ebuilds 'pkgfiles)) + (assoc-ref ebuilds 'distfiles)))) ((assoc-ref (car ebuilds) 'pkgfiles) - (map run-post (assoc-ref (car ebuilds) 'pkgfiles)))) - ebuilds))) + (cons (assoc-set! (car ebuilds) + 'distfiles + (append (append-map run-post + (assoc-ref (car ebuilds) + 'pkgfiles)) + (assoc-ref (car ebuilds) 'distfiles))) + (cdr ebuilds))))))) ;;Procedure to generate the required ebuild from the given releases. (define-public ebuild-gen @@ -385,6 +401,7 @@ (template #f) (gen-ebuild-hook ebuild-from-tmpl) (post-hook ebuild-default-post) + (post-ebuild-hook ebuild-default-post-ebuild) ignore-autogen-diff) "" (if (>= (assoc-ref parms 'verbosity) verbosity-notice) @@ -418,6 +435,7 @@ #:tmpl template #:ignore-diff ignore-autogen-diff) ebuild-man))) - (post-hook ebuild-created vars))) + (post-hook ebuild-created vars + #:ebuild-callback post-ebuild-hook))) version-list))) ebuilds))) diff --git a/ebuild/gen/nodejs.scm b/ebuild/gen/nodejs.scm index 2322ca3..6a764cc 100644 --- a/ebuild/gen/nodejs.scm +++ b/ebuild/gen/nodejs.scm @@ -358,6 +358,7 @@ (template #f) (gen-ebuild-hook gen-nodejs-ebuild) (post-hook ebuild-default-post) + (post-ebuild-hook ebuild-default-post-ebuild) ignore-autogen-diff) "" ((@ (ebuild gen) ebuild-gen) @@ -368,4 +369,5 @@ #:template template #:gen-ebuild-hook gen-ebuild-hook #:post-hook post-hook + #:post-ebuild-hook post-ebuild-hook #:ignore-autogen-diff ignore-autogen-diff))) diff --git a/ebuild/repo.scm b/ebuild/repo.scm index 7d2ed56..5a27eed 100644 --- a/ebuild/repo.scm +++ b/ebuild/repo.scm @@ -86,14 +86,9 @@ (define-public repo-update-src (lambda (path) "" - (let ((repo (submodule-lookup (repository-open path) - "autogen")) - (old-cwd (getcwd))) - ;;Not working for updates only init? - ;;(submodule-update repo) - (chdir (string-join (list path "autogen") - file-name-separator-string)) - (system* "/usr/bin/git" "pull") + (let ((old-cwd (getcwd))) + (chdir path) + (system* "/usr/bin/git" "submodule" "update" "--remote" "--merge") (chdir old-cwd)))) ;; TODO guile-git method...