From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id kFExKdIBNV/ZOAAA0tVLHw (envelope-from ) for ; Thu, 13 Aug 2020 09:03:14 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id QGYlJdIBNV84KwAAB5/wlQ (envelope-from ) for ; Thu, 13 Aug 2020 09:03:14 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 3EEA69400C7 for ; Thu, 13 Aug 2020 09:03:14 +0000 (UTC) Received: from localhost ([::1]:50412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k698j-0001f2-9C for larch@yhetil.org; Thu, 13 Aug 2020 05:03:13 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59252) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1k698Y-0001er-GJ for guix-patches@gnu.org; Thu, 13 Aug 2020 05:03:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:35297) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1k698Y-0003xt-6f for guix-patches@gnu.org; Thu, 13 Aug 2020 05:03:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1k698Y-0002UH-3j for guix-patches@gnu.org; Thu, 13 Aug 2020 05:03:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#42800] [PATCH v2] Add (guix android-repo-download). Resent-From: Mathieu Othacehe Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 13 Aug 2020 09:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42800 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Danny Milosavljevic Cc: 42800@debbugs.gnu.org Received: via spool by 42800-submit@debbugs.gnu.org id=B42800.15973093639181 (code B ref 42800); Thu, 13 Aug 2020 09:03:02 +0000 Received: (at 42800) by debbugs.gnu.org; 13 Aug 2020 09:02:43 +0000 Received: from localhost ([127.0.0.1]:46843 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k698F-0002Ni-9B for submit@debbugs.gnu.org; Thu, 13 Aug 2020 05:02:43 -0400 Received: from eggs.gnu.org ([209.51.188.92]:49072) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1k698D-0002IP-RI for 42800@debbugs.gnu.org; Thu, 13 Aug 2020 05:02:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:50266) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1k6988-0003vt-1U; Thu, 13 Aug 2020 05:02:36 -0400 Received: from [2a01:e0a:19b:d9a0:3107:b202:556:bd51] (port=45858 helo=cervin) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1k6982-0005ib-Nw; Thu, 13 Aug 2020 05:02:34 -0400 From: Mathieu Othacehe References: <20200810153842.2nii3vcihuul6zkp@gravity> <20200812221208.31262-1-dannym@scratchpost.org> Date: Thu, 13 Aug 2020 11:02:28 +0200 In-Reply-To: <20200812221208.31262-1-dannym@scratchpost.org> (Danny Milosavljevic's message of "Thu, 13 Aug 2020 00:12:08 +0200") Message-ID: <878seisyu3.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -3.3 (---) X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Spam-Score: -1.01 X-TUID: gnQAthZ+8Vpg Hello Danny, > +;;; GNU Guix --- Functional package management for GNU > +;;; Copyright =C2=A9 2014, 2015, 2016, 2017, 2018, 2019 Ludovic Court=C3= =A8s > +;;; Copyright =C2=A9 2017 Mathieu Lirzin > +;;; Copyright =C2=A9 2017 Christopher Baines > +;;; Copyright =C2=A9 2020 Jakub K=C4=85dzio=C5=82ka I think you can strip out those copyrights. > + #:use-module (git) ; FIXME Remove Why should it be removed? > + #:use-module (ice-9 match) > + #:use-module (ice-9 vlist) > + #:use-module (srfi srfi-1) > + #:use-module (srfi srfi-34) > + #:use-module (srfi srfi-35) > + #:export (android-repo-reference > + android-repo-reference? > + android-repo-reference-mainfest-url ^ typo =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 > + android-repo-reference-revision > + > + android-repo-fetch > + android-repo-version > + android-repo-file-name)) > + > +;;; Commentary: > +;;; > +;;; An method that fetches a specific commit from an Android Re= po > +;;; repository. > +;;; The repository's manifest (URL and revision) can be specified with a > +;; object. Missing semicolon. > +;;; > +;;; Code: > + > +(define-record-type* > + android-repo-reference make-android-repo-reference > + android-repo-reference? > + (manifest-url android-repo-reference-manifest-url) > + (manifest-revision android-repo-reference-manifest-revision)) > + > +(define (git-repo-package) > + "Return the default git-repo package." > + (let ((distro (resolve-interface '(gnu packages android)))) > + (module-ref distro 'git-repo))) > + > +(define* (android-repo-fetch ref hash-algo hash > + #:optional name > + #:key (system (%current-system)) > + (guile (default-guile)) > + (git-repo (git-repo-package))) > + "Return a fixed-output derivation that fetches REF, an > + object. The output is expected to have recursi= ve > +hash HASH of type HASH-ALGO (a symbol). Use NAME as the file name, or a > +generic name if #f." if unset. > + ;; TODO: Remove. > + (define inputs > + (standard-packages)) Why should it be removed? > + (or (android-repo-fetch (getenv "android-repo manifest-url") > + (getenv "android-repo manifest-revis= ion") Spaces in env variable names are quite unusual. > + (with-directory-excursion directory > + (invoke git-repo-command "init" "-u" manifest-url "-b" manifest-re= vision > + "--depth=3D1") It could also be useful to be able to select the manifest name, using the "-m" switch. > + (invoke git-repo-command "sync" "-c" "--fail-fast" "-v" "-j" "3") Any specific reason to default to 3 threads? Otherwise this looks nice! Thanks, Mathieu