From patchwork Sat Dec 17 04:35:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 45388 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 C5C2527BBED; Sat, 17 Dec 2022 04:37:14 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham 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 58B7527BBE9 for ; Sat, 17 Dec 2022 04:37:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6Owb-00047C-HI; Fri, 16 Dec 2022 23:37:05 -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 1p6OwZ-00045w-M3 for guix-patches@gnu.org; Fri, 16 Dec 2022 23:37:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6OwZ-00061j-7w for guix-patches@gnu.org; Fri, 16 Dec 2022 23:37:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p6OwY-0001lM-Tx for guix-patches@gnu.org; Fri, 16 Dec 2022 23:37:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60145] [PATCH 2/2] gnu: Add patman. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 17 Dec 2022 04:37:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60145 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60145@debbugs.gnu.org Cc: vagrant@debian.org, Maxim Cournoyer Received: via spool by 60145-submit@debbugs.gnu.org id=B60145.16712517876756 (code B ref 60145); Sat, 17 Dec 2022 04:37:02 +0000 Received: (at 60145) by debbugs.gnu.org; 17 Dec 2022 04:36:27 +0000 Received: from localhost ([127.0.0.1]:53635 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Ovy-0001ks-Pf for submit@debbugs.gnu.org; Fri, 16 Dec 2022 23:36:27 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:35787) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p6Ovx-0001kf-8F for 60145@debbugs.gnu.org; Fri, 16 Dec 2022 23:36:25 -0500 Received: by mail-qt1-f171.google.com with SMTP id h26so509427qtu.2 for <60145@debbugs.gnu.org>; Fri, 16 Dec 2022 20:36:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hJgIMz5b1IirLsFOY2+I3tLAc1RqR/4ktOZMSNsmh04=; b=MAOe6Xn1hW+bTsYefN+tMmeFVQlR1/PsXr1xjRoA7cRbQsz80lMf8uz4oo1xQaeDpr IDtdLUCdOGGjfPR67VHTgecwNRfHp0n2oVVWOtVEb8HRlyB+6bE/RQvv3tHYZFD3XQzz nvA5uIDV8amzwVbemYtHN4yNSRR+hM08itCSSH89NIohyg9TXH4Jiw2OPNsZ6DTfVd6r CLK7MOcXKRhlkKvgQ+gVbtuP/tt3HhcCUYXPxQgnZiHiGoOqgvZzpv9wb2+Nf2Nt7rI9 dR8JU5SJGGnLdPNU5HTfNg8mvTfBUpGvjXmCFK57h2HbCjnFskQ9514qo60Cdj37dIga cfWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hJgIMz5b1IirLsFOY2+I3tLAc1RqR/4ktOZMSNsmh04=; b=fRNULO6TDecDVbWcEVzcymPZXBN0wHoSHZcU72eb9EN6qPL4jz6pVvz47Aq9ww9suD UDaiTNyBKA+JJLu7FwPg/VA9Did2tbqGsW/1+xsbY6FptmkshcvLpEYEN4uflpLpskQp gUS/Hvnkji2whkEooIYgaUsWS9h7hW1XFj80Xjti0FFeipvBTifp6siEzAG4siZmjsYY hjFaIRFvie588y8I3A2OhTmN+RgYF8JKqIIiBzEgf1OzFA9uDRiEgqjPO7Qu5XaaVUNn AZZVSaGrB5GM1lsCcsneBJh1qxcBWc5UU3w8hWwgS3tXJKkUT3Oh57H3wGNADKtTbiSf Sc+Q== X-Gm-Message-State: ANoB5pn2n+hY1oLdlH1zUKjRKeDKfHLcqMo8JzOtTOzPnjUVRIc4D7FA 2j1tfIZsWyTdt7g9JDB5n3JcAjiocZuJu3w5 X-Google-Smtp-Source: AA0mqf5Y0Kw+egyyaD+j0prhYRB7vqev6ZfrRn4y7DaAHqzYO7554XCb4GHsqOV3GRifdvSFjN9krw== X-Received: by 2002:ac8:6b4e:0:b0:3a8:2a89:d57d with SMTP id x14-20020ac86b4e000000b003a82a89d57dmr19256185qts.67.1671251779480; Fri, 16 Dec 2022 20:36:19 -0800 (PST) Received: from localhost.localdomain (dsl-159-157.b2b2c.ca. [66.158.159.157]) by smtp.gmail.com with ESMTPSA id ci27-20020a05622a261b00b003a580cd979asm2479291qtb.58.2022.12.16.20.36.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 20:36:19 -0800 (PST) From: Maxim Cournoyer Date: Fri, 16 Dec 2022 23:35:49 -0500 Message-Id: <20221217043549.23069-2-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221217043549.23069-1-maxim.cournoyer@gmail.com> References: <20221217043549.23069-1-maxim.cournoyer@gmail.com> 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-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/bootloaders.scm (patman): New variable. * gnu/packages/patches/u-boot-patman-fix-help.patch: New patch. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/local.mk | 1 + gnu/packages/bootloaders.scm | 34 +++++++++++++++- .../patches/u-boot-patman-fix-help.patch | 40 +++++++++++++++++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 gnu/packages/patches/u-boot-patman-fix-help.patch diff --git a/gnu/local.mk b/gnu/local.mk index 8ae21641d7..456d955616 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1924,6 +1924,7 @@ dist_patch_DATA = \ %D%/packages/patches/twinkle-bcg729.patch \ %D%/packages/patches/u-boot-allow-disabling-openssl.patch \ %D%/packages/patches/u-boot-infodocs-target.patch \ + %D%/packages/patches/u-boot-patman-fix-help.patch \ %D%/packages/patches/u-boot-nintendo-nes-serial.patch \ %D%/packages/patches/u-boot-rockchip-inno-usb.patch \ %D%/packages/patches/u-boot-sifive-prevent-reloc-initrd-fdt.patch \ diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm index f52b2130ac..335b5a56d8 100644 --- a/gnu/packages/bootloaders.scm +++ b/gnu/packages/bootloaders.scm @@ -69,7 +69,10 @@ (define-module (gnu packages bootloaders) #:use-module (gnu packages valgrind) #:use-module (gnu packages virtualization) #:use-module (gnu packages xorg) + #:use-module (gnu packages python-web) + #:use-module (gnu packages python-xyz) #:use-module (guix build-system gnu) + #:use-module (guix build-system pyproject) #:use-module (guix build-system trivial) #:use-module (guix download) #:use-module (guix gexp) @@ -640,7 +643,8 @@ (define u-boot %u-boot-allow-disabling-openssl-patch %u-boot-sifive-prevent-relocating-initrd-fdt %u-boot-rk3399-enable-emmc-phy-patch - (search-patch "u-boot-infodocs-target.patch"))) + (search-patch "u-boot-infodocs-target.patch") + (search-patch "u-boot-patman-fix-help.patch"))) (method url-fetch) (uri (string-append "https://ftp.denx.de/pub/u-boot/" @@ -822,6 +826,34 @@ (define-public u-boot-tools " This package provides board-independent tools " "of U-Boot.")))) +;;; This is packaged separately, as it can be used in other contexts than for +;;; U-Boot development. +(define-public patman + (package + (inherit u-boot) + (name "patman") + (build-system pyproject-build-system) + (arguments + ;; The test suite strongly relies on the git metadata being available (23 + ;; failed, 14 passed). + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'chdir + (lambda _ + (chdir "tools/patman")))))) + (inputs (list python-pygit2 python-requests)) + (synopsis "Patch automation tool") + (description "Patman is a patch automation script which: +@itemize +@item Creates patches directly from your branch +@item Cleans them up by removing unwanted tags +@item Inserts a cover letter with change lists +@item Runs the patches through automated checks +@item Optionally emails them out to selected people. +@end itemize"))) + (define*-public (make-u-boot-package board triplet #:key defconfig diff --git a/gnu/packages/patches/u-boot-patman-fix-help.patch b/gnu/packages/patches/u-boot-patman-fix-help.patch new file mode 100644 index 0000000000..15b1aa3b55 --- /dev/null +++ b/gnu/packages/patches/u-boot-patman-fix-help.patch @@ -0,0 +1,40 @@ +Submitted upstream on Dec 16th, 2022. + +diff --git a/tools/patman/main.py b/tools/patman/main.py +index 5a7756a221..bf300c6e64 100755 +--- a/tools/patman/main.py ++++ b/tools/patman/main.py +@@ -7,6 +7,7 @@ + """See README for more information""" + + from argparse import ArgumentParser ++import importlib.resources + import os + import re + import shutil +@@ -163,11 +164,8 @@ elif args.cmd == 'send': + fd.close() + + elif args.full_help: +- tools.print_full_help( +- os.path.join(os.path.dirname(os.path.realpath(sys.argv[0])), +- 'README.rst') +- ) +- ++ with importlib.resources.path('patman', 'README.rst') as readme: ++ tools.print_full_help(str(readme)) + else: + # If we are not processing tags, no need to warning about bad ones + if not args.process_tags: +diff --git a/tools/patman/setup.py b/tools/patman/setup.py +index 43fdc00ce6..ce9bb4aa63 100644 +--- a/tools/patman/setup.py ++++ b/tools/patman/setup.py +@@ -7,6 +7,6 @@ setup(name='patman', + scripts=['patman'], + packages=['patman'], + package_dir={'patman': ''}, +- package_data={'patman': ['README']}, ++ package_data={'patman': ['README.rst']}, + classifiers=['Environment :: Console', + 'Topic :: Software Development'])