[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[groff] 01/01: grog.pl: add handling of first lines like .\" [eprt], ig
From: |
Bernd Warken |
Subject: |
[groff] 01/01: grog.pl: add handling of first lines like .\" [eprt], ignore $Sp grog.man, groff_char.man: use license website instead of postal address |
Date: |
Mon, 26 May 2014 18:59:00 +0000 |
bwarken pushed a commit to branch master
in repository groff.
commit dfaed933279c029339522d87a2819cf23542b6ae
Author: Bernd Warken <address@hidden>
Date: Mon May 26 20:58:13 2014 +0200
grog.pl: add handling of first lines like .\" [eprt], ignore $Sp
grog.man,groff_char.man: use license website instead of postal address
---
ChangeLog | 25 ++++++++++++++------
man/groff_char.man | 30 +++++++++++++++----------
src/roff/grog/grog.man | 58 ++++++++++++++++++++++++++---------------------
src/roff/grog/grog.pl | 42 +++++++++++++++++++++++++++++-----
4 files changed, 102 insertions(+), 53 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a913d24..666b18b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2014-05-26 Bernd Warken <address@hidden>
+
+ * src/roff/grog/grog.pl: Add detection of `.\" [eprt]' as first
+ line to `grog'. Change usage of `$Sp' to reasonable efforts in
+ `groff'.
+
+ * src/roff/grog/grog.man, man/groff_char.man: Add website for
+ license text, not only the postage address.
+
2014-04-03 Steffen Nurpmeso <address@hidden>
* */Makefile.*: Path quoting fixes, whitespace, formatting.
@@ -99,7 +108,7 @@
Problem reported by Ted Harding <address@hidden> in a
thread starting with
- http://lists.gnu.org/archive/html/groff/2014-03/msg00181.html
+ http://lists.gnu.org/archive/html/groff/2014-03/msg00181.html
2014-03-16 Werner LEMBERG <address@hidden>
@@ -129,7 +138,7 @@
See
- http://lists.gnu.org/archive/html/groff/2013-11/msg00026.html
+ http://lists.gnu.org/archive/html/groff/2013-11/msg00026.html
for more.
@@ -153,22 +162,22 @@
* src/roff/groff/Makefile.sub: POSIX conformance.
- - POSIX says that the meaning of the make(1) `$<' macro shall be
+ - POSIX says that the meaning of the make(1) `$<' macro shall be
unspecified except in inference rules. Consequently, use `$?'
for portability.
- That's safe because the rules have only one prerequisite and are
- not `.PHONY', so `$?' will always expand to one item.
+ That's safe because the rules have only one prerequisite and
+ are not `.PHONY', so `$?' will always expand to one item.
- - While here, clean up two instances of superfluous use of cat(1).
+ - While here, clean up two instances of superfluous use of cat(1).
2014-03-11 Ingo Schwarze <address@hidden> (tiny change)
* Makefile.in (dist): Improve.
- - Bugfix: Do not error out if one of the DISTDIRS
+ - Bugfix: Do not error out if one of the DISTDIRS
contains a subdirectory.
- - Make debugging easier by splitting the huge "cd tmp; ...; ..."
+ - Make debugging easier by splitting the huge "cd tmp; ...; ..."
command sequence into several independent shell commands,
such that one can see which command actually fails.
diff --git a/man/groff_char.man b/man/groff_char.man
index bb41163..6e3663a 100644
--- a/man/groff_char.man
+++ b/man/groff_char.man
@@ -17,7 +17,8 @@ groff_char(7)
This file is part of groff (GNU roff).
-File position: <groff_src_top>/man/groff_char.man
+Source file position: <groff_source>/man/groff_char.man
+Installed position: <prefix>/share/man/man7/groff_char.7
Copyright (C) 1989-2004, 2006-2009, 2012, 2014
Free Software Foundation, Inc.
@@ -25,18 +26,23 @@ written by Werner Lemberg <address@hidden>
with additions by Bernd Warken <address@hidden>
revised to use real tables by Eric S. Raymond <address@hidden>
-Permission is granted to copy, distribute and/or modify this document
-under the terms of the GNU Free Documentation License, Version 1.3 or
-any later version published by the Free Software Foundation; with the
-Invariant Sections being this .ig-section and AUTHOR, with no
-Front-Cover Texts, and with no Back-Cover Texts.
+This file is part of `groff'.
-A copy of the Free Documentation License is included as a file called
-FDL in the main directory of the groff source package.
-..
-.ig
-A copy of the GNU Free Documentation License is also available in this
-Debian package as /usr/share/doc/groff/copyright.
+`groff' is free software; you can redistribute it and/or modify it
+under the terms of the GNU General Public License as published by the
+Free Software Foundation, either version 2 of the License, or (at your
+option) any later version.
+
+`groff' is distributed in the hope that it will be useful, but WITHOUT
+ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program. If not, see
+<http://www.gnu.org/licenses/gpl-2.0.html>.
+
+Latest update: 26 May 2014
..
.
.\" --------------------------------------------------------------------
diff --git a/src/roff/grog/grog.man b/src/roff/grog/grog.man
index f236fb3..837772d 100644
--- a/src/roff/grog/grog.man
+++ b/src/roff/grog/grog.man
@@ -10,7 +10,7 @@ grog.1 - man page for grog (section 1)
Source file position: <groff_source_top>/src/roff/grog/grog.man
Installed position: $prefix/share/man/man1/grog.1
-Last Update: 22 Jan 2011
+Last Update: 26 May 2014
..
.de co
Copyright (C) 1989\[en]2003, 2006, 2007, 2009\[en]2012, 2014
@@ -23,6 +23,7 @@ Werner Lemberg
.ME .
Rewritten and put under GPL by Bernd Warken <address@hidden>.
.
+.
.P
This file is part of
.IR grog ,
@@ -30,33 +31,38 @@ which is part of
.IR groff ,
a free software project.
.
-You can redistribute it and/or modify it under the terms of the
-.nh
-.B "GNU General Public License"
-.hy
-(\f[CR]GPL\f[]) as published by the
-.nh
-.BR "Free Software Foundation" ,
-.hy
-either version\~2, or (at your option) any later version.
+.I groff
+is free software; you can redistribute it and/or modify it under the
+terms of the
+.I GNU General Public License
+as published by the
+.IR "Free Software Foundation" ,
+either
+.I version 2
+of the License, or (at your option) any later version.
.
-.P
-You should have received a copy of the \f[CR]GNU General Public
-License\f[] along with
-.IR groff ,
-see the files \%\f[CB]COPYING\f[] and \%\f[CB]LICENSE\f[] in the top
-directory of the
+.
+P
.I groff
-source package.
-.
-Or read the
-.I man\~page
-.BR gpl (1).
-You can also write to the
-.nh
-.B "Free Software Foundation, 51 Franklin St \[en] Fifth Floor, Boston,"
-.BR "MA 02110-1301, USA" .
-.hy
+is distributed in the hope that it will be useful, but
+.IR "WITHOUT ANY WARRANTY" ;
+without even the implied warranty of
+.I MERCHANTABILITY
+or
+.IR "FITNESS FOR A PARTICULAR PURPOSE" .
+.
+See the
+.B GNU General Public License
+for more details.
+
+You should have received a copy of the
+.I GNU General Public License
+along with this program.
+.
+If not, see
+.UR http://\:www.gnu.org/\:licenses/\:gpl-2.0.html
+GPL2
+.UE .
..
.
.
diff --git a/src/roff/grog/grog.pl b/src/roff/grog/grog.pl
index 0cdd4d8..6a246bc 100644
--- a/src/roff/grog/grog.pl
+++ b/src/roff/grog/grog.pl
@@ -14,8 +14,8 @@
# This file is part of `grog', which is part of `groff'.
# `groff' is free software; you can redistribute it and/or modify it
-# under the terms of the GNU General Public License (GPL) as published
-# by the Free Software Foundation, either version 2 of the License, or
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
# `groff' is distributed in the hope that it will be useful, but
@@ -24,10 +24,11 @@
# General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see
+# <http://www.gnu.org/licenses/gpl-2.0.html>.
########################################################################
-my $Last_Update = '27 Feb 2014';
+my $Last_Update = '26 May 2014';
########################################################################
require v5.6;
@@ -45,7 +46,8 @@ my $Prog = $0;
}
#my $Sp = "[\\s\\n]";
-my $Sp = qr([\s\n]);
+#my $Sp = qr([\s\n]);
+my $Sp = '';
my @Command; # stores the final output
my @Mparams; # stores the options -m*
@@ -79,7 +81,7 @@ my %Groff = (
'tbl' => 0,
);
-{
+{ # command line arguments except file names
my @filespec = ();
my $double_minus = 0;
my $was_minus = 0;
@@ -138,7 +140,7 @@ my %Groff = (
@ARGV = @filespec;
}
-foreach my $arg (@ARGV) {
+foreach my $arg (@ARGV) { # test for each file name in the arguments
&process($arg, 0);
}
@@ -146,14 +148,40 @@ sub process {
my ($filename, $level) = @_;
local(*FILE);
my %macros;
+ my $first_line = 1; # we are now in reading the first line
if (!open(FILE, $filename eq "-" ? $filename : "< $filename")) {
print STDERR "$Prog: can't open \`$filename': $!";
exit 1 unless $level;
return;
}
+
while (<FILE>) {
chomp;
+
+ if ( $first_line ) { # in first line test on e, p, r, t
+ $first_line = 0; # end of first line
+
+ if ( /^\.\\"\s*(.+)$/ ) {
+ my $_ = $1;
+ if ( /e/ ) {
+ $Groff{'eqn'}++;
+ }
+ if ( /p/ ) {
+ $Groff{'pic'}++;
+ }
+ if ( /r/ ) {
+ $Groff{'refer'}++;
+ }
+ if ( /t/ ) {
+ $Groff{'tbl'}++;
+ }
+ next;
+ }
+ }
+
+ # $first_line no longer needed in the following
+
next unless ( /^[.']/ );
next if ( /^[.']{2}/ );
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [groff] 01/01: grog.pl: add handling of first lines like .\" [eprt], ignore $Sp grog.man, groff_char.man: use license website instead of postal address,
Bernd Warken <=