]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Merge changes from CUPS 1.4svn-r7874.
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 28 Aug 2008 22:58:28 +0000 (22:58 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Thu, 28 Aug 2008 22:58:28 +0000 (22:58 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@933 a1ca3aef-8c08-0410-bb20-df032aa958be

12 files changed:
CHANGES-1.3.txt
CHANGES.txt
backend/Makefile
backend/socket.c
backend/usb-darwin.c
doc/help/spec-ipp.html
driver/Makefile
scheduler/Makefile
scheduler/ipp.c
scheduler/job.c
scheduler/job.h
scheduler/printers.c

index d126cfac9e79edf00fbdac3a4c3cd9d93bcf87f9..94039b61d6facf18c54d2728725a9da260ac10bd 100644 (file)
@@ -4,6 +4,8 @@ CHANGES-1.3.txt
 CHANGES IN CUPS V1.3.9
 
        - Documentation updates (STR #2904)
 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.
        - The scheduler required Kerberos authentication for
          all operations on remote Kerberized printers instead
          of just for the operations that needed it.
index 8c672abeb83ad712ef4a2d65a28afa1d7fafe1b4..040b1a9652de6856a67f0d61956c6d1ebe132ccc 100644 (file)
@@ -1,8 +1,10 @@
-CHANGES.txt - 2008-08-04
+CHANGES.txt - 2008-08-28
 ------------------------
 
 CHANGES IN CUPS V1.4b1
 
 ------------------------
 
 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)
        - 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)
index bb9d0f8dc75dcf188415f28ba0e8d05eb84bc093..9c8a96c73bbb620457082a0ac6ef38371b38c163 100644 (file)
@@ -258,7 +258,8 @@ socket:     socket.o ../cups/$(LIBCUPS) libbackend.a
 
 usb:   usb.o ../cups/$(LIBCUPS) libbackend.a
        echo Linking $@...
 
 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
 
 
 usb.o: usb.c usb-darwin.c usb-libusb.c usb-unix.c
 
 
index 70a0891954918059b1e774de9fdacf1d4a35f593..423000f0f64ab508a5eab507b64045a840ff1f8d 100644 (file)
@@ -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 */
   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 */
                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;
   */
 
   wait_time = time(NULL) + 5;
-  while (wait_time >= time(NULL))
-    if (wait_bc(device_fd, 1) <= 0)
+  while (wait_time >= time(&current_time))
+    if (wait_bc(device_fd, wait_time - current_time) <= 0)
       break;
 
   if (waiteof)
       break;
 
   if (waiteof)
index d333795646e53b83f568069ed94eedb0b7610ae3..655273d6c240bed6e76ebec9777d6d05b95e432e 100644 (file)
@@ -1806,13 +1806,22 @@ static void run_legacy_backend(int argc,
 #  else
     cpu_type_t cpu = CPU_TYPE_POWERPC;
 #  endif /* __x86_64__ */
 #  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_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))
     {
     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");
       perror("DEBUG: Unable to exec /usr/libexec/cups/backend/usb");
+      _cupsLangPrintf(stderr, _("Unable to use legacy USB class driver!\n"));
       exit(CUPS_BACKEND_STOP);
     }
 
       exit(CUPS_BACKEND_STOP);
     }
 
index 74df07290baa423979c3a7af030885f19acb0319..e9e05fac5250cdb6fe0ee4830531d91f89aebaa9 100644 (file)
@@ -23,7 +23,7 @@
 
 <h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
 
 
 <h2 class='title'><a name='INTRODUCTION'>Introduction</a></h2>
 
-<p>CUPS 1.1 implements IPP/1.1 and the operations and attributes
+<p>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"
 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 <i>not</i> in the local time zone. If the
 specified time is less than the current time, the job is held until the
 next day.
 
 specified time is less than the current time, the job is held until the
 next day.
 
+<h4><a name="job-media-progress">job-media-progress (integer(0:100))</a><span class='info'>CUPS 1.4</span></h4>
+
+<p>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).</p>
+
 <h4><a name="job-printer-state-message">job-printer-state-message (text(MAX))</a><span class='info'>CUPS 1.3</span></h4>
 
 <p>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.</p>
 <h4><a name="job-printer-state-message">job-printer-state-message (text(MAX))</a><span class='info'>CUPS 1.3</span></h4>
 
 <p>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.</p>
index 998501e881fd1f87cd9dba748eff63fbf616965e..4692ff9646b2a99523863ae2bd268fd59246c45c 100644 (file)
@@ -53,7 +53,8 @@ LIBTARGETS =  \
                $(LIBCUPSDRIVER) \
                $(LIB32CUPSDRIVER) \
                $(LIB64CUPSDRIVER) \
                $(LIBCUPSDRIVER) \
                $(LIB32CUPSDRIVER) \
                $(LIB64CUPSDRIVER) \
-               libcupsdriver.a \
+               libcupsdriver.a
+UNITTARGETS =  \
                testcmyk \
                testdither \
                testrgb
                testcmyk \
                testdither \
                testrgb
