aboutsummaryrefslogtreecommitdiff
path: root/print/foomatic-db-engine
diff options
context:
space:
mode:
authorMikhail Teterin <mi@FreeBSD.org>2015-02-15 13:42:59 +0000
committerMikhail Teterin <mi@FreeBSD.org>2015-02-15 13:42:59 +0000
commit0affa18976f0c0a8e93bb74737f6c75395dbd7ce (patch)
treee6705bd9dbe31939ae3c3c9d39a9829709ab08ff /print/foomatic-db-engine
parente43c8dd4bb644dd3b86b4843fc9fa3ba32a06923 (diff)
downloadports-0affa18976f0c0a8e93bb74737f6c75395dbd7ce.tar.gz
ports-0affa18976f0c0a8e93bb74737f6c75395dbd7ce.zip
Add a patch, that removes the reference to bash from
one of the installed scripts. (This was caught by the "QA step" here.)
Notes
Notes: svn path=/head/; revision=379036
Diffstat (limited to 'print/foomatic-db-engine')
-rw-r--r--print/foomatic-db-engine/files/patch-foomatic-getpjloptions.in44
1 files changed, 44 insertions, 0 deletions
diff --git a/print/foomatic-db-engine/files/patch-foomatic-getpjloptions.in b/print/foomatic-db-engine/files/patch-foomatic-getpjloptions.in
new file mode 100644
index 000000000000..4fed5b958c1c
--- /dev/null
+++ b/print/foomatic-db-engine/files/patch-foomatic-getpjloptions.in
@@ -0,0 +1,44 @@
+Do not require bash -- BSD sh(1) is perfectly capable of executing
+this script.
+
+While here, replace use of perl in removal of some characters from
+streams with the much lighter tr(1) invocations. Strip out
+carriage-returns (\r) characters from remote printer's responses too.
+
+Remove useless braces around variable-names.
+
+ -mi
+
+--- foomatic-getpjloptions.in 2015-02-14 07:21:56.000000000 -0500
++++ foomatic-getpjloptions.in 2015-02-15 07:36:23.000000000 -0500
+@@ -1,3 +1,3 @@
+-#!@SH@
++#!/bin/sh
+ #
+ # Polls PJL options from local or network printers
+@@ -23,6 +23,5 @@
+ NC=@NC@
+ CAT=@CAT@
+-PRINTF=@PRINTF@
+-PERL=@PERL@
++PRINTF=printf # sh builtin
+
+ usage(){
+@@ -63,12 +62,13 @@
+- # We have two arguments, do ethernet printer request
++ # We have two arguments, do network printer request
+ # Poll the printer's answer and filter out the newpage characters
++ # as well as the carriage-returns (\r or, in octal, 015)
+- ${NC} -w 3 ${1} ${2} 2>/dev/null | ${PERL} -p -e "s/\014//"
++ $NC -w 3 $1 $2 2>/dev/null | tr -d "\015\014"
+ else
+ # We have one argument, do local printer request
+ # Send commands to printer port
+- ${CAT} > ${1}
++ $CAT > $1
+ # Wait ten seconds for the printer to process the request
+ sleep 10
+ # Poll the printer's answer and filter out the newpage and CR characters
+- ${CAT} < ${1} | ${PERL} -p -e "s/[\015\014]//"
++ exec tr -d "\015\014" < $1
+ fi