GNU bug report logs - #60134
[PATCH 3/3] patman: locate README.rst via importlib

Previous Next

Package: guix-patches;

Reported by: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Date: Sat, 17 Dec 2022 01:46:03 UTC

Severity: normal

Tags: notabug, patch

Done: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 60134 in the body.
You can then email your comments to 60134 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix-patches <at> gnu.org:
bug#60134; Package guix-patches. (Sat, 17 Dec 2022 01:46:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Maxim Cournoyer <maxim.cournoyer <at> gmail.com>:
New bug report received and forwarded. Copy sent to guix-patches <at> gnu.org. (Sat, 17 Dec 2022 01:46:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
To: guix-patches <at> gnu.org
Cc: u-boot <at> lists.denx.de, Simon Glass <sjg <at> chromium.org>,
 Maxim Cournoyer <maxim.cournoyer <at> savoirfairelinux.com>
Subject: [PATCH 3/3] patman: locate README.rst via importlib
Date: Fri, 16 Dec 2022 20:45:29 -0500
Rationale: this is more robust than assumptions about the file
hierarchy layout of the installation of patman, for example on non
file-hierarchy standard (FHS) systems such as Guix System or Nix OS.

Signed-off-by: Maxim Cournoyer <maxim.cournoyer <at> savoirfairelinux.com>
---

 tools/patman/main.py | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/patman/main.py b/tools/patman/main.py
index 8067a288ab..2a2a7eaa24 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 sys
@@ -160,11 +161,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:
-- 
2.38.1





Added tag(s) notabug. Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 17 Dec 2022 02:23:03 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 60134 <at> debbugs.gnu.org and Maxim Cournoyer <maxim.cournoyer <at> gmail.com> Request was from Maxim Cournoyer <maxim.cournoyer <at> gmail.com> to control <at> debbugs.gnu.org. (Sat, 17 Dec 2022 02:23:03 GMT) Full text and rfc822 format available.

Information forwarded to guix-patches <at> gnu.org:
bug#60134; Package guix-patches. (Sun, 18 Dec 2022 01:09:02 GMT) Full text and rfc822 format available.

Message #12 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Simon Glass <sjg <at> chromium.org>
To: Maxim Cournoyer <maxim.cournoyer <at> gmail.com>
Cc: u-boot <at> lists.denx.de,
 Maxim Cournoyer <maxim.cournoyer <at> savoirfairelinux.com>, guix-patches <at> gnu.org
Subject: Re: [PATCH 3/3] patman: locate README.rst via importlib
Date: Sat, 17 Dec 2022 15:24:34 -0700
On Fri, 16 Dec 2022 at 18:45, Maxim Cournoyer <maxim.cournoyer <at> gmail.com> wrote:
>
> Rationale: this is more robust than assumptions about the file
> hierarchy layout of the installation of patman, for example on non
> file-hierarchy standard (FHS) systems such as Guix System or Nix OS.
>
> Signed-off-by: Maxim Cournoyer <maxim.cournoyer <at> savoirfairelinux.com>
> ---
>
>  tools/patman/main.py | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
>

Reviewed-by: Simon Glass <sjg <at> chromium.org>




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 15 Jan 2023 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 158 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.