unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: 66491@debbugs.gnu.org
Cc: Simon Tournier <zimon.toutoune@gmail.com>, ludo@gnu.org
Subject: [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json.
Date: Thu, 12 Oct 2023 14:39:31 +0200	[thread overview]
Message-ID: <20231012123931.390137-1-zimon.toutoune@gmail.com> (raw)

This format had been discussed in
<https://gitlab.softwareheritage.org/swh/devel/swh-loader-git/-/issues/4751#note_150607>

* hydra/build-package-metadata.scm (origin->json)[resolve]: Add the keyword
'submodule' when the Git reference is recursive.
---
 hydra/build-package-metadata.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Hi,

This patch helps on SWH side.

        Nevertheless, if it is possible from your side to add a new boolean field in
        the JSON file (submodules ?) indicating that submodules should be fetched to
        compute the hash, this will simplify the processing from our side.

<https://gitlab.softwareheritage.org/swh/devel/swh-loader-git/-/issues/4751#note_150593>

Cheers,
simon


diff --git a/hydra/build-package-metadata.scm b/hydra/build-package-metadata.scm
index 0a75204..9f90c5e 100755
--- a/hydra/build-package-metadata.scm
+++ b/hydra/build-package-metadata.scm
@@ -182,7 +182,10 @@ superseded packages."
                                             "recursive"))))
                '())
          ,@(if (eq? method git-fetch)
-               `(("git_ref" . ,(git-reference-commit uri)))
+               `(("git_ref" . ,(git-reference-commit uri))
+                 ,@(if (git-reference-recursive? uri)
+                       '(("submodule" . "true"))
+                       '()))
                '())
          ,@(if (eq? method svn-fetch)
                `(("svn_revision" . ,(svn-reference-revision uri)))

base-commit: 8f703892a6d549d52eb0374deb11d6af734065d4
-- 
2.38.1





             reply	other threads:[~2023-10-12 12:41 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-12 12:39 Simon Tournier [this message]
2023-10-14 17:23 ` [bug#66491] [maintenance] hydra: build-package-metadata: Add boolean for Git submodules in sources.json Ludovic Courtès
2023-10-17 11:59   ` Simon Tournier
2023-10-17 11:58 ` [bug#66491] [PATCH v2] " Simon Tournier
2023-10-17 12:29   ` bug#66491: [maintenance] " Mathieu Othacehe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231012123931.390137-1-zimon.toutoune@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=66491@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).