Codebase list cups-filters / 62e2f09
New upstream version 1.13.1 Didier Raboud 7 years ago
8 changed file(s) with 119 addition(s) and 69 deletion(s). Raw diff Collapse all Expand all
0 INSTALL - OpenPrinting CUPS Filters v1.13.0 - 2016-12-09
0 INSTALL - OpenPrinting CUPS Filters v1.13.1 - 2016-12-17
11 --------------------------------------------------------
22
33 This file describes how to compile and install OpenPrinting CUPS
0 NEWS - OpenPrinting CUPS Filters v1.13.0 - 2016-12-09
0 NEWS - OpenPrinting CUPS Filters v1.13.1 - 2016-12-17
11 -----------------------------------------------------
2
3 CHANGES IN V1.13.1
4
5 - cups-browsed: Avoid erroring out when restarting after a
6 crash (with generated queues not deleted due to the crash)
7 and the configuration option
8 CreateRemoteCUPSPrinterQueues=No being set.
9 - cups-browsed: If CUPS is stopped while cups-browsed is
10 running and there are queue for IPP network printers (not
11 remote CUPS queues) on restart of CUPS the still existing
12 local CUPS queue is not correctly re-connected with
13 cups-browsed and therefore gets removed after a
14 timeout. This should be fixed after a clean-up of
15 re-connecting with remaining queues from a previous session
16 (Debian bug #848223).
17 - cups-browsed: Generated queues did not get removed on
18 shutdown (Debian bug #848167).
19 - libcupsfilters: Let PPD generator for driverless printing
20 suppress page sizes which the printer reports more than
21 once (CUPS Issue #4933).
22 - driverless, libcupsfilters: Make "driverless list" output
23 and output of driverless as CUPS backend in discovery mode
24 add the word "driverless" to its output, to make it easier
25 to set up driverless printers with printer setup tools.
26 Made the NickName of the generated PPDs also match with the
27 "driverless list" output.
228
329 CHANGES IN V1.13.0
430
0 README - OpenPrinting CUPS Filters v1.13.0 - 2016-12-09
0 README - OpenPrinting CUPS Filters v1.13.1 - 2016-12-17
11 -------------------------------------------------------
22
33 Looking for compile instructions? Read the file "INSTALL.txt"
00 #! /bin/sh
11 # Guess values for system-dependent variables and create Makefiles.
2 # Generated by GNU Autoconf 2.69 for cups-filters 1.13.0.
2 # Generated by GNU Autoconf 2.69 for cups-filters 1.13.1.
33 #
44 #
55 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
586586 # Identity of this package.
587587 PACKAGE_NAME='cups-filters'
588588 PACKAGE_TARNAME='cups-filters'
589 PACKAGE_VERSION='1.13.0'
590 PACKAGE_STRING='cups-filters 1.13.0'
589 PACKAGE_VERSION='1.13.1'
590 PACKAGE_STRING='cups-filters 1.13.1'
591591 PACKAGE_BUGREPORT=''
592592 PACKAGE_URL=''
593593
14921492 # Omit some internal or obsolete options to make the list less imposing.
14931493 # This message is too long to be a string in the A/UX 3.1 sh.
14941494 cat <<_ACEOF
1495 \`configure' configures cups-filters 1.13.0 to adapt to many kinds of systems.
1495 \`configure' configures cups-filters 1.13.1 to adapt to many kinds of systems.
14961496
14971497 Usage: $0 [OPTION]... [VAR=VALUE]...
14981498
15631563
15641564 if test -n "$ac_init_help"; then
15651565 case $ac_init_help in
1566 short | recursive ) echo "Configuration of cups-filters 1.13.0:";;
1566 short | recursive ) echo "Configuration of cups-filters 1.13.1:";;
15671567 esac
15681568 cat <<\_ACEOF
15691569
17871787 test -n "$ac_init_help" && exit $ac_status
17881788 if $ac_init_version; then
17891789 cat <<\_ACEOF
1790 cups-filters configure 1.13.0
1790 cups-filters configure 1.13.1
17911791 generated by GNU Autoconf 2.69
17921792
17931793 Copyright (C) 2012 Free Software Foundation, Inc.
24252425 This file contains any messages produced by compilers while
24262426 running configure, to aid debugging if configure makes a mistake.
24272427
2428 It was created by cups-filters $as_me 1.13.0, which was
2428 It was created by cups-filters $as_me 1.13.1, which was
24292429 generated by GNU Autoconf 2.69. Invocation command line was
24302430
24312431 $ $0 $@
34603460
34613461 # Define the identity of the package.
34623462 PACKAGE='cups-filters'
3463 VERSION='1.13.0'
3463 VERSION='1.13.1'
34643464
34653465
34663466 cat >>confdefs.h <<_ACEOF
2105221052 # report actual input values of CONFIG_FILES etc. instead of their
2105321053 # values after options handling.
2105421054 ac_log="
21055 This file was extended by cups-filters $as_me 1.13.0, which was
21055 This file was extended by cups-filters $as_me 1.13.1, which was
2105621056 generated by GNU Autoconf 2.69. Invocation command line was
2105721057
2105821058 CONFIG_FILES = $CONFIG_FILES
2111821118 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2111921119 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
2112021120 ac_cs_version="\\
21121 cups-filters config.status 1.13.0
21121 cups-filters config.status 1.13.1
2112221122 configured by $0, generated by GNU Autoconf 2.69,
2112321123 with options \\"\$ac_cs_config\\"
2112421124
66 # ====================
77 m4_define([cups_filters_version_major],[1])
88 m4_define([cups_filters_version_minor],[13])
9 m4_define([cups_filters_version_micro],[0])
9 m4_define([cups_filters_version_micro],[1])
1010 m4_define([cups_filters_version],[cups_filters_version_major.cups_filters_version_minor.cups_filters_version_micro])
1111
1212 # =============
330330 int duplex) /* O - Error/status message */
331331 {
332332 cups_file_t *fp; /* PPD file */
333 cups_array_t *sizes; /* Media sizes we've added */
333334 ipp_attribute_t *attr, /* xxx-supported */
334335 *defattr, /* xxx-default */
335336 *x_dim, *y_dim; /* Media dimensions */
477478 cupsFilePrintf(fp, "*Manufacturer: \"%s\"\n", make);
478479 cupsFilePrintf(fp, "*ModelName: \"%s %s\"\n", make, model);
479480 cupsFilePrintf(fp, "*Product: \"(%s %s)\"\n", make, model);
480 cupsFilePrintf(fp, "*NickName: \"%s %s, cups-filters %s\"\n", make, model,
481 cupsFilePrintf(fp, "*NickName: \"%s %s, driverless, cups-filters %s\"\n", make, model,
481482 VERSION);
482483 cupsFilePrintf(fp, "*ShortNickName: \"%s %s\"\n", make, model);
483484
634635 cupsFilePrintf(fp, "*OpenUI *PageSize: PickOne\n"
635636 "*OrderDependency: 10 AnySetup *PageSize\n"
636637 "*DefaultPageSize: %s\n", ppdname);
638
639 sizes = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0,
640 (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
641
637642 for (i = 0, count = ippGetCount(attr); i < count; i ++)
638643 {
639644 if (ippGetValueTag(attr) == IPP_TAG_BEGIN_COLLECTION)
652657 char twidth[256], /* Width string */
653658 tlength[256]; /* Length string */
654659
660 if (cupsArrayFind(sizes, (void *)pwg->ppd))
661 {
662 cupsFilePrintf(fp, "*%% warning: Duplicate size '%s' reported by printer.\n",
663 pwg->ppd);
664 continue;
665 }
666
667 cupsArrayAdd(sizes, (void *)pwg->ppd);
668
655669 _cupsStrFormatd(twidth, twidth + sizeof(twidth), pwg->width * 72.0 / 2540.0, loc);
656670 _cupsStrFormatd(tlength, tlength + sizeof(tlength), pwg->length * 72.0 / 2540.0, loc);
657671
659673 }
660674 }
661675 cupsFilePuts(fp, "*CloseUI: *PageSize\n");
676
677 cupsArrayDelete(sizes);
678 sizes = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0,
679 (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
662680
663681 cupsFilePrintf(fp, "*OpenUI *PageRegion: PickOne\n"
664682 "*OrderDependency: 10 AnySetup *PageRegion\n"
681699 char twidth[256], /* Width string */
682700 tlength[256]; /* Length string */
683701
702 if (cupsArrayFind(sizes, (void *)pwg->ppd))
703 continue;
704
705 cupsArrayAdd(sizes, (void *)pwg->ppd);
706
684707 _cupsStrFormatd(twidth, twidth + sizeof(twidth), pwg->width * 72.0 / 2540.0, loc);
685708 _cupsStrFormatd(tlength, tlength + sizeof(tlength), pwg->length * 72.0 / 2540.0, loc);
686709
688711 }
689712 }
690713 cupsFilePuts(fp, "*CloseUI: *PageRegion\n");
714
715 cupsArrayDelete(sizes);
716 sizes = cupsArrayNew3((cups_array_func_t)strcmp, NULL, NULL, 0,
717 (cups_acopy_func_t)strdup, (cups_afree_func_t)free);
691718
692719 cupsFilePrintf(fp, "*DefaultImageableArea: %s\n"
693720 "*DefaultPaperDimension: %s\n", ppdname, ppdname);
713740 twidth[256], /* Width string */
714741 tlength[256]; /* Length string */
715742
743 if (cupsArrayFind(sizes, (void *)pwg->ppd))
744 continue;
745
746 cupsArrayAdd(sizes, (void *)pwg->ppd);
747
716748 _cupsStrFormatd(tleft, tleft + sizeof(tleft), left * 72.0 / 2540.0, loc);
717749 _cupsStrFormatd(tbottom, tbottom + sizeof(tbottom), bottom * 72.0 / 2540.0, loc);
718750 _cupsStrFormatd(tright, tright + sizeof(tright), (pwg->width - right) * 72.0 / 2540.0, loc);
724756 cupsFilePrintf(fp, "*PaperDimension %s: \"%s %s\"\n", pwg->ppd, twidth, tlength);
725757 }
726758 }
759 cupsArrayDelete(sizes);
727760 } else {
728761 cupsFilePrintf(fp,
729762 "*%% Printer did not supply page size info via IPP, using defaults\n"
29742974 /* Flag to mark whether this printer was discovered through a legacy
29752975 CUPS broadcast (1) or through DNS-SD/Bonjour (0) */
29762976 p->is_legacy = 0;
2977
2978 if (is_cups_queue) {
2979 if (CreateRemoteCUPSPrinterQueues == 0) {
2977
2978 /* Remote CUPS printer or local queue remaining from previous cups-browsed
2979 session */
2980 if (is_cups_queue == 1 || is_cups_queue == -1) {
2981 if (is_cups_queue == 1 && CreateRemoteCUPSPrinterQueues == 0) {
29802982 debug_printf("Printer %s (%s) is a remote CUPS printer and cups-browsed is not configured to set up such printers automatically, ignoring this printer.\n",
29812983 p->name, p->uri);
29822984 goto fail;
29832985 }
2984 /* Our local queue must be raw, so that the PPD file and driver
2985 on the remote CUPS server get used */
2986 /* For a remote CUPS printer Our local queue must be raw, so that the
2987 PPD file and driver on the remote CUPS server get used */
29862988 p->netprinter = 0;
29872989 p->ppd = NULL;
29882990 p->model = NULL;
43004302 char *backup_queue_name = NULL, *local_queue_name = NULL,
43014303 *local_queue_name_lower = NULL;
43024304 int is_cups_queue;
4303 /*size_t hl = 0;*/
4304 gboolean create = TRUE;
43054305
43064306
43074307 is_cups_queue = 0;
44504450
44514451 local_queue_name = remote_queue;
44524452
4453 /* Is there a local queue with the same URI as the remote queue? */
4454 if (g_hash_table_find (local_printers,
4455 local_printer_has_uri,
4456 uri))
4457 create = FALSE;
4458
4459 if (create) {
4460 /* Is there a local queue with the name of the remote queue? */
4453 /* Is there a local queue with the name of the remote queue? */
4454 local_queue_name_lower = g_ascii_strdown(local_queue_name, -1);
4455 local_printer = g_hash_table_lookup (local_printers,
4456 local_queue_name_lower);
4457 free(local_queue_name_lower);
4458 /* Only consider CUPS queues not created by us */
4459 if (local_printer && !local_printer->cups_browsed_controlled) {
4460 /* Found local queue with same name as remote queue */
4461 /* Is there a local queue with the name <queue>@<host>? */
4462 local_queue_name = backup_queue_name;
4463 debug_printf("%s already taken, using fallback name: %s\n",
4464 remote_queue, local_queue_name);
44614465 local_queue_name_lower = g_ascii_strdown(local_queue_name, -1);
44624466 local_printer = g_hash_table_lookup (local_printers,
44634467 local_queue_name_lower);
44644468 free(local_queue_name_lower);
4465 /* Only consider CUPS queues not created by us */
44664469 if (local_printer && !local_printer->cups_browsed_controlled) {
4467 /* Found local queue with same name as remote queue */
4468 /* Is there a local queue with the name <queue>@<host>? */
4469 local_queue_name = backup_queue_name;
4470 debug_printf("%s already taken, using fallback name: %s\n",
4471 remote_queue, local_queue_name);
4472 local_queue_name_lower = g_ascii_strdown(local_queue_name, -1);
4473 local_printer = g_hash_table_lookup (local_printers,
4474 local_queue_name_lower);
4475 free(local_queue_name_lower);
4476 if (local_printer && !local_printer->cups_browsed_controlled) {
4477 /* Found also a local queue with name <queue>@<host>, so
4478 ignore this remote printer */
4479 debug_printf("%s also taken, printer ignored.\n",
4480 local_queue_name);
4481 free (backup_queue_name);
4482 free (remote_host);
4483 free (pdl);
4484 free (remote_queue);
4485 free (make_model);
4486 return NULL;
4487 }
4470 /* Found also a local queue with name <queue>@<host>, so
4471 ignore this remote printer */
4472 debug_printf("%s also taken, printer ignored.\n",
4473 local_queue_name);
4474 free (backup_queue_name);
4475 free (remote_host);
4476 free (pdl);
4477 free (remote_queue);
4478 free (make_model);
4479 return NULL;
44884480 }
44894481 }
44904482
45114503 (!strcasecmp(p->host, remote_host) && p->port == port)))
45124504 break;
45134505
4514 if (!create) {
4506 /* Is there a local queue with the same URI as the remote queue? */
4507 if (!p && g_hash_table_find (local_printers,
4508 local_printer_has_uri,
4509 uri)) {
4510 /* Found a local queue with the same URI as our discovered printer
4511 would get, so ignore this remote printer */
4512 debug_printf("Printer with URI %s already exists, printer ignored.\n",
4513 uri);
45154514 free (remote_host);
45164515 free (backup_queue_name);
45174516 free (pdl);
45184517 free (remote_queue);
45194518 free (make_model);
4520 if (p) {
4521 return p;
4522 } else {
4523 /* Found a local queue with the same URI as our discovered printer
4524 would get, so ignore this remote printer */
4525 debug_printf("Printer with URI %s already exists, printer ignored.\n",
4526 uri);
4527 return NULL;
4528 }
4519 return NULL;
45294520 }
45304521
45314522 if (p) {
46284619 free (p->domain);
46294620 p->domain = strdup(domain);
46304621 }
4622 p->netprinter = is_cups_queue ? 0 : 1;
46314623 } else {
46324624
46334625 /* We need to create a local queue pointing to the
66136605 /* Queue found, add to our list */
66146606 p = create_local_queue (name,
66156607 printer->device_uri,
6616 "", "", 0, "", "", "", NULL, 0, 0, NULL, NULL, 1);
6608 "", "", 0, "", "", "", NULL, 0, 0, NULL, NULL, -1);
66176609 if (p) {
66186610 /* Mark as unconfirmed, if no Avahi report of this queue appears
66196611 in a certain time frame, we will remove the queue */
71177109 g_object_unref (proxy);
71187110
71197111 /* Remove all queues which we have set up */
7120 for (p = (remote_printer_t *)cupsArrayFirst(remote_printers);
7121 p; p = (remote_printer_t *)cupsArrayNext(remote_printers)) {
7112 while ((p = (remote_printer_t *)cupsArrayFirst(remote_printers)) != NULL) {
71227113 p->status = STATUS_DISAPPEARED;
71237114 p->timeout = time(NULL) + TIMEOUT_IMMEDIATELY;
7124 }
7125 recheck_timer();
7115 handle_cups_queues(NULL);
7116 }
71267117
71277118 cancel_subscription (subscription_id);
71287119 if (cups_notifier)
309309
310310 if (mode == 1)
311311 /* Call with "list" argument (PPD generator in list mode */
312 printf("\"driverless:%s\" en \"%s\" \"%s, cups-filters " VERSION
312 printf("\"driverless:%s\" en \"%s\" \"%s, driverless, cups-filters " VERSION
313313 "\" \"%s\"\n", service_uri, make, make_and_model, device_id);
314314 else
315315 /* Call without arguments and env variable "SOFTWARE" starting
316316 with "CUPS" (Backend in discovery mode) */
317 printf("network %s \"%s\" \"%s (via IPP)\" \"%s\" \"\"\n", service_uri, make_and_model, make_and_model, device_id);
317 printf("network %s \"%s\" \"%s (driverless)\" \"%s\" \"\"\n", service_uri, make_and_model, make_and_model, device_id);
318318
319319 read_error:
320320 continue;