Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support mandoc in perl5db.t #15299

Closed
p5pRT opened this issue Apr 28, 2016 · 9 comments
Closed

Support mandoc in perl5db.t #15299

p5pRT opened this issue Apr 28, 2016 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Apr 28, 2016

Migrated from rt.perl.org#128012 (status was 'resolved')

Searchable as RT128012$

@p5pRT
Copy link
Author

p5pRT commented Apr 28, 2016

From andreas@andreasvoegele.com

When mandoc is installed instead of the traditional man package one of
the tests in perl5db.t fails with the error message below. With the
attached patch the output of both man implementations is accepted.

lib/perl5db ...................................................
# Failed test 120 - perldoc command works fine at ../lib/perl5db.t line 2769
# got 'man​: No entry for perlrules in the manual.
# '
# expected /(?^​:No manual entry for perlrules)/
FAILED at test 120

@p5pRT
Copy link
Author

p5pRT commented Apr 28, 2016

From andreas@andreasvoegele.com

0001-Fix-test-failure-in-lib-perl5db.t-when-mandoc-is-ins.patch
From 98ce25c1c4f53aeb5e935dda65d105d58fdb51d7 Mon Sep 17 00:00:00 2001
From: Andreas Voegele <andreas@andreasvoegele.com>
Date: Tue, 26 Apr 2016 09:08:50 +0200
Subject: [PATCH] Fix test failure in lib/perl5db.t when mandoc is installed

---
 lib/perl5db.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/perl5db.t b/lib/perl5db.t
index 0c4fc42..e216685 100644
--- a/lib/perl5db.t
+++ b/lib/perl5db.t
@@ -2769,7 +2769,7 @@ SKIP:
     );
 
     $wrapper->output_like(
-        qr/No manual entry for perlrules/,
+        qr/No (?:manual )?entry for perlrules/,
         'perldoc command works fine',
     );
 }
-- 
2.8.1

@p5pRT
Copy link
Author

p5pRT commented Apr 29, 2016

From @jkeenan

On Wed Apr 27 22​:11​:35 2016, voegelas wrote​:

When mandoc is installed instead of the traditional man package one of
the tests in perl5db.t fails with the error message below. With the
attached patch the output of both man implementations is accepted.

lib/perl5db ...................................................
# Failed test 120 - perldoc command works fine at ../lib/perl5db.t line 2769
# got 'man​: No entry for perlrules in the manual.
# '
# expected /(?^​:No manual entry for perlrules)/
FAILED at test 120

You say "instead of". Since I have 'man' installed, if I were to install 'mandoc' how would I be able to trick the test into thinking that 'man' was not installed?

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Apr 29, 2016

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented May 2, 2016

From andreas@andreasvoegele.com

James E Keenan writes​:

On Wed Apr 27 22​:11​:35 2016, voegelas wrote​:

When mandoc is installed instead of the traditional man package one of
the tests in perl5db.t fails with the error message below. With the
attached patch the output of both man implementations is accepted.

lib/perl5db ...................................................
# Failed test 120 - perldoc command works fine at ../lib/perl5db.t line 2769
# got 'man​: No entry for perlrules in the manual.
# '
# expected /(?^​:No manual entry for perlrules)/
FAILED at test 120

You say "instead of". Since I have 'man' installed, if I were to install 'mandoc' how would I be able to trick the test into thinking that 'man' was not installed?

The test in perl5db.t uses /usr/bin/man. /usr/bin/man is either provided by the traditional man package or by the mandoc package. The traditional man program outputs "No manual entry for perlrules". The man program from mandoc outputs "No entry for perlrules in the manual".

There may be Linux distributions that provide a mandoc package that does not replace /usr/bin/man and that can be installed in parallel to the man package. But there are mandoc packages that fully replace the traditional man package. It's similar to the vi command, which may be provided by vim, elvis, nvi etc. on Linux.

@p5pRT
Copy link
Author

p5pRT commented May 5, 2016

From @jkeenan

On Sun May 01 21​:44​:17 2016, voegelas wrote​:

James E Keenan writes​:

On Wed Apr 27 22​:11​:35 2016, voegelas wrote​:

