Package: glabels
Version: 2.1.3-1+b1
Severity: wishlist
Tags: patch

The current versions of glabel do not support Brazilian CEPNet barcode
standard for ZIP codes. Since it is a POSTNET-based barcode system, it
is quite simple to patch the code allowing the use of CEPNet.

The following patch provides this functionality if applied against the
source code. I also tried out using this patch under debian/patches for
dpatch usage, seems to work just fine.

Thanks,
Mário Meyer

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (990, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-xen (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages glabels depends on:
ii  glabels-data               2.1.3-1       data files for gLabels
ii  libart-2.0-2               2.3.19-3      Library of functions for 2D graphi
ii  libc6                      2.6-5         GNU C Library: Shared libraries
ii  libebook1.2-9              1.10.3-1      Client library for evolution addre
ii  libgconf2-4                2.18.0.1-3    GNOME configuration database syste
ii  libglade2-0                1:2.6.2-1     library to load .glade files at ru
ii  libglib2.0-0               2.12.13-1     The GLib library of C routines
ii  libgnome2-0                2.18.0-4      The GNOME 2 library - runtime file
ii  libgnomecanvas2-0          2.14.0-3      A powerful object-oriented display
ii  libgnomeprint2.2-0         2.18.0-2      The GNOME 2.2 print architecture -
ii  libgnomeprintui2.2-0       2.18.0-2      GNOME 2.2 print architecture User 
ii  libgnomeui-0               2.18.1-2      The GNOME 2 libraries (User Interf
ii  libgnomevfs2-0             1:2.18.1-3+b1 GNOME Virtual File System (runtime
ii  libgtk2.0-0                2.10.13-1     The GTK+ graphical user interface 
ii  libpopt0                   1.10-3        lib for parsing cmdline parameters
ii  libxml2                    2.6.29.dfsg-1 GNOME XML library

glabels recommends no packages.

-- no debconf information
Index: src/bc-postnet.c
===================================================================
--- src/bc-postnet.c	(revision 661)
+++ src/bc-postnet.c	(working copy)
@@ -94,6 +94,7 @@
 	/* Validate code length for all subtypes. */
 	if ( (g_strcasecmp (id, "POSTNET") == 0) ) {
 		if (!is_length_valid (digits, 5) &&
+		    !is_length_valid (digits, 8) &&
 		    !is_length_valid (digits, 9) &&
 		    !is_length_valid (digits, 11)) {
 			return NULL;
@@ -114,6 +115,11 @@
 			return NULL;
 		}
 	}
+	if ( (g_strcasecmp (id, "CEPNET") == 0) ) {
+		if (!is_length_valid (digits, 8)) {
+			return NULL;
+		}
+	}
 
 	/* First get code string */
 	code = postnet_code (digits);
Index: src/bc.c
===================================================================
--- src/bc.c	(revision 661)
+++ src/bc.c	(working copy)
@@ -76,6 +76,9 @@
 	{ "POSTNET-11", N_("POSTNET-11 (DPBC)"), gl_barcode_postnet_new,
 	  FALSE, FALSE, TRUE, FALSE, "12345-6789-12", FALSE, 11},
 
+	{ "CEPNET", N_("CEPNET"), gl_barcode_postnet_new,
+	  FALSE, FALSE, TRUE, FALSE, "12345-678", FALSE, 8},
+
 	{ "EAN", N_("EAN (any)"), gl_barcode_gnubarcode_new,
 	  TRUE, TRUE, TRUE, FALSE, "000000000000 00000", FALSE, 17},
 

Reply via email to