summaryrefslogtreecommitdiff
path: root/systemv
diff options
context:
space:
mode:
authorMichael R Sweet <michael.r.sweet@gmail.com>2018-03-19 18:35:22 -0400
committerMichael R Sweet <michael.r.sweet@gmail.com>2018-03-19 18:35:22 -0400
commit003c1790e990a836d3c66c9ef458f9057de9b674 (patch)
tree452e4cc5d3cfc54be63f2679636e91900969a93b /systemv
parent73c6236f2ceb9f028d0b92a28b2819b24a429e46 (diff)
downloadcups-003c1790e990a836d3c66c9ef458f9057de9b674.tar.gz
Deprecate raw print queues.
Diffstat (limited to 'systemv')
-rw-r--r--systemv/lpadmin.c47
1 files changed, 28 insertions, 19 deletions
diff --git a/systemv/lpadmin.c b/systemv/lpadmin.c
index a43295b5b..93579c5c4 100644
--- a/systemv/lpadmin.c
+++ b/systemv/lpadmin.c
@@ -1,8 +1,8 @@
/*
* "lpadmin" command for CUPS.
*
- * Copyright 2007-2017 by Apple Inc.
- * Copyright 1997-2006 by Easy Software Products.
+ * Copyright © 2007-2018 by Apple Inc.
+ * Copyright © 1997-2006 by Easy Software Products.
*
* Licensed under Apache License v2.0. See the file "LICENSE" for more information.
*/
@@ -42,23 +42,22 @@ static int validate_name(const char *name);
* 'main()' - Parse options and configure the scheduler.
*/
-int
-main(int argc, /* I - Number of command-line arguments */
- char *argv[]) /* I - Command-line arguments */
+int /* O - Exit status */
+main(int argc, /* I - Number of command-line arguments */
+ char *argv[]) /* I - Command-line arguments */
{
- int i; /* Looping var */
- http_t *http; /* Connection to server */
- char *printer, /* Destination printer */
- *pclass, /* Printer class name */
- *opt, /* Option pointer */
- *val; /* Pointer to allow/deny value */
- int num_options; /* Number of options */
- cups_option_t *options; /* Options */
- char *file, /* New PPD file */
- evefile[1024] = "";
- /* IPP Everywhere PPD */
- const char *ppd_name, /* ppd-name value */
- *device_uri; /* device-uri value */
+ int i; /* Looping var */
+ http_t *http; /* Connection to server */
+ char *printer, /* Destination printer */
+ *pclass, /* Printer class name */
+ *opt, /* Option pointer */
+ *val; /* Pointer to allow/deny value */
+ int num_options; /* Number of options */
+ cups_option_t *options; /* Options */
+ char *file, /* New PPD file */
+ evefile[1024] = ""; /* IPP Everywhere PPD */
+ const char *ppd_name, /* ppd-name value */
+ *device_uri; /* device-uri value */
_cupsSetLocale(argv);
@@ -606,7 +605,17 @@ main(int argc, /* I - Number of command-line arguments */
* Set options as needed...
*/
- if ((ppd_name = cupsGetOption("ppd-name", num_options, options)) != NULL && !strcmp(ppd_name, "everywhere") && (device_uri = cupsGetOption("device-uri", num_options, options)) != NULL)
+ ppd_name = cupsGetOption("ppd-name", num_options, options);
+ device_uri = cupsGetOption("device-uri", num_options, options);
+
+ if (ppd_name && !strcmp(ppd_name, "raw"))
+ {
+ _cupsLangPuts(stderr, _("lpadmin: Raw queues are deprecated and will stop working in a future version of CUPS."));
+
+ if (device_uri && (!strncmp(device_uri, "ipp://", 6) || !strncmp(device_uri, "ipps://", 7)) && strstr(device_uri, "/printers/"))
+ _cupsLangPuts(stderr, _("lpadmin: Use the 'everywhere' model for shared printers."));
+ }
+ else if (ppd_name && !strcmp(ppd_name, "everywhere") && device_uri)
{
if ((file = get_printer_ppd(device_uri, evefile, sizeof(evefile), &num_options, &options)) == NULL)
return (1);