When mandoc is installed instead of the traditional man package one
of
the tests in perl5db.t fails with the error message below. With the
attached patch the output of both man implementations is accepted.

lib/perl5db ...................................................
# Failed test 120 - perldoc command works fine at ../lib/perl5db.t
line 2769
# got 'man​: No entry for perlrules in the manual.
# '
# expected /(?^​:No manual entry for perlrules)/
FAILED at test 120

You say "instead of". Since I have 'man' installed, if I were to
install 'mandoc' how would I be able to trick the test into thinking
that 'man' was not installed?

The test in perl5db.t uses /usr/bin/man. /usr/bin/man is either
provided by the traditional man package or by the mandoc package. The
traditional man program outputs "No manual entry for perlrules". The
man program from mandoc outputs "No entry for perlrules in the
manual".

There may be Linux distributions that provide a mandoc package that
does not replace /usr/bin/man and that can be installed in parallel to
the man package. But there are mandoc packages that fully replace the
traditional man package. It's similar to the vi command, which may be
provided by vim, elvis, nvi etc. on Linux.

This seems to be a real edge case. The test in question only runs on Linux​:

#####
$^O eq "linux"
  or skip "man errors aren't especially portable", 1;
#####

But when I go to https://en.wikipedia.org/wiki/Mandoc, I read​:

#####
While mandoc works well with the mdoc manuals used in the BSD Operating Systems, it poorly handles older troff macros such as man, me, and the roff language itself. This makes it a poor fit for Linux distributions, which primarily use man troff macros and low-level roff for their manual pages.
#####

When I got to mandoc's own website and look for information as to which OSes it runs on (http​://mdocml.bsd.lv/ports.html), I find that mandoc is indeed primarily a BSD program, but has an official port on Arch Linux and unofficial ports to Slackware Linux and Crux Linux. Notably absent​: Debian and distributions built on top of Debian, such as Ubuntu (which I have).

I downloaded the mandoc source code and acked for the error message cited by OP Andreas Voegele. I found​:

#####
[mdocml-1.13.3] 34 $ ack 'No entry for' .
main.c
623​: "%s​: No entry for %s in the manual.\n",
#####

Since I've found the error message, I'm willing to apply the patch submitted -- but I would like either a +1 from another committer or a confirmation from someone using, say, Arch Linux.

Thank you very much.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented May 6, 2016

From @khwilliamson

On 05/05/2016 05​:43 PM, James E Keenan via RT wrote​:

On Sun May 01 21​:44​:17 2016, voegelas wrote​:

James E Keenan writes​:

On Wed Apr 27 22​:11​:35 2016, voegelas wrote​:

When mandoc is installed instead of the traditional man package one
of
the tests in perl5db.t fails with the error message below. With the
attached patch the output of both man implementations is accepted.

lib/perl5db ...................................................
# Failed test 120 - perldoc command works fine at ../lib/perl5db.t
line 2769
# got 'man​: No entry for perlrules in the manual.
# '
# expected /(?^​:No manual entry for perlrules)/
FAILED at test 120

You say "instead of". Since I have 'man' installed, if I were to
install 'mandoc' how would I be able to trick the test into thinking
that 'man' was not installed?

The test in perl5db.t uses /usr/bin/man. /usr/bin/man is either
provided by the traditional man package or by the mandoc package. The
traditional man program outputs "No manual entry for perlrules". The
man program from mandoc outputs "No entry for perlrules in the
manual".

There may be Linux distributions that provide a mandoc package that
does not replace /usr/bin/man and that can be installed in parallel to
the man package. But there are mandoc packages that fully replace the
traditional man package. It's similar to the vi command, which may be
provided by vim, elvis, nvi etc. on Linux.

This seems to be a real edge case. The test in question only runs on Linux​:

#####
$^O eq "linux"
or skip "man errors aren't especially portable", 1;
#####

But when I go to https://en.wikipedia.org/wiki/Mandoc, I read​:

#####
While mandoc works well with the mdoc manuals used in the BSD Operating Systems, it poorly handles older troff macros such as man, me, and the roff language itself. This makes it a poor fit for Linux distributions, which primarily use man troff macros and low-level roff for their manual pages.
#####

