Bug 512739

Summary: foomatic ppd's should avoid perl
Product: [Fedora] Fedora Reporter: Adam Jackson <ajax>
Component: foomatic-dbAssignee: Tim Waugh <twaugh>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: rawhideCC: jpopelka, mclasen, twaugh
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 4.0-3.20090702.fc12 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-08-18 08:51:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 461234    
Bug Blocks: 473302    

Description Adam Jackson 2009-07-20 15:59:45 UTC
Description of problem:

Something like a quarter of the PPDs invoke perl.  Almost all of these appear to be for stream editing to select paper size or tray, and can be trivially replaced with the equivalent sed invocation.  perl is something like 30M on disk, so this is non-trivial space for live media.

As an example, /usr/share/foomatic/db/source/PPD/Gestetner/PXL/Gestetner-Pro_906EX_PXL.ppd.gz contains:

*FoomaticRIPOptionSetting PageSize=A5: " -sPAPERSIZE=a5 -sOutputFile=- - | perl -p -e &quot;s/\xf8\x28\xc0.\xf8\x25/\xf8\x28\xc0\x0f\xf8\x25/g&quot;"

The 'perl -p -e' here can be trivially replaced with 'sed'.

Comment 1 Matthias Clasen 2009-07-30 06:15:32 UTC
foomatic is now the last package that pulls perl onto the live cd. So getting this done would give us _big_ space savings.

Comment 2 Tim Waugh 2009-07-30 08:48:54 UTC
Examining this more closely I think it is a much bigger project than I first thought.  There are two types of PPD available from foomatic:

1. the 'manufacturer's own' PPD files, of which the one quoted is meant to be an example,
2. PPD files generated from the XML data

To actually get one of the generated PPD files you need to have invoked the foomatic CUPS driver (/usr/lib/cups/driver/foomatic, i.e. /usr/bin/foomatic-ppdfile), which is written in perl. (CUPS will do this for you as part of adding a printer.)

If you already had PPDs set up, everything you need is in C except for the filtration parts, which of course can be fixed but they are currently shipped in the same package, which will still require perl due to the foomatic CUPS driver.

So aside from re-implementing all of foomatic-db-engine in C there are two options to look at:

1. Splitting out the foomatic-db parts from the foomatic package, so the PPDs are available in a separate package which can go on the Live CD -- as in bug #461234.

2. Just not shipping foomatic on the Live CD and dropping the 'Requires: foomatic' line from system-config-printer.

The question is: is it too late for me to split foomatic into two separate source packages?

Comment 3 Matthias Clasen 2009-07-31 14:17:16 UTC
I've being doing several package splits over the last few days to help the live cd. So I think you are definitively not too late to do this.

Comment 4 Tim Waugh 2009-08-18 08:51:18 UTC
Done.