@@ -83,7 +84,7 @@ libs:         $(LIBTARGETS)
 # Make unit tests...
 #
 
 # Make unit tests...
 #
 
-unittests:
+unittests:     $(UNITTARGETS)
 
 
 #
 
 
 #
@@ -93,7 +94,7 @@ unittests:
 clean:
        $(RM) $(OBJS) core
        $(RM) *.bck core.*
 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
        $(RM) -r test
        $(RM) libcupsdriver.so libcupsdriver.sl libcupsdriver.dylib
        $(RM) -r 32bit 64bit
index 2921faf7f4dd7c1ab1ea045ad2169a6f3e6fdd04..e38238f9f1ec1028c2ec48e4a331fdf18e79e7cb 100644 (file)
@@ -70,8 +70,14 @@ LIBTARGETS = \
                $(LIBCUPSMIME) \
                $(LIB32CUPSMIME) \
                $(LIB64CUPSMIME) \
                $(LIBCUPSMIME) \
                $(LIB32CUPSMIME) \
                $(LIB64CUPSMIME) \
-               libcupsmime.a \
-               testmime
+               libcupsmime.a
+
+UNITTARGETS =  \
+               testdirsvc \
+               testlpd \
+               testmime \
+               testspeed \
+               testsub
 
 TARGETS        =       \
                $(LIBTARGETS) \
 
 TARGETS        =       \
                $(LIBTARGETS) \
@@ -81,10 +87,6 @@ TARGETS      =       \
                cups-driverd \
                cups-lpd \
                cups-polld \
                cups-driverd \
                cups-lpd \
                cups-polld \
-               testdirsvc \
-               testlpd \
-               testspeed \
-               testsub
 
 
 #
 
 
 #
@@ -105,7 +107,7 @@ libs:               $(LIBTARGETS)
 # Make unit tests...
 #
 
 # Make unit tests...
 #
 
-unittests:
+unittests:     $(UNITTARGETS)
 
 
 #
 
 
 #
@@ -114,7 +116,7 @@ unittests:
 
 clean:
        $(RM) $(OBJS)
 
 clean:
        $(RM) $(OBJS)
-       $(RM) $(TARGETS) convert
+       $(RM) $(TARGETS) $(UNITTARGETS) convert
        $(RM) libcupsmime.so libcupsmime.sl libcupsmime.dylib
        $(RM) -r 32bit 64bit
 
        $(RM) libcupsmime.so libcupsmime.sl libcupsmime.dylib
        $(RM) -r 32bit 64bit
 
index 35a61a696f3a624b1b56c7ee4e7cffc92d3bbec2..1bc53445c96934f1e00cffd38b32cca12076dfa8 100644 (file)
@@ -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()                   - 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
  *   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
  */
 
 static void
@@ -3393,8 +3393,8 @@ apple_register_profiles(
     device_name  = CFDictionaryCreateMutable(kCFAllocatorDefault, 0,
                                             &kCFTypeDictionaryKeyCallBacks,
                                             &kCFTypeDictionaryValueCallBacks);
     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)
     {
 
     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);
 
     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);
   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-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");
       cupsArrayAdd(ra, "job-media-sheets");
       cupsArrayAdd(ra, "job-media-sheets-completed");
       cupsArrayAdd(ra, "job-message-from-operator");
index e2d74c6329e22191daceb31b0327e65b19996248..26a9b6c008da30558707f4468cf0eb7dd6e57c70 100644 (file)
@@ -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->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);
 
 
   cupsdSetPrinterState(printer, IPP_PRINTER_PROCESSING, 0);
 
@@ -3715,6 +3715,23 @@ update_job(cupsd_job_t *job)             /* I - Job to check */
          cupsdMarkDirty(CUPSD_DIRTY_PRINTERS);
       }
 
          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);
       if ((attr = cupsGetOption("printer-alert", num_attrs, attrs)) != NULL)
       {
         cupsdSetString(&job->printer->alert, attr);
index e1e30432464e6ea800f37a654bc639c6c71afd55..d382f6b2f4ac01b43d433b2e4cfdfd58abf25233 100644 (file)
@@ -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 */
                        *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 */
 #ifdef HAVE_GSSAPI
   krb5_ccache          ccache;         /* Kerberos credential cache */
   char                 *ccname;        /* KRB5CCNAME environment variable */
index eeed48f6603244fdfa59edac1dc0b4d4f8e72a6f..618defd999c9e3acef54b7b267a8551ed6332410 100644 (file)
@@ -2057,20 +2057,26 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
 
     if (auth)
     {
 
     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;
       }
       {
        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
       {
        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;
       {
        auth_supported = "negotiate";
        num_air        = 1;
@@ -2078,7 +2084,7 @@ cupsdSetPrinterAttrs(cupsd_printer_t *p)/* I - Printer to setup */
       }
 #endif /* HAVE_GSSAPI */
 
       }
 #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;
         p->type |= CUPS_PRINTER_AUTHENTICATED;
       else
         p->type &= ~CUPS_PRINTER_AUTHENTICATED;