[cups.bugs] [MOD] STR #3827: pstopxl doesn't handle all PPDs InputSlot correctly

Alexandre Bourget alexandre.bourget at savoirfairelinux.com
Tue Apr 12 11:16:37 PDT 2011


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

pstopxl, when it deals with InputSlot, doesn't scan the InputSlot from the
PPD correctly, when there are many options listed.

The responsible code is there:


inputslot=
eval "$(printf "%s" "$5" | sed -nre
's/.*(^|\s)(InputSlot)=(\S+).*/inputslot="${inputslot:-\3}"/p')"
if test -e "$PPD"; then
  eval "$(sed -nre
's/^\*DefaultInputSlot:\s+(\S+).*/inputslot="${inputslot:-\1}"/p' "$PPD")"
fi
echo "DEBUG: InputSlot: $inputslot" >&2
inputslot_val=
if test -n "$inputslot" && test -e "$PPD"; then
  eval "$(sed -nre
's|^\*InputSlot\s+'"$inputslot"'/[^:]+:\s+"\s*<\s*<\s*/MediaPosition\s*([0-9]+)\s*>\s*>\s*setpagedevice\s*".*|inputslot_val="\1"|p'
"$PPD")"
fi
echo "DEBUG: Value for MediaPosition: $inputslot_val" >&2
if test -n "$inputslot_val"; then
  ppd_opts="${ppd_opts:+$ppd_opts }-dMediaPosition=$inputslot_val"
fi


the "eval" line checking for /MediaPosition, .. in the Sharp-provided PPD
file, the InputSlot has some /OtherOptions before the /MediaPosition, and
therefore doesn't match the regexp, and doesn't pass the MediaPosition
accordingly

The solution should be to craft the regexp so that it is a little more
flexible.. and would be compatible with those Sharp-provided PPD files.

pstopxl doesn't seem to have changed, up to Ubuntu Natty... so I guess the
bug is for a more recent version also.

Link: http://www.cups.org/str.php?L3827
Version: 1.3.8
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Sharp-MX-M283N-ps.ppd
Type: application/octet-stream
Size: 63477 bytes
Desc: not available
URL: <http://lists.cups.org/pipermail/cups-devel/attachments/20110412/9c312a38/attachment.obj>


More information about the cups-devel mailing list