Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 913751 - app-text/a2ps-4.15.5 Printing with -P options fails with lp backend
Summary: app-text/a2ps-4.15.5 Printing with -P options fails with lp backend
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal critical (vote)
Assignee: Printing Team
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2023-09-07 10:53 UTC by Maurizio Firmani
Modified: 2023-09-07 20:51 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch-src_a2ps-lpr-wrapper (a2ps-4.15-lpr-wrapper.patch,511 bytes, patch)
2023-09-07 10:53 UTC, Maurizio Firmani
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Maurizio Firmani 2023-09-07 10:53:09 UTC
Created attachment 870021 [details, diff]
patch-src_a2ps-lpr-wrapper

This is what happen when executing a2ps with -P name_of_printer option:

$ a2ps -P my_printer file_to_print
[file_to_print (plain): 1 page on 1 sheet]
Usage: a2ps-lpr-wrapper [-d printer] FILE...
[Total: 1 page on 1 sheet] sent to the printer `my_printer'
[3 lines wrapped]

There is an error on a2ps-lpr-wrapper and the file was not printed

If lp is installed, a2ps-lpr-wrapper will use it otherwise it falls back to lpr. However, the #{lp} variable defines the printer specifier as -P. lpr does not take -P, it takes -d.

The specifier needs to differ depending on which backend is being used; -d for lp or -P for lpr.

This bug was already reported on https://savannah.gnu.org/bugs/?64047 with a patch to solve the problem

I made a local portage ebuild with the patch provided and the problem is solved.
Maybe, it should be applied on the official a2ps gentoo ebuild

I provided the patch as an attachment to this report.
Comment 1 Larry the Git Cow gentoo-dev 2023-09-07 20:50:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9b9c9302cfda762c144f9b5611ae0384efff079a

commit 9b9c9302cfda762c144f9b5611ae0384efff079a
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-09-07 20:49:56 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-09-07 20:50:19 +0000

    app-text/a2ps: fix a2ps-lpr-wrapper
    
    Quoting the bug:
    """
    There is an error on a2ps-lpr-wrapper and the file was not printed
    
    If lp is installed, a2ps-lpr-wrapper will use it otherwise it falls back to lpr.
    However, the #{lp} variable defines the printer specifier as -P. lpr does not take -P, it takes -d.
    
    The specifier needs to differ depending on which backend is being used; -d for lp or -P for lpr.
    """
    
    See also the savannah bug (https://savannah.gnu.org/bugs/?64047).
    
    Closes: https://bugs.gentoo.org/913751
    Signed-off-by: Sam James <sam@gentoo.org>

 app-text/a2ps/a2ps-4.15.5-r1.ebuild             | 90 +++++++++++++++++++++++++
 app-text/a2ps/files/a2ps-4.15-lpr-wrapper.patch | 23 +++++++
 2 files changed, 113 insertions(+)