From patchwork Tue Jan 7 06:16:28 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: tusharhero--- via Guix-patches via X-Patchwork-Id: 36699 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 63BAB27BBE9; Tue, 7 Jan 2025 06:14:34 +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=-6.4 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_VALIDITY_CERTIFIED,RCVD_IN_VALIDITY_RPBL,RCVD_IN_VALIDITY_SAFE, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 C438727BBE2 for ; Tue, 7 Jan 2025 06:14:30 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tV2qs-00038y-NT; Tue, 07 Jan 2025 01:14:06 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV2qo-00038h-O6 for guix-patches@gnu.org; Tue, 07 Jan 2025 01:14:02 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tV2qo-0008OX-Co for guix-patches@gnu.org; Tue, 07 Jan 2025 01:14:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:Subject; bh=TvfZKzjCUAZTRSRVZZ8f0qWrfgTv/51vKNRMOvaxTsM=; b=QdSdtGtYKnXrDFgsVgqNmAZdxDXuDEoXkHA173T6T6PJE9ujWcJMEs5bz24u4UZYcUFHJblpeh4JJM3dS4/PC7bsjj1X0SQUYGzKCtsEY7+dpQlZQFtSfxS48piE+/zEp5D9px6GMBxorOXTP67MgeOci8DQjqYcVC0zLwfrhVn7lmrfdZmtKn7/xyrxosbCLfqhQzoyR0Ft2LeiLP+UyzyBa0oKuepXfhDDMxoDpRqMHm5m7zJfYPJnxk3wCQ8ORWa2JUrSwum+bsfSPqLxgyoamKno0VlhcI2AHb1V2trmswB088WPKiOyb+EKpFnkJ92NFg7Xn/5zeylyUPXvbQ==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tV2qn-0002vp-Vz; Tue, 07 Jan 2025 01:14:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#75418] [PATCH] import: git: Do not search pre-release words in tag prefix. Resent-From: iyzsong@envs.net Original-Sender: "Debbugs-submit" Resent-CC: iyzsong@envs.net, guix-patches@gnu.org Resent-Date: Tue, 07 Jan 2025 06:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 75418 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 75418@debbugs.gnu.org Cc: =?utf-8?b?5a6L5paH5q2m?= , =?utf-8?b?5a6L5paH?= =?utf-8?b?5q2m?= X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: =?utf-8?b?5a6L5paH5q2m?= Received: via spool by submit@debbugs.gnu.org id=B.173623043111243 (code B ref -1); Tue, 07 Jan 2025 06:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 7 Jan 2025 06:13:51 +0000 Received: from localhost ([127.0.0.1]:41505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tV2qZ-0002vE-FP for submit@debbugs.gnu.org; Tue, 07 Jan 2025 01:13:51 -0500 Received: from lists.gnu.org ([2001:470:142::17]:52930) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1tV2qT-0002um-B2 for submit@debbugs.gnu.org; Tue, 07 Jan 2025 01:13:45 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV2qL-00033C-UK for guix-patches@gnu.org; Tue, 07 Jan 2025 01:13:33 -0500 Received: from mail.envs.net ([5.199.136.28]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tV2qJ-0008K5-PM for guix-patches@gnu.org; Tue, 07 Jan 2025 01:13:33 -0500 Received: from localhost (mail.envs.net [127.0.0.1]) by mail.envs.net (Postfix) with ESMTP id 4F75538A3E06; Tue, 7 Jan 2025 06:13:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.envs.net Received: from mail.envs.net ([127.0.0.1]) by localhost (mail.envs.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id s1J8j6YXfxDD; Tue, 7 Jan 2025 06:13:21 +0000 (UTC) Received: from localhost (unknown [112.44.107.158]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.envs.net (Postfix) with ESMTPSA; Tue, 7 Jan 2025 06:13:20 +0000 (UTC) Received: from localhost.localdomain (localhost.lan [127.0.0.1]) by localhost (OpenSMTPD) with ESMTP id 602a840f; Tue, 7 Jan 2025 06:16:32 +0000 (UTC) Date: Tue, 7 Jan 2025 14:16:28 +0800 Message-ID: <98d422b8ec544458719b20d6a8ff85cc1f681f10.1736230582.git.iyzsong@member.fsf.org> X-Mailer: git-send-email 2.47.1 MIME-Version: 1.0 Received-SPF: pass client-ip=5.199.136.28; envelope-from=iyzsong@envs.net; helo=mail.envs.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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: , Reply-to: iyzsong@envs.net X-ACL-Warn: , iyzsong--- via Guix-patches X-Patchwork-Original-From: iyzsong--- via Guix-patches via From: tusharhero--- via Guix-patches via Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: 宋文武 This fixes tags like 'xfce4-dev-tools-4.20.0'. * tests/import-git.scm ("latest-git-tag-version: prefix contains pre-release words"): New test. * guix/import/git.scm (latest-tag): Don't filter out pre-releases tags. (version-mapping): Filter out pre-releases tags from versions. * gnu/packages/xfce.scm (garcon, thunar-archive-plugin, xfce4-dev-tools): Remove FIXME comments for the 'generic-git' updater. Change-Id: I7683200fa451d7fad153aa08fa9d5761688de01d --- gnu/packages/xfce.scm | 3 --- guix/import/git.scm | 17 +++++++++-------- tests/import-git.scm | 9 +++++++++ 3 files changed, 18 insertions(+), 11 deletions(-) base-commit: 329daafcc3c798dd180fd98ff757452e3e016235 diff --git a/gnu/packages/xfce.scm b/gnu/packages/xfce.scm index c5e5009ccf..95520b9c22 100644 --- a/gnu/packages/xfce.scm +++ b/gnu/packages/xfce.scm @@ -374,7 +374,6 @@ (define-public garcon library called libxfce4menu, which, in contrast to garcon, was lacking menu merging features essential for loading menus modified with menu editors.") (license lgpl2.0+) - ;; FIXME: the 'generic-git' updater treat "rc" as pre-releases. (properties `((release-tag-prefix . ,(string-append name "-")))))) (define-public tumbler @@ -894,7 +893,6 @@ (define-public thunar-archive-plugin (description "The Thunar Archive Plugin allows you to create and extract archive files using the file context menus in the Thunar file manager.") (license gpl2+) - ;; FIXME: the 'generic-git' updater treat "rc" as pre-releases. (properties `((release-tag-prefix . ,(string-append name "-")))))) (define-public thunar-shares-plugin @@ -2417,5 +2415,4 @@ (define-public xfce4-dev-tools developers and people that want to build Xfce from Git In addition it contains the Xfce developer's handbook.") (license gpl2+) - ;; FIXME: the 'generic-git' updater treat "dev" as pre-releases. (properties `((release-tag-prefix . ,(string-append name "-")))))) diff --git a/guix/import/git.scm b/guix/import/git.scm index ab51719255..305b2fc43f 100644 --- a/guix/import/git.scm +++ b/guix/import/git.scm @@ -138,9 +138,16 @@ (define* (version-mapping tags #:key prefix suffix delim pre-releases?) (define (entry tag) + %pre-release-rx)) + (stable-sort (filter-map (lambda (tag) (let ((version (get-version tag))) - (and version (cons version tag)))) + (and version + (or pre-releases? + (not (pre-release? version))) + (cons version tag)))) tags) entry tag) - %pre-release-rx)) - (let* ((tags (map (cut string-drop <> (string-length "refs/tags/")) (remote-refs url #:tags? #t))) (versions->tags - (version-mapping (if pre-releases? - tags - (filter (negate pre-release?) tags)) + (version-mapping tags #:prefix prefix #:suffix suffix #:delim delim diff --git a/tests/import-git.scm b/tests/import-git.scm index 20255dedb3..6dd8ad1649 100644 --- a/tests/import-git.scm +++ b/tests/import-git.scm @@ -224,4 +224,13 @@ (define* (make-package directory version #:optional (properties '())) (let ((package (make-package directory "1.0.0"))) (latest-git-tag-version package)))) +(test-equal "latest-git-tag-version: prefix contains pre-release words" + "1.0.1" + (with-temporary-git-repository directory + '((add "a.txt" "A") + (commit "First commit") + (tag "libdevx-1.0.1" "Release 1.0.1")) + (let ((package (make-package directory "1.0.0"))) + (latest-git-tag-version package)))) + (test-end "git")