rpms/gutenprint/devel gutenprint-locale.patch, NONE, 1.1 gutenprint.spec, 1.41, 1.42

Tim Waugh twaugh at fedoraproject.org
Fri Dec 5 15:48:40 UTC 2008


Author: twaugh

Update of /cvs/pkgs/rpms/gutenprint/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv5152

Modified Files:
	gutenprint.spec 
Added Files:
	gutenprint-locale.patch 
Log Message:
* Fri Dec  5 2008 Tim Waugh <twaugh at redhat.com> 5.2.2-2
- Fixed generation of globalized PPDs.


gutenprint-locale.patch:

--- NEW FILE gutenprint-locale.patch ---
diff -up gutenprint-5.2.2/src/cups/genppd.c.locale gutenprint-5.2.2/src/cups/genppd.c
--- gutenprint-5.2.2/src/cups/genppd.c.locale	2008-09-26 00:41:00.000000000 +0100
+++ gutenprint-5.2.2/src/cups/genppd.c	2008-12-05 13:46:48.000000000 +0000
@@ -1,5 +1,5 @@
 /*
- * "$Id: genppd.c,v 1.170 2008/09/25 23:41:00 rlk Exp $"
+ * "$Id: genppd.c,v 1.171 2008/12/05 03:27:20 easysw Exp $"
  *
  *   PPD file generation program for the CUPS drivers.
  *
@@ -200,6 +200,13 @@ int				    /* O - Exit status */
 main(int  argc,			    /* I - Number of command-line arguments */
      char *argv[])		    /* I - Command-line arguments */
 {
+ /*
+  * Force POSIX locale, since stp_init incorrectly calls setlocale...
+  */
+
+  putenv((char *)"LANG=C");
+  putenv((char *)"LC_ALL=C");
+  putenv((char *)"LC_NUMERIC=C");
 
  /*
   * Initialise libgutenprint
@@ -893,6 +900,7 @@ write_ppd(
 		min_height,
 		max_width,
 		max_height;
+  char		dimstr[255];		/* Dimension string */
   stp_parameter_t desc;
   stp_parameter_list_t param_list;
   const stp_param_string_t *opt;
@@ -1794,13 +1802,10 @@ write_ppd(
 		      for (i = desc.bounds.dimension.lower;
 			   i <= desc.bounds.dimension.upper; i++)
 			{
-			  /* FIXME
-			   * For now, just use mm; we'll fix it later
-			   * for the locale-appropriate setting.
-			   * --rlk 20040818
-			   */
-			  gzprintf(fp, "*Stp%s %d/%.1f mm: \"\"\n",
-				   desc.name, i, ((double) i) * 25.4 / 72);
+			  snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
+			           (double)i * 25.4 / 72.0);
+			  gzprintf(fp, "*Stp%s %d/%s: \"\"\n",
+				   desc.name, i, dimstr);
 			}
 
 		      print_close_ui = 0;
@@ -2197,19 +2202,14 @@ write_ppd(
 			  if (!desc.is_mandatory)
 			    gzprintf(fp, "*%s.Stp%s %s/%s: \"\"\n", lang, desc.name,
 				     "None", _("None"));
-			  if (localize_numbers)
+			  /* Unlike the other fields, dimensions are not strictly numbers */
+			  for (i = desc.bounds.dimension.lower;
+			       i <= desc.bounds.dimension.upper; i++)
 			    {
-			      for (i = desc.bounds.dimension.lower;
-				   i <= desc.bounds.dimension.upper; i++)
-				{
-				  /* FIXME
-				   * For now, just use mm; we'll fix it later
-				   * for the locale-appropriate setting.
-				   * --rlk 20040818
-				   */
-				  gzprintf(fp, "*%s.Stp%s %d/%.1f mm: \"\"\n", lang,
-					   desc.name, i, ((double) i) * 25.4 / 72);
-				}
+			      snprintf(dimstr, sizeof(dimstr), _("%.1f mm"),
+				       (double)i * 25.4 / 72.0);
+			      gzprintf(fp, "*%s.Stp%s %d/%s: \"\"\n", lang,
+				       desc.name, i, dimstr);
 			    }
 			  gzprintf(fp, "*%s.ParamCustomStp%s Value/%s: \"\"\n", lang,
 				   desc.name, _("Value"));
@@ -2320,5 +2320,5 @@ write_ppd(
 
 
 /*
- * End of "$Id: genppd.c,v 1.170 2008/09/25 23:41:00 rlk Exp $".
+ * End of "$Id: genppd.c,v 1.171 2008/12/05 03:27:20 easysw Exp $".
  */


Index: gutenprint.spec
===================================================================
RCS file: /cvs/pkgs/rpms/gutenprint/devel/gutenprint.spec,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -r1.41 -r1.42
--- gutenprint.spec	20 Nov 2008 17:15:23 -0000	1.41
+++ gutenprint.spec	5 Dec 2008 15:48:10 -0000	1.42
@@ -4,7 +4,7 @@
 Name:           gutenprint
 Summary:        Printer Drivers Package.
 Version:        5.2.2
-Release:        1%{?dist}
+Release:        2%{?dist}
 Group:          System Environment/Base
 URL:            http://gimp-print.sourceforge.net/
 Source0:        http://dl.sf.net/gimp-print/gutenprint-%{version}.tar.bz2
@@ -12,6 +12,7 @@
 Patch0:         gutenprint-menu.patch
 Patch1:         gutenprint-O6.patch
 Patch2:         gutenprint-selinux.patch
+Patch3:         gutenprint-locale.patch
 License:        GPLv2+
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  cups-libs >= 1.1.22-0.rc1.9.10, cups >= 1.1.22-0.rc1.9.10 
@@ -129,6 +130,7 @@
 %patch0 -p1 -b .menu
 %patch1 -p1 -b .O6
 %patch2 -p1 -b .selinux
+%patch3 -p1 -b .locale
 
 %build
 %ifarch ppc64
@@ -252,6 +254,9 @@
 /bin/rm -f /var/cache/foomatic/*
 
 %changelog
+* Fri Dec  5 2008 Tim Waugh <twaugh at redhat.com> 5.2.2-2
+- Fixed generation of globalized PPDs.
+
 * Thu Nov 20 2008 Tim Waugh <twaugh at redhat.com> 5.2.2-1
 - 5.2.2.
 - Restore SELinux file contexts of modified PPDs.




More information about the fedora-extras-commits mailing list