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

 
 

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

Submitter:  Bjarni Ingi Gislason <bjarniig>
Submitted:  Sat 03 Mar 2018 12:18:36 AM UTC
   
 
Category:  General Severity:  1 - Wish
Item Group:  Build/Installation Status:  Fixed
Privacy:  Public Assigned to:  gbranden
Open/Closed:  Closed Planned Release:  1.22.4
* Mandatory Fields

Add a New Comment Rich Markup
   

Jump to the original submission

Wed 15 Jun 2022 05:40:19 PM UTC, comment #6: 


commit efea81c75f831ddc6717c2ef25556e0f49d1f679
Author: G. Branden Robinson <g.branden.robinson@gmail.com>
Date:   Mon Nov 12 16:37:01 2018 -0500

    m4/groff.m4 (GROFF_PAGE): Try /etc/papersize 1st.

            Fixes <https://savannah.gnu.org/bugs/index.php?53271>.

commit 2226128d39a505bf71bbb63f0d8e3c0d16aef550
Author: Bertrand Garrigues <bertrand.garrigues@laposte.net>
Date:   Mon Nov 19 00:24:11 2018 +0100

    Fix build on environment where /etc/papersize contains comments

    Issue introduced on commit efea81c75f831ddc6717c2ef25556e0f49d1f679.

    * m4/groff.m4 (GROFF_PAGE): remove comments and get the 1st string
    of '/etc/papersize'.


G. Branden Robinson <gbranden>
Group administrator
Mon 12 Nov 2018 10:52:30 PM UTC, comment #5: 

Fixed in efea81c75f831ddc6717c2ef25556e0f49d1f679.

G. Branden Robinson <gbranden>
Group administrator
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>
Group administrator
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>
Group administrator
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)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 9 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2022-06-15 gbranden CategoryNone General
    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 &quot;PAGE m4/groff.m4: improve search for paper size on machines without domain names

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code