]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
driverless: Do not execute if NO_DRIVERLESS_PPDS env variable is set
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 10 Nov 2021 19:20:47 +0000 (20:20 +0100)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 10 Nov 2021 19:20:47 +0000 (20:20 +0100)
If we have a Printer Application which wants to make available all the
CUPS drivers installed on the system (in the directories where CUPOS
would look for them), we have on many systems also the driverless
utility of cups-filters installed, linked into /usr/lib/cups/backend,
to discover driverless IPP printers, and in /usr/lib/cups/driver, to
auto-generate CUPS PPD files for them.

The Printer Application is supposed to make printers available which
use the installed drivers but does not need to make available
driverless IPP printers. Therefore we do not want that the Printer
Application executes the driverless utility to discover printers and
list possible PPD files for them. But we also do not want to remove
the driverless utility.

Therefore we add in this commit a facility to de-activate the
driverless utility by the presence of the NO_DRIVERLESS_PPDS
environment variable. If the variable is defined, the utility exits
right away when it gets called, not doing anything. So a Printer
Application looking for printers and PPD files by running CUPS
backends and dynamich PPD generator executables for CUPS in their
usual places in the file system can set the variable and a perhaps
installed driverless utility will simply do nothing and so the Printer
Application will not list all driverless IPP as supported with a
"driverless" driver choice.

The driverless utility is only thought out as a retro-fit of
driverless printers into classic printer setup tools (and as debugging
tool) but not for PPD-retro-fitting Printer Applications.

utils/driverless.c

index addf0add460dca9268b89a4d397cade3a7e5e5a0..c36f6e0d83c38edd7000648c25af52a7053bab81 100644 (file)
@@ -688,6 +688,13 @@ main(int argc, char*argv[]) {
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
 
+ /*
+  * Do not run at all if the NO_DRIVERLESS_PPDS environment variable is set
+  */
+
+  if (getenv("NO_DRIVERLESS_PPDS"))
+    return (0);
+
  /*
   * Make sure status messages are not buffered...
   */