From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nikita Karetnikov Subject: Re: Proposal: prefetch tarballs in a batch Date: Thu, 10 Apr 2014 02:29:26 +0400 Message-ID: <87ha62dtmh.fsf@karetnikov.org> References: <87ha6jkyv8.fsf@karetnikov.org> <877g7epico.fsf@gnu.org> <87wqf8prau.fsf@karetnikov.org> <87ha6blwii.fsf@gnu.org> <87d2gznysk.fsf@karetnikov.org> <87vbuqvpsc.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha1; protocol="application/pgp-signature" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49694) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WY153-0000rF-U1 for guix-devel@gnu.org; Wed, 09 Apr 2014 18:34:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WY153-0007IH-3J for guix-devel@gnu.org; Wed, 09 Apr 2014 18:34:53 -0400 In-Reply-To: <87vbuqvpsc.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Thu, 03 Apr 2014 09:24:35 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable So, in order to add a tarball to the store, one can write: $ ./pre-inst-env guile scheme@(guile-user)> ,use (guix store) (guix packages) (guix derivations) (= gnu packages wget) scheme@(guile-user)> (define s (open-connection)) scheme@(guile-user)> (package-source-derivation s (package-source wget)) $1 =3D # /gnu/store/qz9vm8802v6pi69ci2kgnvfivrkr085r-wget-1.15.tar.xz= 1922cd0> scheme@(guile-user)> (build-derivations s (list $1)) $2 =3D #t scheme@(guile-user)> (file-exists? (derivation->output-path $1)) $3 =3D #t And to get a list of inputs (including the implicit ones): scheme@(guile-user)> ,use (srfi srfi-26) scheme@(guile-user)> (for-each (cut format #t "~a~%" <>) (derivation-inputs= (package-derivation s wget))) #< path: "/gnu/store/divcaakxh5zhgpkih3paxb6znmnpbzhw-gui= le-2.0.11.drv" sub-derivations: ("out")> #< path: "/gnu/store/jf4hzf16akk7bjidpr6im3wamfnr5rpv-wge= t-1.15.tar.xz.drv" sub-derivations: ("out")> #< path: "/gnu/store/rx5kn39gcc0vm4hwr81kcwpxgybx2yay-per= l-5.16.1.drv" sub-derivations: ("out")> [=E2=80=A6] Then =E2=80=98read-derivation=E2=80=99 can be used to =E2=80=9Cturn=E2=80= =9D a type into : scheme@(guile-user)> ,use (srfi srfi-1) scheme@(guile-user)> (call-with-input-file (derivation-input-path (first (d= erivation-inputs (package-derivation s wget)))) read-derivation) $4 =3D # /gnu/store/6mfc9dhala2mnkmc8xjyjzc04mxwym26-guile-2.0.11-debug /= gnu/store/1r1097pd7842mf3fpyhfn86wdrilx73q-guile-2.0.11 1922fa0> I=E2=80=99m planning to do the same for every input. But a couple of thing= s are not clear: 1. Should the recursion stop when =E2=80=98fixed-output-derivation?=E2=80= =99 returns #t? Or should I use a different function for the base case? 2. I=E2=80=99d like to use =E2=80=98package-source-derivation=E2=80=99 (see= above) in order to get a tarball. Is it possible to get a type from ? If not, what are my options? --=-=-= Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJTRcnKAAoJEM+IQzI9IQ38lr0P/AiKyhyVmsGZ8ILTqA2kQyaQ 4Ecqvxxs4V49O5g4MZpwNBSpJSxzn31joPBltKnk9g2sYHMqpNZ3CPEkaAoQqD1c 0+6VZZBBG2Gk91QwHF8mNYLOOCu3uttE3DJPTPNa+FBGCFLawvFYv9+QeoOygxwW rLauhKqaR2srxo2K9kMNPIG8tdvI6enHbudjEgH8+zdFRddpoEUtL7KxGf1aRR0l FJ1+ae5ac8jravXG2wIKi54BF1pym8rjaR9vJc35uuhfRtUoSpQRNjmE6ps9WIlA bmBEqqZ6I0bt2BRbGCn6BzTWxNJy4t4iZHnWIghShjzFaSNd5chFXkyAG8GRmWz2 zzeW2KYyd85khof9K146G8bk34YpZBQ2BQjqPlY0cZEOS8mzHFvgrKmZNxAEk9qM 79GnivkbjBxr2lEK7BK+I9FM4JlMPowgSd/97Ui23b+q9aBL4oFOm8bd46uaGOtI uz8u0qeDyvH/ajyxtXZ7sMsANGQPfR0PcoQBPJYWRTF+tUWi6s/COnGV2ThA3g2w 10gck8RMZLHc1Qj/R9EKC0OsF+Va+wWcf94KVJfZ7FT1CnU740poxMn4LeFO+S5u QNAjMrI/6S0JlZ6uVrkzf2GImhEGUYfAmpA7auxfbYXz1ixaG0sqBN6y+MZtU7ue +snbYrMLTw4lI8FW1TVl =J8Qp -----END PGP SIGNATURE----- --=-=-=--