From: msweet Date: Thu, 28 Aug 2008 22:58:28 +0000 (+0000) Subject: Merge changes from CUPS 1.4svn-r7874. X-Git-Tag: release-1.6.3~146 X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fcups.git;a=commitdiff_plain;h=9a4f8274e930ac2dff201dfb9c7af94e8f444f03 Merge changes from CUPS 1.4svn-r7874. git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@933 a1ca3aef-8c08-0410-bb20-df032aa958be --- diff --git a/CHANGES-1.3.txt b/CHANGES-1.3.txt index d126cfac9..94039b61d 100644 --- a/CHANGES-1.3.txt +++ b/CHANGES-1.3.txt @@ -4,6 +4,8 @@ CHANGES-1.3.txt CHANGES IN CUPS V1.3.9 - Documentation updates (STR #2904) + - The scheduler did not correctly update the + auth-info-required value(s) if the AuthType was Default. - The scheduler required Kerberos authentication for all operations on remote Kerberized printers instead of just for the operations that needed it. diff --git a/CHANGES.txt b/CHANGES.txt index 8c672abeb..040b1a965 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,8 +1,10 @@ -CHANGES.txt - 2008-08-04 +CHANGES.txt - 2008-08-28 ------------------------ CHANGES IN CUPS V1.4b1 + - The scheduler now supports a job-media-progress attribute to + track the progress of individual pages. - The sample HP driver now supports A5 (STR #2798) - The CUPS web interface menu item now uses the xdg-open command, when available (STR #2724) diff --git a/backend/Makefile b/backend/Makefile index bb9d0f8dc..9c8a96c73 100644 --- a/backend/Makefile +++ b/backend/Makefile @@ -258,7 +258,8 @@ socket: socket.o ../cups/$(LIBCUPS) libbackend.a usb: usb.o ../cups/$(LIBCUPS) libbackend.a echo Linking $@... - $(CC) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) $(BACKLIBS) $(LIBS) + $(CC) $(ARCHFLAGS) $(LDFLAGS) -o usb usb.o libbackend.a $(LIBUSB) \ + $(BACKLIBS) $(LIBS) usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c diff --git a/backend/socket.c b/backend/socket.c index 70a089195..423000f0f 100644 --- a/backend/socket.c +++ b/backend/socket.c @@ -73,6 +73,7 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ int print_fd; /* Print file */ int copies; /* Number of copies to print */ time_t start_time, /* Time of first connect */ + current_time, /* Current time */ wait_time; /* Time to wait before shutting down socket */ int recoverable; /* Recoverable error shown? */ int contimeout; /* Connection timeout */ @@ -417,8 +418,8 @@ main(int argc, /* I - Number of command-line arguments (6 or 7) */ */ wait_time = time(NULL) + 5; - while (wait_time >= time(NULL)) - if (wait_bc(device_fd, 1) <= 0) + while (wait_time >= time(¤t_time)) + if (wait_bc(device_fd, wait_time - current_time) <= 0) break; if (waiteof) diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index d33379564..655273d6c 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -1806,13 +1806,22 @@ static void run_legacy_backend(int argc, # else cpu_type_t cpu = CPU_TYPE_POWERPC; # endif /* __x86_64__ */ - size_t ocount = 0; + size_t ocount = 1; posix_spawnattr_t attrs; if (!posix_spawnattr_init(&attrs)) { posix_spawnattr_setsigdefault(attrs, &oldmask); - posix_spawnattr_setbinpref_np(attrs, 1, &cpu, &ocount); + if (posix_spawnattr_setbinpref_np(attrs, 1, &cpu, &ocount) || ocount != 1) + { +# ifdef __x86_64__ + perror("DEBUG: Unable to set binary preference to i386"); +# else + perror("DEBUG: Unable to set binary preference to ppc"); +# endif /* __x86_64__ */ + _cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n")); + exit(CUPS_BACKEND_STOP); + } } /* @@ -1827,8 +1836,8 @@ static void run_legacy_backend(int argc, if (posix_spawn(&child_pid, "/usr/libexec/cups/backend/usb", NULL, &attrs, my_argv, environ)) { - _cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n")); perror("DEBUG: Unable to exec /usr/libexec/cups/backend/usb"); + _cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n")); exit(CUPS_BACKEND_STOP); } diff --git a/doc/help/spec-ipp.html b/doc/help/spec-ipp.html index 74df07290..e9e05fac5 100644 --- a/doc/help/spec-ipp.html +++ b/doc/help/spec-ipp.html @@ -23,7 +23,7 @@

Introduction

-

CUPS 1.1 implements IPP/1.1 and the operations and attributes +

CUPS implements IPP/1.1 and the operations and attributes defined in the "IPP: Job and Printer Set Operations", "IPP/1.1: Output-bin Attribute Extension", and "IPP/1.1: finishings 'fold',' trim', and 'bale' attribute values extension" @@ -2184,6 +2184,12 @@ Universal Coordinated Time (UTC) and not in the local time zone. If the specified time is less than the current time, the job is held until the next day. +

job-media-progress (integer(0:100))CUPS 1.4

+ +

The job-media-progress attribute specifies the percentage of completion of +the current page. It is only valid when the job-state attribute has the +"processing" value (5).

+

job-printer-state-message (text(MAX))CUPS 1.3

The job-printer-state-message attribute provides the last known value of the printer-state-message attribute for the printer that processed (or is processing) the job.

diff --git a/driver/Makefile b/driver/Makefile index 998501e88..4692ff964 100644 --- a/driver/Makefile +++ b/driver/Makefile @@ -53,7 +53,8 @@ LIBTARGETS = \ $(LIBCUPSDRIVER) \ $(LIB32CUPSDRIVER) \ $(LIB64CUPSDRIVER) \ - libcupsdriver.a \ + libcupsdriver.a +UNITTARGETS = \ testcmyk \ testdither \ testrgb @@ -83,7 +84,7 @@ libs: $(LIBTARGETS) # Make unit tests... # -unittests: +unittests: $(UNITTARGETS) # @@ -93,7 +94,7 @@ unittests: clean: $(RM) $(OBJS) core $(RM) *.bck core.* - $(RM) $(TARGETS) + $(RM) $(TARGETS) $(UNITTARGETS) $(RM) -r test $(RM) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib $(RM) -r 32bit 64bit diff --git a/scheduler/Makefile b/scheduler/Makefile index 2921faf7f..e38238f9f 100644 --- a/scheduler/Makefile +++ b/scheduler/Makefile @@ -70,8 +70,14 @@ LIBTARGETS = \ $(LIBCUPSMIME) \ $(LIB32CUPSMIME) \ $(LIB64CUPSMIME) \ - libcupsmime.a \ - testmime + libcupsmime.a + +UNITTARGETS = \ + testdirsvc \ + testlpd \ + testmime \ + testspeed \ + testsub TARGETS = \ $(LIBTARGETS) \ @@ -81,10 +87,6 @@ TARGETS = \ cups-driverd \ cups-lpd \ cups-polld \ - testdirsvc \ - testlpd \ - testspeed \ - testsub # @@ -105,7 +107,7 @@ libs: $(LIBTARGETS) # Make unit tests... # -unittests: +unittests: $(UNITTARGETS) # @@ -114,7 +116,7 @@ unittests: clean: $(RM) $(OBJS) - $(RM) $(TARGETS) convert + $(RM) $(TARGETS) $(UNITTARGETS) convert $(RM) libcupsmime.so libcupsmime.sl libcupsmime.dylib $(RM) -r 32bit 64bit diff --git a/scheduler/ipp.c b/scheduler/ipp.c index 35a61a696..1bc53445c 100644 --- a/scheduler/ipp.c +++ b/scheduler/ipp.c @@ -25,7 +25,7 @@ * add_job() - Add a job to a print queue. * add_job_state_reasons() - Add the "job-state-reasons" attribute based * upon the job and printer state... - * add_job_subscriptions() - Add any subcriptions for a job. + * add_job_subscriptions() - Add any subscriptions for a job. * add_job_uuid() - Add job-uuid attribute to a job. * add_printer() - Add a printer to the system. * add_printer_state_reasons() - Add the "printer-state-reasons" attribute @@ -1978,7 +1978,7 @@ add_job_state_reasons( /* - * 'add_job_subscriptions()' - Add any subcriptions for a job. + * 'add_job_subscriptions()' - Add any subscriptions for a job. */ static void @@ -3393,8 +3393,8 @@ apple_register_profiles( device_name = CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); - printer_name = CFStringCreateWithCString(kCFAllocatorDefault, p->name, - kCFStringEncodingUTF8); + printer_name = CFStringCreateWithCString(kCFAllocatorDefault, + p->name, kCFStringEncodingUTF8); if (device_name && printer_name) { @@ -5327,6 +5327,10 @@ copy_job_attrs(cupsd_client_t *con, /* I - Client connection */ ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, "document-count", job->num_files); + if (!ra || cupsArrayFind(ra, "job-media-progress")) + ippAddInteger(con->response, IPP_TAG_JOB, IPP_TAG_INTEGER, + "job-media-progress", job->progress); + if (!ra || cupsArrayFind(ra, "job-more-info")) ippAddString(con->response, IPP_TAG_JOB, IPP_TAG_URI, "job-more-info", NULL, job_uri); @@ -5788,6 +5792,7 @@ create_requested_array(ipp_t *request) /* I - IPP request */ cupsArrayAdd(ra, "job-impressions-completed"); cupsArrayAdd(ra, "job-k-octets"); cupsArrayAdd(ra, "job-k-octets-processed"); + cupsArrayAdd(ra, "job-media-progress"); cupsArrayAdd(ra, "job-media-sheets"); cupsArrayAdd(ra, "job-media-sheets-completed"); cupsArrayAdd(ra, "job-message-from-operator"); diff --git a/scheduler/job.c b/scheduler/job.c index e2d74c632..26a9b6c00 100644 --- a/scheduler/job.c +++ b/scheduler/job.c @@ -2733,10 +2733,10 @@ start_job(cupsd_job_t *job, /* I - Job ID */ job->state->values[0].integer = IPP_JOB_PROCESSING; job->state_value = IPP_JOB_PROCESSING; - - job->status = 0; - job->printer = printer; - printer->job = job; + job->progress = 0; + job->status = 0; + job->printer = printer; + printer->job = job; cupsdSetPrinterState(printer, IPP_PRINTER_PROCESSING, 0); @@ -3715,6 +3715,23 @@ update_job(cupsd_job_t *job) /* I - Job to check */ cupsdMarkDirty(CUPSD_DIRTY_PRINTERS); } + if ((attr = cupsGetOption("job-media-progress", num_attrs, + attrs)) != NULL) + { + int progress = atoi(attr); + + + if (progress >= 0 && progress <= 100) + { + job->progress = progress; + + if (job->sheets) + cupsdAddEvent(CUPSD_EVENT_JOB_PROGRESS, job->printer, job, + "Printing page %d, %d%%", + job->sheets->values[0].integer, job->progress); + } + } + if ((attr = cupsGetOption("printer-alert", num_attrs, attrs)) != NULL) { cupsdSetString(&job->printer->alert, attr); diff --git a/scheduler/job.h b/scheduler/job.h index e1e304324..d382f6b2f 100644 --- a/scheduler/job.h +++ b/scheduler/job.h @@ -58,6 +58,7 @@ typedef struct cupsd_job_s *auth_domain, /* AUTH_DOMAIN environment variable, if any */ *auth_password; /* AUTH_PASSWORD environment variable, if any */ void *profile; /* Security profile */ + int progress; /* Printing progress */ #ifdef HAVE_GSSAPI krb5_ccache ccache; /* Kerberos credential cache */ char *ccname; /* KRB5CCNAME environment variable */ diff --git a/scheduler/printers.c b/scheduler/printers.c index eeed48f66..618defd99 100644 --- a/scheduler/printers.c +++ b/scheduler/printers.c @@ -2057,20 +2057,26 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ if (auth) { - if (auth->type == CUPSD_AUTH_BASIC || auth->type == CUPSD_AUTH_BASICDIGEST) + int auth_type; /* Authentication type */ + + + if ((auth_type = auth->type) == CUPSD_AUTH_DEFAULT) + auth_type = DefaultAuthType; + + if (auth_type == CUPSD_AUTH_BASIC || auth_type == CUPSD_AUTH_BASICDIGEST) { auth_supported = "basic"; num_air = 2; air = air_userpass; } - else if (auth->type == CUPSD_AUTH_DIGEST) + else if (auth_type == CUPSD_AUTH_DIGEST) { auth_supported = "digest"; num_air = 2; air = air_userpass; } #ifdef HAVE_GSSAPI - else if (auth->type == CUPSD_AUTH_NEGOTIATE) + else if (auth_type == CUPSD_AUTH_NEGOTIATE) { auth_supported = "negotiate"; num_air = 1; @@ -2078,7 +2084,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */ } #endif /* HAVE_GSSAPI */ - if (auth->type != CUPSD_AUTH_NONE) + if (auth_type != CUPSD_AUTH_NONE) p->type |= CUPS_PRINTER_AUTHENTICATED; else p->type &= ~CUPS_PRINTER_AUTHENTICATED;