$NetBSD: patch-prnt_hpijs_foomatic-rip-hplip,v 1.2 2020/01/04 04:24:12 khorben Exp $

perl-5.22 compatibility

--- prnt/hpijs/foomatic-rip-hplip.orig	2019-12-10 05:00:36.000000000 +0000
+++ prnt/hpijs/foomatic-rip-hplip
@@ -1,4 +1,4 @@
-#!/usr/bin/perl
+#!/usr/pkg/bin/perl
 # The above Perl path may vary on your system; fix it!!! -*- perl -*-
 
 use strict;
@@ -44,19 +44,19 @@ my $ripversion='$Revision=3.0.2.131$';
 # possibly other stuff.	 The default path is often fine on Linux, but
 # may not be on other systems.
 #
-my $execpath = "/usr/bin:/usr/local/bin:/usr/bin:/bin";
+my $execpath = "/usr/bin:/usr/pkg/bin:/usr/pkg/bin:/usr/local/bin:/usr/bin:/bin";
 
 # CUPS raster drivers are searched here
-my $cupsfilterpath = "/usr/lib/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter";
+my $cupsfilterpath = "/usr/lib/cups/filter:/usr/pkg/libexec/cups/filter:/usr/pkg/libexec/cups/filter:/usr/local/lib/cups/filter:/usr/local/libexec/cups/filter:/opt/cups/filter:/usr/lib/cups/filter";
 
 # Location of the configuration file "filter.conf", this file can be
 # used to change the settings of foomatic-rip without editing
 # foomatic-rip. itself. This variable must contain the full pathname 
 # of the directory which contains the configuration file, usually
-# "/etc/foomatic".
+# "/usr/pkg/etc/foomatic".
 # Some versions of configure do not fully expand $sysconfdir
-my $prefix = "/usr";
-my $configpath = "/etc/foomatic";
+my $prefix = "/usr/pkg";
+my $configpath = "/usr/pkg/etc/foomatic";
 
 # For the stuff below, the settings in the configuration file have priority.
 
@@ -66,7 +66,7 @@ my $accounting_prolog = "";
 
 # Enter here your personal command for converting non-postscript files
 # (especially text) to PostScript. If you leave it blank, at first the
-# line "textfilter: ..." from /etc/foomatic/filter.conf is read and
+# line "textfilter: ..." from /usr/pkg/etc/foomatic/filter.conf is read and
 # then the commands given on the list below are tried, beginning with
 # the first one.
 # You can set this to "a2ps", "enscript" or "mpage" to select one of the 
@@ -97,7 +97,7 @@ my $modern_shell = '';
 # Set debug to 1 to enable the debug logfile for this filter; it will
 # appear as defined by $logfile. It will contain status from this
 # filter, plus the renderer's stderr output. You can also add a line
-# "debug: 1" to your /etc/foomatic/filter.conf to get all your
+# "debug: 1" to your /usr/pkg/etc/foomatic/filter.conf to get all your
 # Foomatic filters into debug mode.
 #
 # WARNING: This logfile is a security hole; do not use in production.
@@ -761,7 +761,7 @@ my( $cups_jobid, $cups_user, $cups_jobti
     $cups_filename );
 if ($spooler eq 'cups') {
 
-    # Use CUPS font path ("FontPath" in /etc/cups/cupsd.conf)
+    # Use CUPS font path ("FontPath" in /usr/pkg/etc/cups/cupsd.conf)
     if ($ENV{'CUPS_FONTPATH'}) {
 	$ENV{'GS_LIB'} = $ENV{'CUPS_FONTPATH'} .
 	    ($ENV{'GS_LIB'} ? ":$ENV{'GS_LIB'}" : "");
@@ -1038,12 +1038,16 @@ if (($spooler eq 'direct') || ($spooler 
 	    $ppdfile = "$configpath/direct/${printer}.ppd";
 	} elsif (-r "$configpath/${printer}.ppd") { # system dir
 	    $ppdfile = "$configpath/${printer}.ppd";
-	} elsif (-r "/etc/cups/ppd/${printer}.ppd") { # CUPS config dir
-	    $ppdfile = "/etc/cups/ppd/${printer}.ppd";
+	} elsif (-r "/usr/pkg/etc/cups/ppd/${printer}.ppd") { # CUPS config dir
+	    $ppdfile = "/usr/pkg/etc/cups/ppd/${printer}.ppd";
 	} elsif (-r "/usr/local/etc/cups/ppd/${printer}.ppd") {
 	    $ppdfile = "/usr/local/etc/cups/ppd/${printer}.ppd";
 	} elsif (-r "/usr/share/ppr/PPDFiles/${printer}.ppd") { # PPR PPDs
 	    $ppdfile = "/usr/share/ppr/PPDFiles/${printer}.ppd";
+	} elsif (-r "/usr/pkg/share/ppr/PPDFiles/${printer}.ppd") { # PPR PPDs
+	    $ppdfile = "/usr/pkg/share/ppr/PPDFiles/${printer}.ppd";
+	} elsif (-r "/usr/pkg/share/ppr/PPDFiles/${printer}.ppd") { # PPR PPDs
+	    $ppdfile = "/usr/pkg/share/ppr/PPDFiles/${printer}.ppd";
 	} elsif (-r "/usr/local/share/ppr/PPDFiles/${printer}.ppd") {
 	    $ppdfile = "/usr/local/share/ppr/PPDFiles/${printer}.ppd";
 	} else {
@@ -1653,7 +1657,7 @@ if ($#datablob >= 0) {
 ## if nexessary.
 
 my $dontparse = 0;
-if ((!defined(@{$dat->{'args'}})) ||
+if ((!@{$dat->{'args'}}) ||
     ($#{$dat->{'args'}} < 0)) {
     # We don't have any options, so we do not need to parse the
     # PostScript data
