On Sat, 1 Dec 2018 11:10:54 -0800
John Soo <js...@asu.edu> wrote:

> Hi guix!
> 
> Thanks and please bear with my first ever mailing list post.  I was
> trying to package coin3d
> (https://bitbucket.org/Coin3D/coin/wiki/Home) as it is now under a
> bsd3 license.  The hash of the repo always changes. I think this is
> due to the .hg files not being recursively deleted for the
> subrepositories (https://www.mercurial-scm.org/wiki/Subrepository).
> Does anyone have any insights?
> 

Hi John,

I'm also packaging coin3d :-)

And I stumbled upon that problem too. Ludovic explained me on IRC: The
problem is the metadata directory ".hg": It contains metadata that is
not fixed. For normal hg-repositories, it will be stripped away, but
not recursively for those with sub-repos.

I have a patch that works. I just wasn't sure if it goes to master or
to staging, as it could affect the java-packages as well.

I'm attaching what I have here, will prepare an official patch tonight
or tomorrow.

Björn

PS: With coin3d, I want to add freecad. If that is your intention too,
we should share resources.

From 57167ebf39e3f10c4025cb03893456c7269f98f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bj=C3=B6rn=20H=C3=B6fling?=
 <bjoern.hoefl...@bjoernhoefling.de>
Date: Fri, 23 Nov 2018 18:38:27 +0100
Subject: [PATCH] hg-fetch: Remove .hg directories of sub-repositories.

* guix/build/hg.scm (hg-fetch): Remove all .hg directories recursively.
---
 guix/build/hg.scm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/guix/build/hg.scm b/guix/build/hg.scm
index ea51eb670..9f493f1d6 100644
--- a/guix/build/hg.scm
+++ b/guix/build/hg.scm
@@ -45,8 +45,10 @@ Mercurial changeset identifier.  Return #t on success, #f otherwise."
   ;; The contents of '.hg' vary as a function of the current
   ;; status of the Mercurial repo.  Since we want a fixed
   ;; output, this directory needs to be taken out.
-  (with-directory-excursion directory
-    (delete-file-recursively ".hg"))
+  ;; Since the '.hg' file is also in sub-modules, we have to
+  ;; search for it in all sub-directories.
+  (for-each delete-file-recursively
+            (find-files directory "^\\.hg$" #:directories? #t))
 
   #t)
 
-- 
2.19.1

Attachment: pgpuDifojzRjy.pgp
Description: OpenPGP digital signature

Reply via email to