From 98ca1b63d480d8da6c98a22d046546f8118b8067 Mon Sep 17 00:00:00 2001 From: Tim Dickson Date: Thu, 1 Oct 2020 18:36:27 +0100 Subject: system/epson-inkjet-printer-escpr2: Updated for version 1.1.20. Signed-off-by: Dave Woodfall Signed-off-by: Willy Sudiarto Raharjo --- system/epson-inkjet-printer-escpr2/fixrm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 system/epson-inkjet-printer-escpr2/fixrm (limited to 'system/epson-inkjet-printer-escpr2/fixrm') diff --git a/system/epson-inkjet-printer-escpr2/fixrm b/system/epson-inkjet-printer-escpr2/fixrm new file mode 100644 index 000000000000..ffc0942dd775 --- /dev/null +++ b/system/epson-inkjet-printer-escpr2/fixrm @@ -0,0 +1,29 @@ +#!/bin/sh +#fixrm is a little script to limit the items on each line so the line +#is less than 72 characters. it is used by the maintainer when creating +#the README.models file for this package, and for the epson-inkjet-printer-escpr2 +#slackbuild. It takes the list posted on a single long first line, and spreads +#them over as many lines as needed. +# +#paste the list from the epson website into an empty README.models and run this +#script in the same directory + +FNAME="README.models" +MAXLEN=${MAXLEN:-72} +#make sure MAXLEN is a integer bigger than 39 +MAXLEN=`echo $MAXLEN|awk '($1<40) {print "40"} (int($1)>39) {print int($1) }'` +if [ -e $FNAME ]&&[ `cat $FNAME|head -n1|awk '{print length($0)}'` -gt $MAXLEN ]; then + #only do something if the file exists, and thefirst line is longer than it + #should be. + TMPFILE=rmtmp + mv README.models $TMPFILE + cat $TMPFILE|awk -v mlen="$MAXLEN" -F', ' 'BEGIN{curline="";mlen=mlen-2} +{ for (i=1;i<=NF; i++) + { { n=0; l=length(curline)+length($i) } + if (l0) {print curline} +}'>README.models + rm $TMPFILE +fi -- cgit v1.2.3