Package: libvpim-ruby1.8
Version: 0.14-1
Severity: normal
Tags: upstream patch

Hi,

quoting an E-Mail conversation with Sam Roberts:
"> evolution-addressbook-export sometimes emits "NICKNAME:^M" entries in Vcards.

"Well, I guess its within its rights, but its not what we want to see..
try the attached patch"

So I have attached his patch and a patch to integrate his patch into
your package.

Best regards,
  Silvestre

-- 
http://silvestre.zabala.name/
diff -Nur orig/vpim-0.14/debian/control patched/vpim-0.14/debian/control
--- orig/vpim-0.14/debian/control       2005-05-06 16:10:28.000000000 +0200
+++ patched/vpim-0.14/debian/control    2005-05-06 16:10:35.000000000 +0200
@@ -2,7 +2,7 @@
 Section: interpreters
 Priority: optional
 Maintainer: Akira TAGOH <[EMAIL PROTECTED]>
-Build-Depends-Indep: debhelper (>= 4.0.0), ruby
+Build-Depends-Indep: debhelper (>= 4.0.0), ruby, dpatch
 Standards-Version: 3.6.1
 
 Package: libvpim-ruby1.8
diff -Nur orig/vpim-0.14/debian/patches/00list 
patched/vpim-0.14/debian/patches/00list
--- orig/vpim-0.14/debian/patches/00list        1970-01-01 01:00:00.000000000 
+0100
+++ patched/vpim-0.14/debian/patches/00list     2005-05-06 16:10:35.000000000 
+0200
@@ -0,0 +1 @@
+fix_empty_nickname_bug.dpatch
diff -Nur orig/vpim-0.14/debian/patches/fix_empty_nickname_bug.dpatch 
patched/vpim-0.14/debian/patches/fix_empty_nickname_bug.dpatch
--- orig/vpim-0.14/debian/patches/fix_empty_nickname_bug.dpatch 1970-01-01 
01:00:00.000000000 +0100
+++ patched/vpim-0.14/debian/patches/fix_empty_nickname_bug.dpatch      
2005-05-06 16:10:35.000000000 +0200
@@ -0,0 +1,49 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## fix_empty_nickname_bug.dpatch by  <[EMAIL PROTECTED]>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fixes the empty nickname bug.
+
[EMAIL PROTECTED]@
+diff -urNad vpim-0.14/lib/vpim/vcard.rb 
/tmp/dpep.8TvVRx/vpim-0.14/lib/vpim/vcard.rb
+--- vpim-0.14/lib/vpim/vcard.rb        2005-05-06 15:55:35.000000000 +0200
++++ /tmp/dpep.8TvVRx/vpim-0.14/lib/vpim/vcard.rb       2005-05-06 
15:55:36.000000000 +0200
+@@ -146,6 +146,17 @@
+ 
+       fields.first ? fields.first.value : nil
+     end
++
++    # The nickname or nil if there is none.
++    def nickname
++      nn = self['nickname']
++      if nn
++        nn = nn.sub(/^\s+/, '')
++        nn = nn.sub(/\s+$/, '')
++        nn = nil if nn == ''
++      end
++      nn
++    end
+   end
+ end
+ 
+diff -urNad vpim-0.14/samples/vcf-to-mutt.rb 
/tmp/dpep.8TvVRx/vpim-0.14/samples/vcf-to-mutt.rb
+--- vpim-0.14/samples/vcf-to-mutt.rb   2005-05-06 15:55:35.000000000 +0200
++++ /tmp/dpep.8TvVRx/vpim-0.14/samples/vcf-to-mutt.rb  2005-05-06 
15:56:13.000000000 +0200
+@@ -79,7 +79,7 @@
+       |vcard|
+       # find the email addresses
+       vcard.enum_by_name("email").each do |f|
+-        nn = vcard['nickname']
++        nn = vcard.nickname
+         nn = nn ? "\t#{nn}" : ""
+         puts "#{f.value}\t#{vcard['fn']}#{nn}"
+       end
+@@ -93,7 +93,7 @@
+       vcard.enum_by_name("email").each do |f|
+         em = f.value
+         fn = vcard['fn']
+-        nn = vcard['nickname'] || fn.gsub(/\s+/,'')
++        nn = vcard.nickname || fn.gsub(/\s+/,'')
+         puts "alias #{nn} #{fn} <#{em}>"
+       end
+     end
diff -Nur orig/vpim-0.14/debian/rules patched/vpim-0.14/debian/rules
--- orig/vpim-0.14/debian/rules 2005-05-06 16:10:28.000000000 +0200
+++ patched/vpim-0.14/debian/rules      2005-05-06 16:10:35.000000000 +0200
@@ -21,7 +21,7 @@
        CFLAGS += -O2
 endif
 
-configure: configure-stamp
+configure: patch configure-stamp
 configure-stamp:
        dh_testdir
        # Add here commands to configure the package.
@@ -29,10 +29,14 @@
 
        touch configure-stamp
 
+patch: patch-stamp
+patch-stamp:
+       dpatch apply-all
+       dpatch cat-all --desc-only > patch-stamp
 
 build: build-stamp
 
-build-stamp: configure-stamp 
+build-stamp: configure
        dh_testdir
 
        # Add here commands to compile the package.
@@ -40,13 +44,19 @@
 
        touch build-stamp
 
-clean:
+clean: clean-patched unpatch
+
+clean-patched:
        dh_testdir
        dh_testroot
        rm -f build-stamp configure-stamp
 
        dh_clean 
 
+unpatch:
+       dpatch deapply-all
+       rm -rf patch-stamp debian/patched
+
 install: build
        dh_testdir
        dh_testroot
Index: vpim/vcard.rb
===================================================================
--- vpim/vcard.rb       (revision 223)
+++ vpim/vcard.rb       (working copy)
@@ -146,6 +146,17 @@

       fields.first ? fields.first.value : nil
     end
+
+    # The nickname or nil if there is none.
+    def nickname
+      nn = self['nickname']
+      if nn
+        nn = nn.sub(/^\s+/, '')
+        nn = nn.sub(/\s+$/, '')
+        nn = nil if nn == ''
+      end
+      nn
+    end
   end
 end
Index: vcf-to-mutt.rb
===================================================================
--- vcf-to-mutt.rb      (revision 223)
+++ vcf-to-mutt.rb      (working copy)
@@ -79,7 +79,7 @@
       |vcard|
       # find the email addresses
       vcard.enum_by_name("email").each do |f|
-        nn = vcard['nickname']
+        nn = vcard.nickname
         nn = nn ? "\t#{nn}" : ""
         puts "#{f.value}\t#{vcard['fn']}#{nn}"
       end
@@ -93,7 +93,7 @@
       vcard.enum_by_name("email").each do |f|
         em = f.value
         fn = vcard['fn']
-        nn = vcard['nickname'] || fn.gsub(/\s+/,'')
+        nn = vcard.nickname || fn.gsub(/\s+/,'')
         puts "alias #{nn} #{fn} <#{em}>"
       end
     end

Attachment: signature.asc
Description: Digital signature

Reply via email to