aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorcy <cy@FreeBSD.org>2011-08-27 08:10:00 +0800
committercy <cy@FreeBSD.org>2011-08-27 08:10:00 +0800
commitfa1ed449bd1d427b070917b28517c8a492668a2d (patch)
treea04d90fce5558ac221180fea761ccb329ea38d71 /misc
parent7a247f346105053b20c04e2c707dbb05d3add69a (diff)
downloadfreebsd-ports-gnome-fa1ed449bd1d427b070917b28517c8a492668a2d.tar.gz
freebsd-ports-gnome-fa1ed449bd1d427b070917b28517c8a492668a2d.tar.zst
freebsd-ports-gnome-fa1ed449bd1d427b070917b28517c8a492668a2d.zip
Fix broken gman.pl script to display man pages in a browser. HTML rendering
was broken.
Diffstat (limited to 'misc')
-rw-r--r--misc/gman/Makefile2
-rw-r--r--misc/gman/files/patch-gman.pl46
2 files changed, 22 insertions, 26 deletions
diff --git a/misc/gman/Makefile b/misc/gman/Makefile
index 3a524f83076b..1dd674f8e778 100644
--- a/misc/gman/Makefile
+++ b/misc/gman/Makefile
@@ -8,7 +8,7 @@
PORTNAME= gman
PORTVERSION= 0.9.3
-PORTREVISION= 10
+PORTREVISION= 11
CATEGORIES= misc
MASTER_SITES= ${MASTER_SITE_DEBIAN}
MASTER_SITE_SUBDIR= pool/main/g/gman
diff --git a/misc/gman/files/patch-gman.pl b/misc/gman/files/patch-gman.pl
index 765c3dcd7d7c..097cde65a26f 100644
--- a/misc/gman/files/patch-gman.pl
+++ b/misc/gman/files/patch-gman.pl
@@ -1,27 +1,15 @@
---- gman.pl.orig 2011-08-25 13:06:54.517309488 -0700
-+++ gman.pl 2011-08-25 13:12:49.444936858 -0700
-@@ -1,10 +1,10 @@
- #!/usr/bin/perl -w
--use strict;
-
- if (@ARGV != 2) {
- print <<_EOF_;
- Content-type: text/html
-
-+<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
- <html><head><title>gman.pl: invalid use</title></head>
- <body>
- <h1>gman.pl cannot be used without arguments.</h1>
-@@ -14,14 +14,16 @@
- }
+--- gman.pl.orig 2011-08-26 13:11:36.331148726 -0700
++++ gman.pl 2011-08-26 13:52:56.017429820 -0700
+@@ -15,13 +15,16 @@
my $section = $ARGV[0]; # should also have some sanity check
-+my $cut = "/usr/bin/cut -f 1 -d \" \" ";
my $name = $ARGV[1];
-my $man2html = "/usr/lib/cgi-bin/man/man2html";
-my $path = `man -w $section $name`; chomp $path; $path =~ s/\s*$//;
++my $cut = "/usr/bin/cut -f 1 -d \" \" ";
+my $man = "/usr/bin/man";
-+my $man2html = "/usr/local/bin/man2html -nodepage ";
++my $man2html = "/usr/local/bin/man2html";
++my $man2html_args = "-nodepage ";
+my $path = `$man -w $section $name |$cut`; chomp $path; $path =~ s/\s*$//;
unless (-s "$path") {
@@ -32,7 +20,7 @@
}
unless (-s "$path") {
warn "not -s $path\n";
-@@ -29,12 +31,12 @@
+@@ -29,12 +32,12 @@
Content-type: text/html
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
@@ -50,21 +38,29 @@
end_of_line
die;
}
-@@ -44,15 +46,9 @@
- print <<end_of_line;
+@@ -45,19 +48,19 @@
Content-type: text/html
--<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
+ <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
-<HTML><HEAD>
-<TITLE>man2html missing</TITLE>
-</HEAD><BODY>
-<H1>man2html missing</H1>
--
--<p>You have to install <tt>man2html</tt> in order to use this mode in gman.
-+<!DOCTYPE html PUBLIC "-//IETF//DTD HTML 2.0//EN">
++<html><head>
++<title>man2html missing</title>
++</head><body>
++<h1>man2html missing</h1>
+
+ <p>You have to install <tt>man2html</tt> in order to use this mode in gman.
-</BODY></HTML>
+</body></html>
end_of_line
die;
}
+
+-my $page = `$man2html $path`;
++my $page = `$man $section $name | man2html $man2html_args`;
+
+ # $page =~ s/^Content-type: text\/html\n\n// if (not run as cgi...);
+