From patchwork Wed Jan 29 10:08:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 20030 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 0C9DA1639F; Wed, 29 Jan 2020 10:09:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, FREEMAIL_FROM,MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 8CE4B16372 for ; Wed, 29 Jan 2020 10:09:11 +0000 (GMT) Received: from localhost ([::1]:43684 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iwkHX-00022T-3Y for patchwork@mira.cbaines.net; Wed, 29 Jan 2020 05:09:11 -0500 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-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Wed, 29 Jan 2020 10:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 39192 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Jakub =?utf-8?b?S8SFZHppb8WCa2E=?= Cc: 39192-done@debbugs.gnu.org Mail-Followup-To: 39192@debbugs.gnu.org, mbakke@fastmail.com, kuba@kadziolka.net Received: via spool by 39192-done@debbugs.gnu.org id=D39192.15802925053712 (code D ref 39192); Wed, 29 Jan 2020 10:09:02 +0000 Received: (at 39192-done) by debbugs.gnu.org; 29 Jan 2020 10:08:25 +0000 Received: from localhost ([127.0.0.1]:33238 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iwkGn-0000xo-An for submit@debbugs.gnu.org; Wed, 29 Jan 2020 05:08:25 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:53015) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iwkGl-0000xO-BI for 39192-done@debbugs.gnu.org; Wed, 29 Jan 2020 05:08:23 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id EF4EC220F4; Wed, 29 Jan 2020 05:08:17 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Wed, 29 Jan 2020 05:08:17 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= from:to:cc:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm2; bh=UUsLNeHx33RjvEOtR+X9PgXQ++ UtVoE0xBlJojK9TLY=; b=xh27+HBFErRPRnypWjysv1djEMPqG1u7piSfr3nXCW tCWSxRd/tsON/2Nujge05c+QtTOTRrPqvbgEeo7JGeK4etcTYOfOijXFkS31l97q cMi/X1ukN8qAtKlU5QiFeb5daBXA7bnZ7dzeu1+QbgRW9Ev8lIUdR6E9ozA/jJSS QJsjTYPi+lRLBNfJiTd0aoNy5+n7C47OrC8/34k+qsxaNbYg8j4lbDwNQLcJhj2x Y3Kz4QGVo6f1B3woUtWgzOCrjLQqRvZQcfc9Ad3I4McFxlYgLUYiO+aZx6iEzqYY PeuHBq26FJWdxpcCqB2pogckHUNDjt+PNr+RgdjmiupQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=UUsLNe Hx33RjvEOtR+X9PgXQ++UtVoE0xBlJojK9TLY=; b=dGULsux5QLKWr+lXIAp6b/ OaTDBIdFJAEly/lAKo5qTAwDdPkoFMDnA/yy1jwpVxPsRLIJnKGtKzLHgWn0QcPc eWHQ4ymT6Lt7ZzTMnP5WugqqKOSpiYytC2lQPD8P+KjEWkxH2BsAZeFy9nWyu0sZ Bd4JvKlniNsDrTr+RZFhGAYe+//oxx7F9z6TWPfE1WvnCN58/HwB70qS7Sd0vOkk 8JiRtsuxdWSFz2siwa5jdRV0PvFh0cieONvg/Qis9zQv1wT8QAPUkH0vGkGzkHgx QvHXFHGYj3bQRx62Rqai+N1AxxCPVLPLd447VMOoj5vBo076CAZp4YGSMPAV+jAQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrfeeigddutdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhephffvufgjfhgffffkgggtsehgtderre dtreejnecuhfhrohhmpeforghrihhushcuuegrkhhkvgcuoehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhmqeenucfkphepkeegrddvtddvrdeiledrvdehfeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehmsggrkhhkvgesfhgrshht mhgrihhlrdgtohhm X-ME-Proxy: Received: from localhost (ti0006q161-3035.bb.online.no [84.202.69.253]) by mail.messagingengine.com (Postfix) with ESMTPA id 6853A3060840; Wed, 29 Jan 2020 05:08:17 -0500 (EST) 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> User-Agent: Notmuch/0.29.3 (https://notmuchmail.org) Emacs/26.3 (x86_64-pc-linux-gnu) Date: Wed, 29 Jan 2020 11:08:14 +0100 Message-ID: <87d0b2r2wh.fsf@devup.no> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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 Jakub Kądziołka writes: > On Tue, Jan 28, 2020 at 12:36:04AM +0100, Marius Bakke wrote: >> Jakub Kądziołka writes: >> >> > * gnu/packages/hexedit.scm (hexedit)[arguments](patch-man-path): New >> > phase. >> > [inputs]: Add MAN-DB. >> >> 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? >> >> 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: 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