- Use upstream patch for STR #3356 (bug #526405).

This commit is contained in:
Tim Waugh 2009-10-07 16:46:04 +00:00
parent 4a94f7b1ab
commit 1a31e8311f
2 changed files with 103 additions and 12 deletions

View File

@ -1,13 +1,101 @@
diff -up cups-1.4.1/scheduler/printers.c.str3356 cups-1.4.1/scheduler/printers.c diff -up cups-1.4.1/scheduler/ipp.c.str3356 cups-1.4.1/scheduler/ipp.c
--- cups-1.4.1/scheduler/printers.c.str3356 2009-09-30 12:02:53.467761538 +0100 --- cups-1.4.1/scheduler/ipp.c.str3356 2009-10-07 17:26:27.504800579 +0100
+++ cups-1.4.1/scheduler/printers.c 2009-09-30 12:03:28.489636706 +0100 +++ cups-1.4.1/scheduler/ipp.c 2009-10-07 17:26:31.311800539 +0100
@@ -3993,7 +3993,8 @@ load_ppd(cupsd_printer_t *p) /* I - Pri @@ -2324,8 +2324,9 @@ add_printer(cupsd_client_t *con, /* I -
ippDelete(p->ppd_attrs); dstfile[1024]; /* Destination Script/PPD file */
p->ppd_attrs = ippNew(); int modify; /* Non-zero if we are modifying */
char newname[IPP_MAX_NAME]; /* New printer name */
- int need_restart_job; /* Need to restart job? */
- int set_device_uri, /* Did we set the device URI? */
+ int changed_driver, /* Changed the PPD/interface script? */
+ need_restart_job, /* Need to restart job? */
+ set_device_uri, /* Did we set the device URI? */
set_port_monitor; /* Did we set the port monitor? */
- if (cache_info.st_mtime >= ppd_info.st_mtime &&
+ if (ppd_info.st_mtime != 1 && @@ -2469,6 +2470,7 @@ add_printer(cupsd_client_t *con, /* I -
+ cache_info.st_mtime >= ppd_info.st_mtime && * Look for attributes and copy them over as needed...
(cache = cupsFileOpen(cache_name, "r")) != NULL) */
+ changed_driver = 0;
need_restart_job = 0;
if ((attr = ippFindAttribute(con->request, "printer-location",
@@ -2731,6 +2733,7 @@ add_printer(cupsd_client_t *con, /* I -
if (con->filename)
{ {
/* need_restart_job = 1;
+ changed_driver = 1;
strlcpy(srcfile, con->filename, sizeof(srcfile));
@@ -2801,18 +2804,6 @@ add_printer(cupsd_client_t *con, /* I -
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Copied PPD file successfully!");
chmod(dstfile, 0644);
-
-#ifdef __APPLE__
- /*
- * (Re)register color profiles...
- */
-
- if (!RunUser)
- {
- apple_unregister_profiles(printer);
- apple_register_profiles(printer);
- }
-#endif /* __APPLE__ */
}
else
{
@@ -2829,6 +2820,7 @@ add_printer(cupsd_client_t *con, /* I -
IPP_TAG_NAME)) != NULL)
{
need_restart_job = 1;
+ changed_driver = 1;
if (!strcmp(attr->values[0].string.text, "raw"))
{
@@ -2866,19 +2858,33 @@ add_printer(cupsd_client_t *con, /* I -
cupsdLogMessage(CUPSD_LOG_DEBUG,
"Copied PPD file successfully!");
chmod(dstfile, 0644);
+ }
+ }
+
+ if (changed_driver)
+ {
+ /*
+ * If we changed the PPD/interface script, then remove the printer's cache
+ * file...
+ */
+
+ char cache_name[1024]; /* Cache filename for printer attrs */
+
+ snprintf(cache_name, sizeof(cache_name), "%s/%s.ipp", CacheDir,
+ printer->name);
+ unlink(cache_name);
#ifdef __APPLE__
- /*
- * (Re)register color profiles...
- */
+ /*
+ * (Re)register color profiles...
+ */
- if (!RunUser)
- {
- apple_unregister_profiles(printer);
- apple_register_profiles(printer);
- }
-#endif /* __APPLE__ */
+ if (!RunUser)
+ {
+ apple_unregister_profiles(printer);
+ apple_register_profiles(printer);
}
+#endif /* __APPLE__ */
}
/*

View File

@ -9,7 +9,7 @@
Summary: Common Unix Printing System Summary: Common Unix Printing System
Name: cups Name: cups
Version: 1.4.1 Version: 1.4.1
Release: 7%{?dist} Release: 8%{?dist}
License: GPLv2 License: GPLv2
Group: System Environment/Daemons Group: System Environment/Daemons
Source: http://ftp.easysw.com/pub/cups/1.4.0/cups-%{version}-source.tar.bz2 Source: http://ftp.easysw.com/pub/cups/1.4.0/cups-%{version}-source.tar.bz2
@ -509,6 +509,9 @@ rm -rf $RPM_BUILD_ROOT
%{php_extdir}/phpcups.so %{php_extdir}/phpcups.so
%changelog %changelog
* Wed Oct 7 2009 Tim Waugh <twaugh@redhat.com> 1:1.4.1-8
- Use upstream patch for STR #3356 (bug #526405).
* Fri Oct 2 2009 Tim Waugh <twaugh@redhat.com> 1:1.4.1-7 * Fri Oct 2 2009 Tim Waugh <twaugh@redhat.com> 1:1.4.1-7
- Fixed orientation of page labels when printing text in landscape - Fixed orientation of page labels when printing text in landscape
mode (bug #520141, STR #3334). mode (bug #520141, STR #3334).