From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:37391) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwkHP-00020X-UT for guix-patches@gnu.org; Wed, 29 Jan 2020 05:09:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iwkHO-0001vF-NQ for guix-patches@gnu.org; Wed, 29 Jan 2020 05:09:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:55501) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iwkHO-0001uy-HS for guix-patches@gnu.org; Wed, 29 Jan 2020 05:09:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iwkHO-0000ys-D5 for guix-patches@gnu.org; Wed, 29 Jan 2020 05:09:02 -0500 Subject: bug#39192: [PATCH] gnu: hexedit: Make F1 help more reliable Resent-To: guix-patches@gnu.org Resent-Message-ID: From: Marius Bakke In-Reply-To: <20200128073653.fvcvzitgphtuxzok@zdrowyportier.kadziolka.net> References: <20200119124434.aatfpdm6ihiig354@zdrowyportier.kadziolka.net> <87mua8qxp7.fsf@devup.no> <20200128073653.fvcvzitgphtuxzok@zdrowyportier.kadziolka.net> Date: Wed, 29 Jan 2020 11:08:14 +0100 Message-ID: <87d0b2r2wh.fsf@devup.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="==-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Jakub =?UTF-8?Q?K=C4=85dzio=C5=82ka?= Cc: 39192-done@debbugs.gnu.org --==-=-= Content-Type: multipart/mixed; boundary="=-=-=" --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Jakub K=C4=85dzio=C5=82ka writes: > On Tue, Jan 28, 2020 at 12:36:04AM +0100, Marius Bakke wrote: >> Jakub K=C4=85dzio=C5=82ka writes: >>=20 >> > * gnu/packages/hexedit.scm (hexedit)[arguments](patch-man-path): New >> > phase. >> > [inputs]: Add MAN-DB. >>=20 >> While this change is harmless, I think we can generally expect "man" to >> be available. Does the program crash if man-db is not installed? Or >> does it print an actionable error message? >>=20 >> In the latter case I'm inclined to leave things as-is, in the former >> case let's patch it. But no strong opinion, mostly curious :-) > > Currently, the problem appears when hexedit is used in a `guix > environment', and man-db is not specified as an input for the > environment. In this case (assuming --pure hasn't been used), man prints > an error message saying "no manpage for hexedit" when the user presses > F1, but it cannot be seen until one exits hexedit. For a new user, this > is not a trivial feat. Moreover, the error is confusing - it suggests > that the manpage just hasn't been packaged. Right. The problem of manpages being unavailable unless man-db is included in the profile is not unique to hexedit. 'git foo --help' has the same problem in a --pure environment. But at least then you get a good error message. > When man isn't found at all, no error message is printed, the F1 key > just makes the screen blink. This could happen in a --pure environment. I see, not great. Sounds like a good reason to add man-db as an input in this case. > In hindsight, this is something I should've explained in my first message. > Sorry about that. No worries, these things are difficult. :-) Pushed in 602059e79, with a few cosmetic modifications: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/gnu/packages/hexedit.scm b/gnu/packages/hexedit.scm index 368a902ce3..e1a029167a 100644 --- a/gnu/packages/hexedit.scm +++ b/gnu/packages/hexedit.scm @@ -49,20 +49,22 @@ `(#:tests? #f ; no check target #:phases (modify-phases %standard-phases - ;; Make F1 open the man page even if man-db is not in the profile + ;; Make F1 open the man page even if man-db is not in the profile. (add-after 'unpack 'patch-man-path - (lambda _ + (lambda* (#:key inputs outputs #:allow-other-keys) (substitute* "interact.c" (("\"man\"") - (string-append "\"" (assoc-ref %build-inputs "man-db") "/bin/man\"")) + (string-append "\"" (assoc-ref inputs "man-db") "/bin/man\"")) (("\"hexedit\"") - (string-append "\"" (assoc-ref %outputs "out") "/share/man/man1/hexedit.1.gz\"")))))))) + (string-append "\"" (assoc-ref outputs "out") + "/share/man/man1/hexedit.1.gz\""))) + #t))))) (native-inputs `(("autoconf" ,autoconf) ("automake" ,automake))) (inputs - `(("ncurses" ,ncurses) - ("man-db" ,man-db))) + `(("man-db" ,man-db) + ("ncurses" ,ncurses))) (synopsis "View and edit files or devices in hexadecimal or ASCII") (description "hexedit shows a file both in ASCII and in hexadecimal. The file can be a device as the file is read a piece at a time. You can modify --=-=-=-- --==-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEu7At3yzq9qgNHeZDoqBt8qM6VPoFAl4xWY4ACgkQoqBt8qM6 VPr9pgf/T2wCh8f5fOCbbNB+5fKQAC63Au55LvY6ITItDeh1Kbx7uU3sBD+33T3R /9FgqcPWzGWeQwfYBUre0qs9v9yolMnvM8ocLdeQtacW2UpTz4nLfvQDHUc5f6gu XmtJUKbKcXdutnqCEAGsy/ejHkTEavhhhk0vwC/Q1A1rHbEwKuYHkvtKZGwBjVgG FTHHd2lerOQ+rdQdfLN9w8H6djj0s/IN3cV8L3qPu4ZzOBXLb9U+XNwD0BJ9YTMr OuUiheAevlRIk5O0lalnbTthpnc9AQBwznp2FuRpJSAwsLAq1yqUj6ySwdCIPOqP 8rAuwzshOq4pQhwUbNTgFauHY8VaGw== =g07s -----END PGP SIGNATURE----- --==-=-=--