Older versions of MagicFilter

version 2.2.k

Harry G. McGavran found an interesting interaction between Berkeley lpd and magicfilter, where both magicfilter and lpd want to reap magicfilter’s children, and sometimes magicfilter doesn’t win. In particular, when magicfilter couldn’t reap the m4 process, it would fail with a complaint about m4 terminating abnormally. In the case of executing m4, the program would have already failed with a message about m4 not being there, so reaping the return value wasn’t necessary.

As a little something extra, the --srcdir feature now works so you can untar magicfilter into directory A and build it in directory B by simply cding into B and doing A/configure.sh. At least it works on Linux and FreeBSD.

version 2.2.j
2.2.k should have been 2.2.j, but I set the version tag BEFORE I committed all the changes that now make up 2.2.k. This is a lesson that trying to do changes when you have a fever of 102f may not lead to the most robust code on the planet.
version 2.2.g

Harry G. McGavran, Jr. of LANL reported a bunch of bugs with the m4 part of magicfilter; The first one was that I had forgotten to quote a defn() in magic.m4.in, so printers that wanted to pass GS_OPTIONS to ghostscript weren’t actually doing that. While fixing that (a trivial fix) he then pointed out (indirectly) that I wasn’t properly quoting a large bunch of ifdef()s either. He then suggested that I modify magicfilter could it could be used as a filter to remote printers when the line printer daemon didn’t support filters on them, so I added a PRINTER capacity to the .def files (this is a command to pipe printer-ready output to instead of simply piping it to stdout. With this and a front-end printer daemon that tries to print to /dev/null, even dumb lpds can be magicfiltered.

After I finished this, I added better support for printing PDF files both on postscript and non-postscript files, plus I now check for hp2pcl or lj2ps during configuration so that PCL files at least have a chance of being printable on non-PCL printers (hp2pcl and lj2ps only support pcl 4, so you need to give configure.sh the --with-pcl flag to enable this feature.)

version 2.2.f
I’d been having trouble getting magicfilter to configure on <a Solaris systems, and very recently I’d found that it wouldn’t configure on pell (SLS Linux, with /bin/sh linked to base 1.13.1 either. So, after getting a report of what turned out to be Yet Another New Solaris Bug, I went back and looked at the configuration system and found about six places where Things Were Not Working. They’re fixed now, and magicfilter now builds on a Solaris box without having to cheat by using ksh
version 2.2.e
Every application needs a --version option. 2.2.d added that option, and 2.2.e makes that option actually work under LPRng, as well as fixing a bug that makes magicfilter dump core when it’s called without any arguments or a bogus printer filter under LPRng.
version 2.2.c
A bug report came in describing a bizarre problem with 2.2.b on a Slackware Linux 8.1 system where magicfilter just wouldn’t print while the builtin filters for LPRng did without complaint. Eventually I tracked down the source of the bug to that installation’s LPRng not wanting to run filters unless they were in /usr/libexec/filters, but in the progress a small collection of buglets were discovered and squished, plus the configuration script now detects LPRng and builds a version of magicfilter that does not process options passed in to the filter (LPRng passes a LOT of options, which seem to change over time. magicfilter doesn’t use them, so we just ignore them now.)
version 2.2.b
2.2.a Fixed a lot of the Irix-won’t-build bugs, but didn’t get all of them: I was doing ${foo:+"bar"} to build a string, which works fine on my main development platforms Mastodon Linux and FreeBSD) but not quite so well on Irix. So, with a heavy sigh, a new Monday creates a new magicfilter release.
version 2.2.a
2.1 didn’t build on Irix, due to a collection of things which gcc likes but the Irix C compiler didn’t and things which didn’t work exactly the same way between BSD, GNU, and Irix utilities. This fixes them, at least on the SGI I’ve got access to.
version 2.1.b
This contains a bunch of little tweaks.
  • magicfilter now supports different papersizes where applicable; the --with-papersize= option to configure.sh allows you to build a version of magicfilter that supports A4 and US Letter pagesizes (this is a restriction of nenscript; the versions of nenscript I have on Mastodon and FreeBSD only support those two pagesizes.
  • The reject() function now returns error status 2 instead of 1, because Berkeley lpd interprets error status 1 as a request to try and reprint the job.
  • The configure.sh scripts have been pretty heavily updated (and both work on FreeBSD 4.5 and Mastodon, so they should work on all modern Unices.)
version 2.1.a
This version adds support for fifo handing in filters – if a filter contains the magic token ${FILE}, output from that filter will be directed through a named pipe to avoid diagnostic messages cluttering it up. Old versions of Ghostscript may suffer from this problem (though I’ve never seen it.)
version 2.0.i
This version fixes some pretty nasty bugs that I managed to never encounter because my network doesn’t, amazingly enough, trigger any of those conditions for me.
version 2.0.g
Broken. It has the annoying feature that it doesn’t return error status from subprocesses, so it will successfully print, then lie and say it doesn’t, which can lead to some hilarious paper wasting.
version 2.0.f
Also broken. But probably amusing if you’re looking to see how clean, precise, and broken my coding can be.
version 2.0.e
Also also broken. Old.
version 2.0.d
Really broken. Older.
version 2.0.c
Yup, you guessed it. Broken. Oldest.