When I got to mandoc's own website and look for information as to which OSes it runs on (http​://mdocml.bsd.lv/ports.html), I find that mandoc is indeed primarily a BSD program, but has an official port on Arch Linux and unofficial ports to Slackware Linux and Crux Linux. Notably absent​: Debian and distributions built on top of Debian, such as Ubuntu (which I have).

I downloaded the mandoc source code and acked for the error message cited by OP Andreas Voegele. I found​:

#####
[mdocml-1.13.3] 34 $ ack 'No entry for' .
main.c
623​: "%s​: No entry for %s in the manual.\n",
#####

Since I've found the error message, I'm willing to apply the patch submitted -- but I would like either a +1 from another committer or a confirmation from someone using, say, Arch Linux.

+1 from me. There is no harm in that patch, and since it helps pass a
test, I think it should be applied in 5.25.

Thank you very much.

@p5pRT
Copy link
Author

p5pRT commented May 9, 2016

From @jkeenan

On Thu May 05 20​:24​:57 2016, public@​khwilliamson.com wrote​:

On 05/05/2016 05​:43 PM, James E Keenan via RT wrote​:

On Sun May 01 21​:44​:17 2016, voegelas wrote​:

James E Keenan writes​:

On Wed Apr 27 22​:11​:35 2016, voegelas wrote​:

When mandoc is installed instead of the traditional man package
one
of
the tests in perl5db.t fails with the error message below. With
the
attached patch the output of both man implementations is accepted.

lib/perl5db ...................................................
# Failed test 120 - perldoc command works fine at ../lib/perl5db.t
line 2769
# got 'man​: No entry for perlrules in the manual.
# '
# expected /(?^​:No manual entry for perlrules)/
FAILED at test 120

You say "instead of". Since I have 'man' installed, if I were to
install 'mandoc' how would I be able to trick the test into
thinking
that 'man' was not installed?

The test in perl5db.t uses /usr/bin/man. /usr/bin/man is either
provided by the traditional man package or by the mandoc package.
The
traditional man program outputs "No manual entry for perlrules". The
man program from mandoc outputs "No entry for perlrules in the
manual".

There may be Linux distributions that provide a mandoc package that
does not replace /usr/bin/man and that can be installed in parallel
to
the man package. But there are mandoc packages that fully replace
the
traditional man package. It's similar to the vi command, which may
be
provided by vim, elvis, nvi etc. on Linux.

This seems to be a real edge case. The test in question only runs on
Linux​:

#####
$^O eq "linux"
or skip "man errors aren't especially portable", 1;
#####

But when I go to https://en.wikipedia.org/wiki/Mandoc, I read​:

#####
While mandoc works well with the mdoc manuals used in the BSD
Operating Systems, it poorly handles older troff macros such as man,
me, and the roff language itself. This makes it a poor fit for Linux
distributions, which primarily use man troff macros and low-level
roff for their manual pages.
#####

When I got to mandoc's own website and look for information as to
which OSes it runs on (http​://mdocml.bsd.lv/ports.html), I find that
mandoc is indeed primarily a BSD program, but has an official port on
Arch Linux and unofficial ports to Slackware Linux and Crux Linux.
Notably absent​: Debian and distributions built on top of Debian,
such as Ubuntu (which I have).

I downloaded the mandoc source code and acked for the error message
cited by OP Andreas Voegele. I found​:

#####
[mdocml-1.13.3] 34 $ ack 'No entry for' .
main.c
623​: "%s​: No entry for %s in the manual.\n",
#####

Since I've found the error message, I'm willing to apply the patch
submitted -- but I would like either a +1 from another committer or a
confirmation from someone using, say, Arch Linux.

+1 from me. There is no harm in that patch, and since it helps pass a
test, I think it should be applied in 5.25.

Thank you very much.

Thanks. Applied to blead in commit 8fe07b3.

--
James E Keenan (jkeenan@​cpan.org)

@p5pRT p5pRT closed this as completed May 9, 2016
@p5pRT
Copy link
Author

p5pRT commented May 9, 2016

@jkeenan - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant