From patchwork Thu Nov 28 00:13:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Becze X-Patchwork-Id: 16257 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 135FC177DC; Thu, 28 Nov 2019 00:14:17 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id D3DA7177D9 for ; Thu, 28 Nov 2019 00:14:16 +0000 (GMT) Received: from localhost ([::1]:44284 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia7Rn-0005LJ-8Z for patchwork@mira.cbaines.net; Wed, 27 Nov 2019 19:14:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59565) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia7Rf-0005Ku-3n for guix-patches@gnu.org; Wed, 27 Nov 2019 19:14:08 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ia7Rd-00073o-2A for guix-patches@gnu.org; Wed, 27 Nov 2019 19:14:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:50435) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ia7Ra-00071U-AE for guix-patches@gnu.org; Wed, 27 Nov 2019 19:14:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ia7Ra-0005DZ-4R for guix-patches@gnu.org; Wed, 27 Nov 2019 19:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#38408] [PATCH 0/3] (WIP) Semantic version aware recusive importer for crates Resent-From: Martin Becze Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Nov 2019 00:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 38408 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 38408@debbugs.gnu.org Cc: efraim@flashner.co.il, Martin Becze X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.157490003420022 (code B ref -1); Thu, 28 Nov 2019 00:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Nov 2019 00:13:54 +0000 Received: from localhost ([127.0.0.1]:56403 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia7RS-0005Cs-2F for submit@debbugs.gnu.org; Wed, 27 Nov 2019 19:13:54 -0500 Received: from lists.gnu.org ([209.51.188.17]:39084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ia7RQ-0005Ck-Rj for submit@debbugs.gnu.org; Wed, 27 Nov 2019 19:13:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:59103) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ia7RP-0005KX-LU for guix-patches@gnu.org; Wed, 27 Nov 2019 19:13:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ia7RO-0006nY-AF for guix-patches@gnu.org; Wed, 27 Nov 2019 19:13:51 -0500 Received: from mx1.riseup.net ([198.252.153.129]:45718) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ia7RK-0006hm-6h for guix-patches@gnu.org; Wed, 27 Nov 2019 19:13:48 -0500 Received: from capuchin.riseup.net (capuchin-pn.riseup.net [10.0.1.176]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (Client CN "*.riseup.net", Issuer "Sectigo RSA Domain Validation Secure Server CA" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 47NdQw1pZfzFc8p; Wed, 27 Nov 2019 16:13:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1574900024; bh=XuOcfW9l2u3JO6izUIsKgWNJJa5uk+XIPgdZQ1XmV4Y=; h=From:To:Cc:Subject:Date:From; b=Swf/vrxLf8aYCN9Ris64tEu+GmiAWA65JYjPEhYvb5Y5KZpTKtcxpyRPnT7+nt1Jj rut3OMzWQEqRRLyqtGTt9Xe7cQBMXvl+66IOVpF4MYRj6OmT0nnP8zJrmwvkdzEb9w Bul8Hrdarm4upJ/UN/0W5VAa01Lpiq4MVJTC0q9c= X-Riseup-User-ID: 72796163DC9A36A43D076D262C7C74AE50807E2924CDA0EA125994C32C1FB1F0 Received: from [127.0.0.1] (localhost [127.0.0.1]) by capuchin.riseup.net (Postfix) with ESMTPSA id 47NdQv2rZdz8sx2; Wed, 27 Nov 2019 16:13:43 -0800 (PST) From: Martin Becze Date: Wed, 27 Nov 2019 19:13:11 -0500 Message-Id: MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches This patch add a new recusive importer (recusive-import-semver) which uses semantic versioning to find the correct version of dependencies. This procedure is then used by the crate importer. Since quite a few langague pms use semantic versioning I hope that other importers can also use it. This patch has one problem that I'm aware of. recusive-import-semver relies on guile-semver. But how do I make it so that it is installed by default? Or altenativly how can I check a guile module exists or not, so that I can promt the user to install it? Thanks, Martin Becze Martin Becze (3): gnu: added new function, find-packages-by-name*/direct gnu: added new procedure, recusive-import-semver Rewrote some of guix/import/crate.scm to use recursive-import-semver and updated script and test. gnu/packages.scm | 41 ++++++++ guix/import/crate.scm | 165 +++++++++++++++++-------------- guix/import/utils.scm | 181 ++++++++++++++++++++++++++++++++-- guix/scripts/import/crate.scm | 9 +- tests/crate.scm | 2 +- tests/import-utils.scm | 162 ++++++++++++++++++++++++++++++ tests/packages.scm | 13 +++ 7 files changed, 481 insertions(+), 92 deletions(-)