From patchwork Wed Feb 9 13:24:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37138 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 D302327BBEA; Wed, 9 Feb 2022 13:39:48 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 7803027BBE9 for ; Wed, 9 Feb 2022 13:39:48 +0000 (GMT) Received: from localhost ([::1]:51336 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnCD-0005Gt-Rz for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 08:39:46 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmy9-0004dd-T4 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56277) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmxx-0004E3-Ot for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmxx-00076E-Ly; Wed, 09 Feb 2022 08:25:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 1/7] upstream: Sort list of updaters. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441305127186 (code B ref 53818); Wed, 09 Feb 2022 13:25:01 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:24:11 +0000 Received: from localhost ([127.0.0.1]:50168 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmx8-00074P-MV for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:10 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44826 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmx7-000749-Oe for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:10 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413044; bh=uePA9eU3rVfA9D2Eoe6XklIGhmYCp8Bpq3h/n9/hOOk=; h=From:To:Subject:In-Reply-To:References:Date; b=piFvX2WkUE1M1DgHLzOs8GXc/OEfIFmX9GG+w2aXe2yxqy+styolguiqbm2M2ZoS7 aEvWJeobXGepvFnKylduL7f+/LD4viEXKx48RlhGaKYBmaBf9jFEdrk7Th2NuBM/5+ OhcRzI3qAbJdlcyJZXukv63b/O19QJZMoIIkfPQE= In-Reply-To: References: Message-Id: <0f119f2aaf1f3d492bdf733136c310a9f1a6d85d.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:24:03 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 The order determines which updater gets used first when running ‘guix refresh’ on a package. We want the most generic updaters to be last since they usually don’t provide as much or accurate information as language-specific updaters. * guix/upstream.scm (sort-updaters): New procedure. (%updaters): Use it. --- guix/upstream.scm | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/guix/upstream.scm b/guix/upstream.scm index 6666803a92..d5faf9d3ee 100644 --- a/guix/upstream.scm +++ b/guix/upstream.scm @@ -250,14 +250,31 @@ (define (importer-modules) %load-path) #:warn warn-about-load-error))) +(define (sort-updaters updaters) + "Sort UPDATERS by putting the more generic ones last." + (define (genericity updater) + (cond + ((equal? 'repology (upstream-updater-name updater)) + 2) + ((string-prefix? "generic-" + (symbol->string (upstream-updater-name updater))) + 1) + (else 0))) + + (define (less a b) + (<= (genericity a) (genericity b))) + + (stable-sort updaters less)) + (define %updaters ;; The list of publically-known updaters. - (delay (fold-module-public-variables (lambda (obj result) - (if (upstream-updater? obj) - (cons obj result) - result)) - '() - (importer-modules)))) + (delay (sort-updaters + (fold-module-public-variables (lambda (obj result) + (if (upstream-updater? obj) + (cons obj result) + result)) + '() + (importer-modules))))) ;; Tests need to mock this variable so mark it as "non-declarative". (set! %updaters %updaters) From patchwork Wed Feb 9 13:24:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37139 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 3FFF327BBEA; Wed, 9 Feb 2022 13:42:22 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id D2EC927BBE9 for ; Wed, 9 Feb 2022 13:42:21 +0000 (GMT) Received: from localhost ([::1]:52166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnEi-0005vm-SG for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 08:42:21 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56022) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmy9-0004di-TO for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56281) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmxy-0004EI-O7 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmxy-00076N-4k; Wed, 09 Feb 2022 08:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 2/7] http-client: Make 'http-fetch/cached' take '#:headers' argument. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441307427228 (code B ref 53818); Wed, 09 Feb 2022 13:25:02 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:24:34 +0000 Received: from localhost ([127.0.0.1]:50171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmxV-000755-Uf for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:34 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44848 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmxT-00074p-T1 for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:33 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413066; bh=akL6Y2/X0FEbcEKilz3Py/WZu638Uz61mmUyiLjh3JI=; h=From:To:Subject:In-Reply-To:References:Date; b=Dt5VdwuUzo6NSlpEs+tX+W5Q+gBzb9YIk5rBf74CodrO16s/bgB6nDCuUOFwAA8KH lz0VBuVC0xBFBxyR8UcM4iWuch4cLNdk8k7EIhHwsmXja+Hy6+bE0i43pUVIyS/xsb MHYuaHDo7txOjrWiwGBwgWNoh9GJ2z9Zv66xqfxc= In-Reply-To: References: Message-Id: <0ad40732008ce4a9214df154d431741c90e0f128.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:24:25 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * guix/http-client.scm (http-fetch/cached): Take ‘#:headers’ keyword argument. --- guix/http-client.scm | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/guix/http-client.scm b/guix/http-client.scm index 10bc278023..058f09852f 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015 Mark H Weaver ;;; Copyright © 2012, 2015 Free Software Foundation, Inc. ;;; Copyright © 2017 Tobias Geerinckx-Rice +;;; Copyright © 2022 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -283,9 +284,11 @@ (define* (http-fetch/cached uri #:key (ttl (%http-cache-ttl)) text? (write-cache dump-port) (cache-miss (const #t)) (log-port (current-error-port)) - (timeout 10)) + (timeout 10) + (headers '((user-agent . "GNU Guile")))) "Like 'http-fetch', return an input port, but cache its contents in -~/.cache/guix. The cache remains valid for TTL seconds. +~/.cache/guix. The cache remains valid for TTL seconds. HEADERS is an alist +of extra HTTP headers. The cache time will automatically be added to HEADERS, so there is no need to specify it. Call WRITE-CACHE with the HTTP input port and the cache output port to write the data to cache. Call CACHE-MISS with URI just before fetching data from @@ -300,8 +303,8 @@ (define cache-time (and cache-port (stat:mtime (stat cache-port)))) - (define headers - `((user-agent . "GNU Guile") + (define headers* + `(,@headers ,@(if cache-time `((if-modified-since . ,(time-utc->date (make-time time-utc 0 cache-time)))) @@ -316,7 +319,7 @@ (define headers (raise c)))) (let ((port (http-fetch uri #:text? text? #:log-port log-port - #:headers headers #:timeout timeout))) + #:headers headers* #:timeout timeout))) (cache-miss uri) (mkdir-p (dirname file)) (when cache-port From patchwork Wed Feb 9 13:24:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37140 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 0173F27BBEA; Wed, 9 Feb 2022 13:42:25 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id C411227BBE9 for ; Wed, 9 Feb 2022 13:42:24 +0000 (GMT) Received: from localhost ([::1]:52172 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnEl-0005w0-Od for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 08:42:23 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56018) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmy9-0004df-TS for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:13 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56279) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmxy-0004EH-Nt for guix-patches@gnu.org; Wed, 09 Feb 2022 08:25:11 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmxy-00076U-JD; Wed, 09 Feb 2022 08:25:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 3/7] http-client: 'http-fetch/cached' accepts a string or a . Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:25:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441308327251 (code B ref 53818); Wed, 09 Feb 2022 13:25:02 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:24:43 +0000 Received: from localhost ([127.0.0.1]:50174 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmxf-00075T-7v for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:43 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44858 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmxd-00075E-JL for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:24:41 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413076; bh=H8jADRyKH0fzq5VeA6Xl0rjl0GKGDAUsZO7ia0nN2ho=; h=From:To:Subject:In-Reply-To:References:Date; b=jQePeU76TZV3KTL2/3Ju/7y6F2mCKv9yGgRdadinjXY62d4dlh6BFJME+MwE1B/vt zTml6ypXPuQuEVtS5I1wpNkHoEdXaHu7eNy3OHd+Z5wodHbx4TFvjZQVpDwdxbyILY a+wpf8c8oJbogF/xXnT8QorGeCPu/Csxr/fn+kxo= In-Reply-To: References: Message-Id: <7be659f7ef029ee77df683f3f522f9f51fe40ba5.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:24:35 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 is consistent with the 'http-fetch' procedure. * guix/http-client.scm (http-fetch/cached): The 'uri' argument can be a string or a record. --- guix/http-client.scm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/guix/http-client.scm b/guix/http-client.scm index 058f09852f..08efdd5e47 100644 --- a/guix/http-client.scm +++ b/guix/http-client.scm @@ -297,7 +297,10 @@ (define* (http-fetch/cached uri #:key (ttl (%http-cache-ttl)) text? TIMEOUT specifies the timeout in seconds for connection establishment. Write information about redirects to LOG-PORT." - (let ((file (cache-file-for-uri uri))) + (let* ((uri (if (string? uri) + (string->uri uri) + uri)) + (file (cache-file-for-uri uri))) (define (update-cache cache-port) (define cache-time (and cache-port From patchwork Wed Feb 9 13:25:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37142 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 89CCE27BBEA; Wed, 9 Feb 2022 14:02:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 2C2C227BBE9 for ; Wed, 9 Feb 2022 14:02:19 +0000 (GMT) Received: from localhost ([::1]:35970 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnXx-0007uo-4N for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 09:02:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56322) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmyz-00059Q-4R for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56302) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmyw-0004h5-14 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmyv-00079C-Uh; Wed, 09 Feb 2022 08:26:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 4/7] import: json: Make 'json-fetch' take '#:http-fetch' argument. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:26:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441311027352 (code B ref 53818); Wed, 09 Feb 2022 13:26:01 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:25:10 +0000 Received: from localhost ([127.0.0.1]:50183 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmy5-000774-F2 for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:09 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44870 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmy3-00076S-FF for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:08 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413101; bh=5/6RV8SFyjdKwV6zG391UYkeD0BSMa6Utv9ZFGu2arw=; h=From:To:Subject:In-Reply-To:References:Date; b=sMtleTb2bjyqa0UH/yq2Ag5Vob+Xz5TVDVLN0I5VPmQi2g7gAVti4XYpzH1XNl49J T0uK7ThTkckG9IovAMb+NQ07KwZuOobiXyUlhOkDDGyAJUr5BYPEgR7m3G/SYKJ8yZ gu0OChwcXNW2YexxG3BvgLfQT9zAQvjZ3ylZ7qPc= In-Reply-To: References: Message-Id: Date: Wed, 09 Feb 2022 14:25:01 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 will let users of the 'json-fetch' procedure use a custom procedure for fetching the URL, e.g., 'http-fetch/cached'. * json.scm (json-fetch): Add ‘#:http-fetch’ keyword argument. Suggested-by: Maxime Devos --- guix/import/json.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/guix/import/json.scm b/guix/import/json.scm index 0c98bb25b8..de7ed60e8d 100644 --- a/guix/import/json.scm +++ b/guix/import/json.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2015, 2016 Eric Bavier ;;; Copyright © 2018, 2019 Ludovic Courtès ;;; Copyright © 2020 Ricardo Wurmus +;;; Copyright © 2022 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,11 +38,13 @@ (define-module (guix import json) (define* (json-fetch url ;; Note: many websites returns 403 if we omit a ;; 'User-Agent' header. - #:key (headers `((user-agent . "GNU Guile") - (Accept . "application/json")))) + #:key + (headers `((user-agent . "GNU Guile") + (Accept . "application/json"))) + (http-fetch http-fetch)) "Return a representation of the JSON resource URL (a list or hash table), or #f if URL returns 403 or 404. HEADERS is a list of HTTP headers to pass in -the query." +the query. HTTP-FETCH is the procedure that is used to fetch the JSON data from URL. It should take the URL as an argument and HEADERS as a keyword argument, and return an input port for the JSON data." (guard (c ((and (http-get-error? c) (let ((error (http-get-error-code c))) (or (= 403 error) From patchwork Wed Feb 9 13:25:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37137 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 564D627BBEA; Wed, 9 Feb 2022 13:36:26 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 51CC027BBE9 for ; Wed, 9 Feb 2022 13:36:25 +0000 (GMT) Received: from localhost ([::1]:49302 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHn8y-0003tS-B3 for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 08:36:24 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56324) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmyz-00059R-4V for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56304) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmyw-0004hD-DV for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmyw-00079L-B6; Wed, 09 Feb 2022 08:26:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 5/7] import: Add 'repology' updater. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441312627387 (code B ref 53818); Wed, 09 Feb 2022 13:26:02 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:25:26 +0000 Received: from localhost ([127.0.0.1]:50187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmyI-00077Z-1F for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:26 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44880 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmyG-00077J-5n for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:21 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413113; bh=QJPtJwE9OIg++PiCiG6RNGbOTMFbkV9On/88KoOPwYk=; h=From:To:Subject:In-Reply-To:References:Date; b=Od2NqCRJsnDuAOOVNtc6UkS14BlrtgucrnL0jQJ5tGq5AGj2O2VVNScxLZP0toQhu YVUXvhatGK+HdipY+Kv3tRUknMRPVEt88qkn/e0Og/iAr6UR1NIr4I+A7uD2P6B+7Y CmZsLyoehp/qd4b2/cEBVc0OODfeQwF5jYBZFUeA= In-Reply-To: References: Message-Id: <452009a171299629965ab860eac2a1fdbe8a3554.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:25:13 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * guix/import/repology.scm * tests/import-repology.scm: New files. * Makefile.am (MODULES): Register them. * doc/guix.texi (Invoking guix refresh): Document it. --- Makefile.am | 3 + doc/guix.texi | 8 ++ guix/import/repology.scm | 249 ++++++++++++++++++++++++++++++++++++++ tests/import-repology.scm | 150 +++++++++++++++++++++++ 4 files changed, 410 insertions(+) create mode 100644 guix/import/repology.scm create mode 100644 tests/import-repology.scm diff --git a/Makefile.am b/Makefile.am index 7463606d20..6792917b59 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,6 +16,7 @@ # Copyright © 2019 Efraim Flashner # Copyright © 2021 Chris Marusich # Copyright © 2021 Andrew Tropin +# Copyright © 2022 Xinglu Chen # # This file is part of GNU Guix. # @@ -271,6 +272,7 @@ MODULES = \ guix/import/opam.scm \ guix/import/print.scm \ guix/import/pypi.scm \ + guix/import/repology.scm \ guix/import/stackage.scm \ guix/import/texlive.scm \ guix/import/utils.scm \ @@ -488,6 +490,7 @@ SCM_TESTS = \ tests/home-import.scm \ tests/import-git.scm \ tests/import-github.scm \ + tests/import-repology.scm \ tests/import-utils.scm \ tests/inferior.scm \ tests/lint.scm \ diff --git a/doc/guix.texi b/doc/guix.texi index 583ba1c61d..2d7612b09a 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12932,6 +12932,14 @@ (release-tag-version-delimiter . ":")))) @end lisp +@item repology +an updater that scans @uref{https://repology.org, Repology}, a website +that tracks packages on various package repositories, for updates. + +The name of a package in Guix is not always that same as the name on +Repology. In most cases, the updater will be able to guess the name +correctly. If it doesn’t, users can set the @code{repology-name} +package property. @end table diff --git a/guix/import/repology.scm b/guix/import/repology.scm new file mode 100644 index 0000000000..87fbd2ee6f --- /dev/null +++ b/guix/import/repology.scm @@ -0,0 +1,249 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Xinglu Chen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (guix import repology) + #:use-module (guix diagnostics) + #:use-module (guix git-download) + #:use-module (guix http-client) + #:use-module (guix i18n) + #:use-module (guix import json) + #:use-module (guix import utils) + #:use-module (guix memoization) + #:use-module (guix packages) + #:use-module (guix upstream) + #:use-module (guix utils) + #:use-module (ice-9 match) + #:use-module (json) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-2) + #:use-module (srfi srfi-26) + #:use-module (srfi srfi-43) + #:export (%repology-url + repology-fetch-info + repology-latest-release + %repology-updater)) + +;;; Commentary: +;;; +;;; This module provides an updater which scans Repology, a site that monitors +;;; several package repolsitories, for updates. This means that if any other +;;; package repository has a version of a package that is newer than the +;;; version in Guix, the package should be able to be updated. The updater +;;; should in theory work for all packages in Guix, but the names of some +;;; packages on Repology don't match the name in Guix. The 'repology-name' +;;; package property can be used to fix this. +;;; +;;; Guix already has many different updaters for language-specific packages, +;;; and these typically provide more accurate data, e.g., input changes, +;;; signature URLs. The Repology updater should really be treated as a last +;;; resort for those packages that don't have any other updater to rely on. +;;; +;;; See for the API. +;;; +;;; Code: + +(define %repology-url + "https://repology.org/api/v1/project") + +(define* (package-name->repology-name name #:key (attempt 1)) + "Convert NAME, the name of a Guix package, to the name of the package on +Repology. It doesn't always guess the correct name on the first attempt, so +on the second attempt it will try to guess another name." + (match attempt + (1 (cond + ((string-prefix? "ghc-" name) + (string-append "haskell:" + (string-drop name (string-length "ghc-")))) + ((string-prefix? "ocaml-" name) + (string-append "ocaml:" + (string-drop name (string-length "ocaml-")))) + ((string-prefix? "perl-" name) + (string-append "perl:" + (string-drop name (string-length "perl-")))) + ((string-prefix? "emacs-" name) + (string-append "emacs:" + (string-drop name (string-length "emacs-")))) + ((string-prefix? "go-" name) + (string-append "go:" + (string-drop name (string-length "go-")))) + ((string-prefix? "rust-" name) + (string-append "rust:" + (string-drop name (string-length "rust-")))) + ((string-prefix? "lua-" name) + (string-append "lua:" + (string-drop name (string-length "lua-")))) + ((string-prefix? "node-" name) + (string-append "node:" + (string-drop name (string-length "node-")))) + ((string-prefix? "python-" name) + (string-append "python:" + (string-drop name (string-length "python-")))) + ((string-prefix? "java-" name) + (string-append "java:" + (string-drop name (string-length "java-")))) + ((string-prefix? "r-" name) + (string-append "r:" + (string-drop name (string-length "r-")))) + ((string-prefix? "ruby-" name) + (string-append "ruby:" + (string-drop name (string-length "ruby-")))) + ((string-prefix? "xf86-" name) + (string-append "xdrv:" + (string-drop name (string-length "xf86-")))) + ((string-prefix? "font-" name) + (string-append "fonts:" + (string-drop name (string-length "font-")))) + ((string-prefix? "trytond-" name) + (string-append "tryton:" + (string-drop name (string-length "trytond-")))) + ((string-prefix? "python-trytond-" name) + (string-append "tryton:" + (string-drop name (string-length "python-trytond-")))) + ((string-suffix? "-minimal" name) + (string-drop-right name (string-length "-minimal"))) + (else name))) + (2 (cond + ((string-prefix? "xf86-video" name) + (string-append "xdrv:" + (string-drop name (string-length "xf86-video-")))) + ((string-prefix? "xf86-input" name) + (string-append "xdrv:" + (string-drop name (string-length "xf86-input-")))) + ((string-prefix? "minetest-" name) + (string-append "minetest-mod-" + (string-drop name (string-length "minetest-")))) + ((string-prefix? "lib" name) + (string-drop name (string-length "lib"))) + ((string-prefix? "vim-" name) + (string-append "vim:" + (string-drop name (string-length "vim-")))) + (else name))))) + + +;;; JSON mappings. + +(define-json-mapping make-repology-package + repology-package? + json->repology-package + (repository repology-package-repository "repo") + (src-name repology-package-src-name "srcname") + (binary-name repology-package-binary-name "binname") + (visible-name repology-package-visible-name "visiblename") + (version repology-package-version) + (original-version repology-package-original-version "origversion") + (status repology-package-status) + (summary repology-package-summary) + (categories repology-package-categories) + (licenses repology-package-licenses) + (maintainers repology-package-maintainers)) + + +;;; Updater. + +(define repology-fetch-info + (memoize + (lambda (package) + "Fetch information about PACKAGE using the Repology API." + (define (name->info name) + (let ((url (string-append %repology-url "/" name))) + (and=> (json-fetch url #:http-fetch http-fetch/cached) + (lambda (url) + (vector-map (lambda (a b) + (json->repology-package b)) + url))))) + + (let* ((name (or (assoc-ref (package-properties package) + 'repology-name) + (package-name->repology-name (package-name package)))) + (info (name->info name))) + (if (and info (not (vector-empty? info))) + info + (let ((info (name->info (package-name->repology-name + (package-name package) + #:attempt 2)))) + (if (and info (not (vector-empty? info))) + info + (begin + (warning (G_ "package not found on Repology: ~a\n") + (package-name package)) + #f)))))))) + +(define (update-version string old-version new-version) + "Replace OLD-VERSION in STRING with NEW-VERSION. This assumes that STRING +contains OLD-VERSION verbatim; if it doesn't, #f is returned." + (match (factorize-uri string old-version) + ((? string?) #f) + ((factorized ...) + (apply string-append + (map (lambda (component) + (match component + ('version new-version) + ((? string?) component))) + factorized))))) + +(define (package-source-urls package version) + "Return a list of URLs for PACKAGE at VERSION. If no URL was successfully constructed, return #f." + (and-let* ((old-version (package-version package)) + (source (package-source package))) + ;; XXX: (guix upstream) only supports tarballs and Git repos for now. + (match (origin-uri source) + ((? git-reference? reference) + (and-let* ((old-commit (git-reference-commit reference)) + (new-commit (if (string=? old-version old-commit) + version + (update-version old-commit + old-version + version)))) + (git-reference + (inherit reference) + (commit new-commit)))) + ((? string? url) + (list (update-version url old-version version))) + ((? list? urls) + (map (cut update-version <> old-version version) urls)) + (_ #f)))) + +(define (latest-version? repology-package) + "Return the latest released version of REPOLOGY-PACKAGE. If none are found, +return #f." + (and (or (equal? "newest" (repology-package-status repology-package)) + (equal? "unique" (repology-package-status repology-package))) + (repology-package-version repology-package))) + +;; XXX: We use 'pkg' because 'package' will clash with the 'package' field of +;; 'upstream-source'. +(define (repology-latest-release pkg) + "Return the latest release of the PKG on Repology named NAME." + (and-let* ((packages (repology-fetch-info pkg)) + (versions (filter-map latest-version? + (vector->list packages))) + (latest-version (and (pair? versions) (car versions)))) + ;; TODO: set 'signature-urls'. + (upstream-source + (package (package-name pkg)) + (version latest-version) + (urls (package-source-urls pkg latest-version))))) + +(define %repology-updater + (upstream-updater + (name 'repology) + (description "Updater for packages on Repology") + (pred (const #t)) + (latest repology-latest-release))) + +;;; repology.scm ends here diff --git a/tests/import-repology.scm b/tests/import-repology.scm new file mode 100644 index 0000000000..4da01a4106 --- /dev/null +++ b/tests/import-repology.scm @@ -0,0 +1,150 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2022 Xinglu Chen +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (test-import-repology) + #:use-module (guix download) + #:use-module (guix git-download) + #:use-module (guix import repology) + #:use-module (guix memoization) + #:use-module (guix packages) + #:use-module (guix tests) + #:use-module (guix upstream) + #:use-module (json) + #:use-module (srfi srfi-64)) + +(test-begin "repology") + +(define package-using-git-repository + (dummy-package + "foo" + (version "1.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://git.example.org/foo") + (commit "1.0"))) + (sha256 #f))))) + +(define package-using-tarball + (dummy-package + "foo" + (version "1.0") + (source + (origin + (method git-fetch) + (uri (string-append "https://example.org/foo-" version ".tar.gz")) + (sha256 #f))))) + +(define package-using-tarball-multiple-urls + (dummy-package + "foo" + (version "1.0") + (source + (origin + (method git-fetch) + (uri (list (string-append "https://example.org/foo-" + version ".tar.gz") + (string-append "https://mirror.example.org/foo-" + version ".tar.gz"))) + (sha256 #f))))) + +(define %test-json +"[ + { + \"repo\": \"aur\", + \"srcname\": \"foo\", + \"binname\": \"foo\", + \"visiblename\": \"foo\", + \"version\": \"1.0.r25.gb86405a\", + \"maintainers\": [ + \"bob@aur\" + ], + \"licenses\": [ + \"LGPL3+\" + ], + \"summary\": \"foo bar\" + \"status\": \"rolling\", + \"origversion\": \"1.0.r25.gb86405a-1\" + }, + { + \"repo\": \"gnuguix\", + \"srcname\": \"foo\", + \"binname\": \"foo\", + \"visiblename\": \"foo\", + \"version\": \"1.0\", + \"summary\": \"foo bar\", + \"status\": \"outdated\", + \"origversion\": null + }, + { + \"repo\": \"nix_unstable\", + \"name\": \"foo\", + \"visiblename\": \"foo\", + \"version\": \"2.0\", + \"maintainers\": [ + \"bob@example.org\" + ], + \"licenses\": [ + \"LGPL-3.0-or-later\" + ], + \"summary\": \"foo bar\", + \"status\": \"newest\", + \"origversion\": null + } +]") + +(define (latest-release package) + (invalidate-memoization! repology-fetch-info) + (mock ((guix import json) json-fetch + (lambda* (url #:key http-fetch) + (if (string=? url + (string-append %repology-url "/foo")) + (json-string->scm %test-json) + (error "the URL is not correct")))) + (repology-latest-release package))) + +(test-equal "package using Git repo: version" + "2.0" + (upstream-source-version + (latest-release package-using-git-repository))) + +(test-equal "package using Git repo: git-reference" + (git-reference + (url "https://git.example.org/foo") + (commit "2.0")) + (upstream-source-urls + (latest-release package-using-git-repository))) + +(test-equal "package using tarball: version" + "2.0" + (upstream-source-version + (latest-release package-using-tarball))) + +(test-equal "package using tarball: URL" + (list "https://example.org/foo-2.0.tar.gz") + (upstream-source-urls + (latest-release package-using-tarball))) + +(test-equal "package using tarball: multiple URLs" + (list "https://example.org/foo-2.0.tar.gz" + "https://mirror.example.org/foo-2.0.tar.gz") + (upstream-source-urls + (latest-release package-using-tarball-multiple-urls))) + +(test-end "repology") From patchwork Wed Feb 9 13:25:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37143 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 6D19127BBEA; Wed, 9 Feb 2022 14:03:19 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 35B4F27BBE9 for ; Wed, 9 Feb 2022 14:03:19 +0000 (GMT) Received: from localhost ([::1]:37016 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnYz-0000Pe-BC for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 09:03:17 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56338) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmyz-00059X-QY for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56306) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmyw-0004hE-Pk for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmyw-00079T-NY; Wed, 09 Feb 2022 08:26:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 6/7] gnu: xorg-server-xwayland: Set 'repology-name' property. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:26:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441313527410 (code B ref 53818); Wed, 09 Feb 2022 13:26:02 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:25:35 +0000 Received: from localhost ([127.0.0.1]:50190 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmyU-000781-Ro for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:35 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44898 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmyT-00077n-5k for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:33 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413127; bh=f7r1HprMCgd+yT9MgYeTpNbVfndFbU/YpwUOiR9Yx2Y=; h=From:To:Subject:In-Reply-To:References:Date; b=DeyUP0ai47XHKzMvgtnR5ofKt/AmLQAyYf8rfdXWRCl+MBzs14DYJ1C9mDu0+fCDv 46pUYT/X/36C7puAArcbtL4Qodu7NANn9bIgBuu4CIpH0T3/B2f0688X21IKjS3rxI BjJPQi2bWvSvvQsvsfujvJ+VMIVucCSNeD91tH7g= In-Reply-To: References: Message-Id: <683fa3b5867f02268b9e6d09c2f93c749d0f75fb.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:25:26 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/packages/xorg.scm (xorg-server-xwayland):[properties]: Set 'repology-name'. --- gnu/packages/xorg.scm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 14e35d19ae..8be7017da7 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -33,6 +33,7 @@ ;;; Copyright © 2021 Maxime Devos ;;; Copyright © 2021 qblade ;;; Copyright © 2021 Lu Hui +;;; Copyright © 2022 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -5520,6 +5521,8 @@ (define-public xorg-server-xwayland (lambda _ (substitute* (find-files "." "\\.c$") (("/bin/sh") (which "sh")))))))) + (properties + '((repology-name . "xwayland"))) (synopsis "Xorg server with Wayland backend") (description "Xwayland is an X server for running X clients under Wayland.") From patchwork Wed Feb 9 13:25:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 37141 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 783F327BBEA; Wed, 9 Feb 2022 13:43:28 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 43E9627BBE9 for ; Wed, 9 Feb 2022 13:43:28 +0000 (GMT) Received: from localhost ([::1]:53266 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nHnFm-0006qh-Ur for patchwork@mira.cbaines.net; Wed, 09 Feb 2022 08:43:27 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56340) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nHmyz-00059Y-QD for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:06 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:56309) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nHmyx-0004hq-66 for guix-patches@gnu.org; Wed, 09 Feb 2022 08:26:04 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nHmyx-00079b-3u; Wed, 09 Feb 2022 08:26:03 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#53818] [PATCH v3 7/7] gnu: xorg-server-xwayland: Prepare for cross-compilation. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: maximedevos@telenet.be, guix-patches@gnu.org Resent-Date: Wed, 09 Feb 2022 13:26:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 53818 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 53818@debbugs.gnu.org Cc: Maxime Devos X-Debbugs-Original-Xcc: Maxime Devos Received: via spool by 53818-submit@debbugs.gnu.org id=B53818.164441314027428 (code B ref 53818); Wed, 09 Feb 2022 13:26:03 +0000 Received: (at 53818) by debbugs.gnu.org; 9 Feb 2022 13:25:40 +0000 Received: from localhost ([127.0.0.1]:50193 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmya-00078K-9z for submit@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:40 -0500 Received: from h178-251-242-94.cust.a3fiber.se ([178.251.242.94]:44906 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nHmyY-00077t-Km for 53818@debbugs.gnu.org; Wed, 09 Feb 2022 08:25:38 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1644413133; bh=jfMlwFd48Ue03So3eKlueTE4uUT6FJ2S6vUX3eqQoKo=; h=From:To:Subject:In-Reply-To:References:Date; b=SbKI70X5N76v1awVC9uFFbmMzSsyWXZzJIyLsKsuPeLoZ1uQoyOvwzdJ6fmCGUhoD OB/nacJB2CVfMneJDaKswg1kfvEuboIVZ87YvZ8Cojsk3IUb9porkKJdWQtkNEBtfR 0fh6IahWf9LeOQ7LlhY6uCcf5zjAzWNQbBuYEfbg= In-Reply-To: References: Message-Id: <005f249032a707f538768f1b6059706c45e50d24.1644412701.git.public@yoctocell.xyz> Date: Wed, 09 Feb 2022 14:25:32 +0100 MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 * gnu/packages/xorg.scm (xorg-server-xwayland)[arguments]<#:phases>: Use ‘search-input-file’ instead of ‘which’. --- gnu/packages/xorg.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 8be7017da7..dea7268a2e 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -5518,9 +5518,10 @@ (define-public xorg-server-xwayland "--localstatedir=/var") #:phases (modify-phases %standard-phases (add-after 'unpack 'patch-/bin/sh - (lambda _ + (lambda* (#:key inputs #:allow-other-keys) (substitute* (find-files "." "\\.c$") - (("/bin/sh") (which "sh")))))))) + (("/bin/sh") + (search-input-file inputs "bin/sh")))))))) (properties '((repology-name . "xwayland"))) (synopsis "Xorg server with Wayland backend")