bugGNU troff - Bugs: bug #53271, m4/groff.m4: improve search for...

 
 

bug #53271: m4/groff.m4: improve search for paper size on machines using /etc/papersize

Submitted by:  Bjarni Ingi Gislason <bjarniig>
Submitted on:  Sat 03 Mar 2018 12:18:36 AM UTC  
 
Category:  None Severity:  1 - Wish
Item Group:  Build/Installation Status:  Fixed
Privacy:  Public Assigned to:  G. Branden Robinson <gbranden>
Open/Closed:  Closed Planned Release:  1.22.4

Add a New Comment (Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 12 Nov 2018 10:52:30 PM UTC, comment #5: 

Fixed in efea81c75f831ddc6717c2ef25556e0f49d1f679.

G. Branden Robinson <gbranden>
Project MemberIn charge of this item.
Mon 12 Nov 2018 07:45:31 PM UTC, comment #4: 

Why not just do this?

If /etc/papersize exists, use it.

diff --git a/m4/groff.m4 b/m4/groff.m4
index 13772dc1..b9f2ef45 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -776,14 +776,18 @@ AC_DEFUN([GROFF_BROKEN_SPOOLER_FLAGS],

AC_DEFUN([GROFF_PAGE],
   [AC_MSG_CHECKING([default paper size])
-   groff_prefix="$prefix"
+   groff_prefix=$prefix
    test "x$prefix" = "xNONE" && groff_prefix=$ac_default_prefix
+   if test -z "$PAGE" && test -r /etc/papersize; then
+     PAGE=`cat /etc/papersize`
+   fi
+
    if test -z "$PAGE"; then
      descfile=
      if test -r "$groff_prefix"/share/groff/font/devps/DESC; then
-       descfile="$groff_prefix"/share/groff/font/devps/DESC
+       descfile=$groff_prefix/share/groff/font/devps/DESC
      elif test -r "$groff_prefix"/lib/groff/font/devps/DESC; then
-       descfile="$groff_prefix"/lib/groff/font/devps/DESC
+       descfile=$groff_prefix/lib/groff/font/devps/DESC
      else
        for f in "$groff_prefix"/share/groff/*/font/devps/DESC; do
         if test -r "$f"; then

(I also reverted some variable quoting that wasn't needed; thanks to Colin Watson for the helpful citations.)

G. Branden Robinson <gbranden>
Project MemberIn charge of this item.
Sat 28 Apr 2018 03:03:23 AM UTC, comment #3: 

From b079ea6d099b0ea93eacb5ca113a67c0d02e3513 Mon Sep 17 00:00:00 2001
From: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
Date: Sat, 28 Apr 2018 01:39:12 +0000
Subject: [PATCH] m4/groff.m4: Find '[aA]4' anywhere in the 'papersize' line

  In the Debian distribution the "a4" is not found, as it is not the first
argument of the "papersize" line.

Signed-off-by: Bjarni Ingi Gislason <bjarniig@rhi.hi.is>
---
m4/groff.m4 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/m4/groff.m4 b/m4/groff.m4
index f749b479..f846a802 100644
--- a/m4/groff.m4
+++ b/m4/groff.m4
@@ -796,7 +796,7 @@ AC_DEFUN([GROFF_PAGE],
      if test -n "$descfile"; then
        if grep ['^paperlength[         ]\+841890'] $descfile >/dev/null 2>&1; then
          PAGE=A4
-       elif grep ['^papersize[         ]\+[aA]4'] $descfile >/dev/null 2>&1; then
+       elif grep ['^papersize.*[         ]\+[aA]4'] $descfile > /dev/null 2>&1; then
          PAGE=A4
        fi
      fi
--
2.17.0

Bjarni Ingi Gislason <bjarniig>
Mon 23 Apr 2018 12:18:37 PM UTC, comment #2: 

Bjarni is referring to the GROFF_PAGE macro in m4/groff.m4.

G. Branden Robinson <gbranden>
Project MemberIn charge of this item.
Sat 03 Mar 2018 12:47:08 AM UTC, comment #1: 

  In Debian the DESC file contains "papersize /etc/papersize a4" so
nothing is found.

Bjarni Ingi Gislason <bjarniig>
Sat 03 Mar 2018 12:18:36 AM UTC, original submission:  

Subject: configure: Missing places for finding "PAGE"

  The right paper size is not found on a computer without a fully
qualified domain name (FQDN).

1) Search the file "/etc/papersize" if it exists
  Example:

a4

2) use the output from "locale LC_PAPER"
  Example:

297
210
ISO-8859-1

3) Use the value of "LANG" or the output of "locale" to find the
country.

Bjarni Ingi Gislason <bjarniig>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by gbranden (Updated the item)
  • -email is unavailable- added by bjarniig (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

     

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-11-12 gbranden StatusIn Progress => Fixed
        Open/ClosedOpen => Closed
        Planned ReleaseNone => 1.22.4
    2018-11-12 gbranden StatusNone => In Progress
        Assigned toNone => gbranden
        Summarym4/groff.m4: improve search for paper size on machines without domain names => m4/groff.m4: improve search for paper size on machines using /etc/papersize
    2018-04-23 gbranden Severity3 - Normal => 1 - Wish
        Summaryconfigure: Missing places for finding "PAGE => m4/groff.m4: improve search for paper size on machines without domain names

    Back to the top


    Powered by Savane 3.5