GNU bug report logs -
#32094
[PATCH] git: Call 'url-cache-directory' outside 'update-cached-checkout' body.
Previous Next
Reported by: Oleg Pykhalov <go.wigust <at> gmail.com>
Date: Sun, 8 Jul 2018 10:20:02 UTC
Severity: normal
Tags: patch
Done: Oleg Pykhalov <go.wigust <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32094 in the body.
You can then email your comments to 32094 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#32094
; Package
guix-patches
.
(Sun, 08 Jul 2018 10:20:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Oleg Pykhalov <go.wigust <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Sun, 08 Jul 2018 10:20:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
* guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in
'cache-directory' key argument.
---
guix/git.scm | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/guix/git.scm b/guix/git.scm
index 9e89cc006..c5912170b 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -114,7 +114,8 @@ OID (roughly the commit hash) corresponding to REF."
#:key
(ref '(branch . "origin/master"))
(cache-directory
- (%repository-cache-directory)))
+ (url-cache-directory
+ (%repository-cache-directory))))
"Update the cached checkout of URL to REF in CACHE-DIRECTORY. Return two
values: the cache directory name, and the SHA1 commit (a string) corresponding
to REF.
@@ -122,11 +123,10 @@ to REF.
REF is pair whose key is [branch | commit | tag] and value the associated
data, respectively [<branch name> | <sha1> | <tag name>]."
(with-libgit2
- (let* ((cache-dir (url-cache-directory url cache-directory))
- (cache-exists? (openable-repository? cache-dir))
+ (let* ((cache-exists? (openable-repository? cache-directory))
(repository (if cache-exists?
- (repository-open cache-dir)
- (clone* url cache-dir))))
+ (repository-open cache-directory)
+ (clone* url cache-directory))))
;; Only fetch remote if it has not been cloned just before.
(when cache-exists?
(remote-fetch (remote-lookup repository "origin")))
@@ -138,7 +138,7 @@ data, respectively [<branch name> | <sha1> | <tag name>]."
'repository-close!)
(repository-close! repository))
- (values cache-dir (oid->string oid))))))
+ (values cache-directory (oid->string oid))))))
(define* (latest-repository-commit store url
#:key
--
2.18.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#32094
; Package
guix-patches
.
(Sun, 08 Jul 2018 10:25:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 32094 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello Guix,
I want this change to use 'url-cache-directory' with a custom named
cache directory. Without the patch cache directory will be renamed by
'url-cache-directory' procedure.
Thanks,
Oleg.
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#32094
; Package
guix-patches
.
(Mon, 09 Jul 2018 14:44:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 32094 <at> debbugs.gnu.org (full text, mbox):
Hi Oleg,
Oleg Pykhalov <go.wigust <at> gmail.com> skribis:
> * guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in
> 'cache-directory' key argument.
‘latest-repository-commit’ would need to be adjusted accordingly.
Could you do that and make sure ‘guix pull’ still behaves the same as
before?
Thanks,
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#32094
; Package
guix-patches
.
(Tue, 10 Jul 2018 03:40:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 32094 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello Ludovic,
Thank you for review.
ludo <at> gnu.org (Ludovic Courtès) writes:
> Oleg Pykhalov <go.wigust <at> gmail.com> skribis:
>
>> * guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in
>> 'cache-directory' key argument.
>
> ‘latest-repository-commit’ would need to be adjusted accordingly.
>
> Could you do that and make sure ‘guix pull’ still behaves the same as
> before?
When I adjusted ‘latest-repository-commit’ I thought about removing
‘url-cache-directory’ call from ‘update-cached-checkout’ instead of
moving ‘url-cache-directory’ call to ‘cache-directory’ argument.
I'm not sure it's possible to call ‘url-cache-directory’ in argument of
‘update-cached-checkout’, because ‘url-cache-directory’ requires ‘url’
argument which itself is the argument of ‘update-cached-checkout’.
(define* (url-cache-directory url
#:optional (cache-directory
(%repository-cache-directory)))
…)
(define* (update-cached-checkout url
#:key
(ref '(branch . "origin/master"))
(cache-directory
(%repository-cache-directory)))
…)
Here is an updated patch which was successfully tested with ‘guix pull’.
[0001-git-Call-url-cache-directory-outside-update-cached-c.patch (text/x-patch, attachment)]
[signature.asc (application/pgp-signature, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#32094
; Package
guix-patches
.
(Wed, 11 Jul 2018 10:02:02 GMT)
Full text and
rfc822 format available.
Message #17 received at 32094 <at> debbugs.gnu.org (full text, mbox):
Hi Oleg,
Oleg Pykhalov <go.wigust <at> gmail.com> skribis:
> ludo <at> gnu.org (Ludovic Courtès) writes:
>
>> Oleg Pykhalov <go.wigust <at> gmail.com> skribis:
>>
>>> * guix/git.scm (update-cached-checkout): Call 'url-cache-directory' in
>>> 'cache-directory' key argument.
>>
>> ‘latest-repository-commit’ would need to be adjusted accordingly.
>>
>> Could you do that and make sure ‘guix pull’ still behaves the same as
>> before?
>
> When I adjusted ‘latest-repository-commit’ I thought about removing
> ‘url-cache-directory’ call from ‘update-cached-checkout’ instead of
> moving ‘url-cache-directory’ call to ‘cache-directory’ argument.
>
> I'm not sure it's possible to call ‘url-cache-directory’ in argument of
> ‘update-cached-checkout’, because ‘url-cache-directory’ requires ‘url’
> argument which itself is the argument of ‘update-cached-checkout’.
Yes, you can do that:
(define* (update-cached-checkout url
#:key
(ref '(branch . "origin/master"))
(cache-directory
(url-cache-directory
url (%repository-cache-directory))))
…)
(You’d get a warning about ‘url’ being unbound if it didn’t work.)
Could you make this last change? And then I think we’re all set.
Thank you,
Ludo’.
Information forwarded
to
guix-patches <at> gnu.org
:
bug#32094
; Package
guix-patches
.
(Fri, 13 Jul 2018 13:27:01 GMT)
Full text and
rfc822 format available.
Message #20 received at 32094 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello Ludovic,
ludo <at> gnu.org (Ludovic Courtès) writes:
[…]
>> I'm not sure it's possible to call ‘url-cache-directory’ in argument of
>> ‘update-cached-checkout’, because ‘url-cache-directory’ requires ‘url’
>> argument which itself is the argument of ‘update-cached-checkout’.
>
> Yes, you can do that:
>
> (define* (update-cached-checkout url
> #:key
> (ref '(branch . "origin/master"))
> (cache-directory
> (url-cache-directory
> url (%repository-cache-directory))))
> …)
>
> (You’d get a warning about ‘url’ being unbound if it didn’t work.)
Ah, thank you for pointing it out.
> Could you make this last change? And then I think we’re all set.
OK, added. I tested second time successfully with:
--8<---------------cut here---------------start------------->8---
./pre-inst-env env GUIX_PACKAGE_PATH= guix pull
--8<---------------cut here---------------end--------------->8---
Pushed as ffc3fcade3f7d2c7d26b2fe5245902e6407f9c93
Thanks,
Oleg.
[signature.asc (application/pgp-signature, inline)]
Reply sent
to
Oleg Pykhalov <go.wigust <at> gmail.com>
:
You have taken responsibility.
(Fri, 13 Jul 2018 13:27:02 GMT)
Full text and
rfc822 format available.
Notification sent
to
Oleg Pykhalov <go.wigust <at> gmail.com>
:
bug acknowledged by developer.
(Fri, 13 Jul 2018 13:27:02 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 11 Aug 2018 11:24:05 GMT)
Full text and
rfc822 format available.
This bug report was last modified 6 years and 314 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.