| Michael Lossin on Sat, 13 May 2000 11:43:47 +0200 (CEST) |
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
| apsfilter CVS bugs and ideas |
Hi!
Here we go again: some stuff to keep you (presumably Matej) busy...
* It's either gs_version or GS_VERSION in the class handling routine.
* Why do we need a stack for temp files? There shouldn't be whitespace
at all -- mktemp surely doesn't add any, and $$ seems to be safe, too.
(And using whitespace in SEED can easily be avoided.)
* From the BSD-printcap(5) man page:
All filters take stdin as the file, stdout as the printer, may log
either to stderr or using syslog(3), and must not ignore SIGINT.
^^^^^^^^^^^^^^^^^^^^^^
Right now SIGINT is trapped.
* If mktemp is available, but fails for some reason, open_tmp_file()
should fall back to the standard approach. Also mktemp might use the
"-q" option, since the error is handled anyway.
* GS_LIB should always be set to GS_FONTPATH and exported; right now
this only happens if GS_FONTPATH is set to some default value.
* When printing remote, the user name should be reset via "-U $USER".
The BSD-lpr man page says:
-U user
User name to print on the burst page, also for accounting purpos
es. This option is only honored if the real user-id is daemon
(or that specified in the printcap file instead of daemon), and
is intended for those instances where print filters wish to re
queue jobs. ^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^
LPRng-lpr supports it, although calling it an obvious security loophole.
Lacking a remote printer, I can't verify that. Any takers?
* LPRng uses a variety of parameters for input filters, e.g.
-fname for the file name (-> correct a2ps headers!)
-Jjob for the job name (all file names cat'ed)
-Cclass for class info
-Hhost for the hostname (also -hhost)
-Luser for the login name (also -nuser)
-efile for the data file (may be a symlink; can we use that?)
...
So there's no need to create an extra temporary control file.
* At least my version of LPRng (3.5.3) uses "(stdin)" instead of
"(STDIN)", so that should be stripped, too.
* For BSD spoolers: Is there any chance to use the N line in the control
file instead of the J line? As far as I can see, there's only one
control file for multiple prints via "lpr file1 file2 ..." -- annoying.
This is just off the top of my head:
1) We need an external counter "cnt".
If it doesn't exist, write "0" into cnt.
2) Increase cnt by one.
3) Be n the number in cnt; get the nth line of the form "Nname" from
the control file. Use that name for a2ps etc.
4) If there are no more lines like that, delete cnt.
Is it worth the effort? (I guess it's better to switch to LPRng anyway...)
* The mpage support basically works, but there are more options that can
be set (maybe these should be merged with the A2PS-stuff):
ASCII_PAPERSIZE!A4! # \
ASCII_BORDER!True! # \ valid for
ASCII_HEADER!True! # / a2ps and mpage
ASCII_STYLE!2l! # /
A2PS_BASIC!whatever!
MPAGE_BASIC!lotsastuff!
A2PS_OPTS!override_a2ps!
MPAGE_OPTS!override_mpage!
MPAGE_BASIC should be "-f -CISO-Latin.1" or something; headers are a bit
of a problem with mpage: you either lose the page numbers or the _real_
file name (you have to live with "stdin")...
* Checking boolean parameters with [ ! "$bool_var" ] might be misleading;
e.g. A2PS_BORDER!False! actually enables borders...
* I've already suggested this to Andreas: Could we get rid of the "raw"
printer entry in favour of a new class "raw"? (just like with ascii)
This could even work with the "-l" flag to lpr which is passed to the
input filter as "-c". Both BSD and LPRng support it.
* How about using "local" in functions instead of the ugly long names?
(Is that POSIX compliant?)
* Maintaining parallel apsfilterrc files is a pain in the ass :-\
I think an additional /etc/apsfilterrc for the general options _plus_
$SPOOLDIR/apsfilterrc for the printer specific stuff _plus_
$HOMEDIR/.apsfilter/* for the user would be best. (The first two must
then be trusted w.r.t PS_UTILS and PRINT_DVI.)
Also the template apsfilterrc should have all entries commented out,
with reasonable defaults in the script itself.
* In case of a fatal() error, maybe the user (in addition to root)
should be notified by mail if /dev/console can't be opened for writing
(or always?).
* The new Sketch version includes a magic entry, so support is easy.
(magic: "Sketch document text", filter: sk2ps [part of Sketch package])
print_sketch()
{
export PYTHONPATH # <- needs to be set in apfilterrc
eval "$@" | print_ps sk2ps /dev/stdin
}
* fig2dev doesn't like the "-P" option? Hmmm... my 3.2pl1 works okay, and
I don't know if leaving it out breaks anything.
* convert is part of the ImageMagick package: http://www.imagemagick.org
(Just in case you want to do some vdiff testing vs pnmtops...)
* How about support for encoded files? These should be treated like any
ordinary packer, I guess. (At least uudecode works.)
* acroread tmp file creation should be alright, since umask is 077.
* Does redir_gs_msg.ps work for you? My setup (gs 6.01) still directs
error messages to stdout instead of stderr (= log).
Don't despair, there's more to come... someday
Michael