From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48731) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d9UYp-0004py-S0 for guix-patches@gnu.org; Sat, 13 May 2017 06:46:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d9UYk-0006ve-Ve for guix-patches@gnu.org; Sat, 13 May 2017 06:46:07 -0400 Received: from debbugs.gnu.org ([208.118.235.43]:39145) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d9UYk-0006vL-Oa for guix-patches@gnu.org; Sat, 13 May 2017 06:46:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d9UYk-0000rV-Bc for guix-patches@gnu.org; Sat, 13 May 2017 06:46:02 -0400 Subject: bug#26772: [PATCH 2/3] import: cran: Robustify cran-package?. Resent-To: guix-patches@gnu.org Resent-Message-ID: References: <20170504100627.27553-1-m.othacehe@gmail.com> <20170504100627.27553-2-m.othacehe@gmail.com> <87bmqx6807.fsf@gnu.org> From: Mathieu Othacehe In-reply-to: <87bmqx6807.fsf@gnu.org> Date: Sat, 13 May 2017 12:44:57 +0200 Message-ID: <87fug9828m.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26772-done@debbugs.gnu.org Hi Ludo ! Thanks for the review. > This can be written as: > > (and start end (substring url …)) Done. > >> @@ -415,6 +417,9 @@ dependencies." >> (define (cran-package? package) >> "Return true if PACKAGE is an R package from CRAN." >> (and (string-prefix? "r-" (package-name package)) >> + ;; Check if the upstream name can be extracted from package uri. >> + (package->upstream-name package) >> + ;; Check if package uri(s) are prefixed by "mirror://cran". >> (match (and=> (package-source package) origin-uri) >> ((? string? uri) >> (string-prefix? "mirror://cran" uri)) > > OK! > > Do you think you could add this specific case (r-minimal) as a test case > for ‘cran-package?’ in tests/cran.scm? That would be awesome. > > Otherwise LGTM, thanks! Sure I pushed this patch with the change above and a new test in tests/cran.scm : --8<---------------cut here---------------start------------->8--- (test-equal "r-mininal is not a cran package" #f ((@@ (guix import cran) cran-package?) r-minimal)) --8<---------------cut here---------------end--------------->8--- I also pushed the two other patches of the serie. Mathieu