Package: lbdb
Version: 0.36
Severity: normal
Tags: patch

We have an number of custom lbdb scripts, and just like with all
shell scripts, we set -e for them. This causes lbdb to die due to
uncaught grep invocations in other snippets. The attached patch
makes it implicit that grep is expected to exit non-zero if there is
no match.

-- System Information:
Debian Release: 5.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.26-1-amd64 (SMP w/1 CPU core)
Locale: LANG=en_GB, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages lbdb depends on:
ii  libc6                         2.7-18     GNU C Library: Shared libraries
ii  libvformat1                   1.13-4     Library to read and write vcard fi
ii  perl                          5.10.0-19  Larry Wall's Practical Extraction 

lbdb recommends no packages.

Versions of packages lbdb suggests:
pn  abook                         <none>     (no description available)
pn  finger                        <none>     (no description available)
pn  libnet-ldap-perl              <none>     (no description available)
ii  libpalm-perl                  1.3.0-7    Perl 5 modules for manipulating pd
ii  mutt                          1.5.18-6   text-based mailreader supporting M
ii  procmail                      3.22-16    Versatile e-mail processor

-- no debconf information


-- 
 .''`.   martin f. krafft <madd...@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
diffstat for lbdb-0.36 lbdb-0.36+nmu1

 debian/changelog        |    8 ++++++++
 m_addr_email.sh.in      |    2 +-
 m_bbdb.sh.in            |    2 +-
 m_evolution.sh.in       |    2 +-
 m_fido.sh.in            |    2 +-
 m_finger.sh.in          |    3 +--
 m_gnomecard.sh.in       |    2 +-
 m_gpg.sh.in             |    2 +-
 m_inmail.sh.in          |    2 +-
 m_ldap.sh.in            |    4 ++--
 m_muttalias.sh.in       |    2 +-
 m_osx_addressbook.sh.in |    2 +-
 m_palm.sh.in            |    2 +-
 m_passwd.sh.in          |    2 +-
 m_pgp5.sh.in            |    2 +-
 m_wanderlust.sh.in      |    2 +-
 16 files changed, 24 insertions(+), 17 deletions(-)

diff -Nru lbdb-0.36/debian/changelog lbdb-0.36+nmu1/debian/changelog
--- lbdb-0.36/debian/changelog  2008-06-14 12:39:14.000000000 +0200
+++ lbdb-0.36+nmu1/debian/changelog     2009-02-13 10:15:38.000000000 +0100
@@ -1,3 +1,11 @@
+lbdb (0.36+nmu1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Fix query shell functions to catch non-zero exit status in case they get
+    invoked in set -e context.
+
+ -- martin f. krafft <madd...@debian.org>  Fri, 13 Feb 2009 10:14:58 +0100
+
 lbdb (0.36) unstable; urgency=low
 
   * Remove duplicate "See also: mutt" from lbdbq.man (Closes: #441588).
diff -Nru lbdb-0.36/m_addr_email.sh.in lbdb-0.36+nmu1/m_addr_email.sh.in
--- lbdb-0.36/m_addr_email.sh.in        2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_addr_email.sh.in   2009-02-13 10:12:51.000000000 +0100
@@ -33,7 +33,7 @@
     then
        $ADDR_EMAIL "$@" \
        | sed -e 's/^\([^,]*\), \([^:]*\):      \(.*\)$/\3      \1      \2/' \
-       | grep -a '@'
+       | grep -a '@' || :
 #      | sed -e 's/\(.*\):[    ]\([^   ].*$\)/\2       \1      addr-email/'
     fi
 }
diff -Nru lbdb-0.36/m_bbdb.sh.in lbdb-0.36+nmu1/m_bbdb.sh.in
--- lbdb-0.36/m_bbdb.sh.in      2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_bbdb.sh.in 2009-02-13 10:12:55.000000000 +0100
@@ -64,5 +64,5 @@
                    --eval "$form"  2>/dev/null
            fi
        fi
-    fi |  grep -va '^$'
+    fi |  grep -va '^$' || :
 }
diff -Nru lbdb-0.36/m_evolution.sh.in lbdb-0.36+nmu1/m_evolution.sh.in
--- lbdb-0.36/m_evolution.sh.in 2008-06-14 12:00:12.000000000 +0200
+++ lbdb-0.36+nmu1/m_evolution.sh.in    2009-02-13 10:12:58.000000000 +0100
@@ -38,6 +38,6 @@
              /^FN:/ {name=$2; } \
              /^X-EVOLUTION-FILE-AS:/ {fileas=$2; gsub("\\\\", "", fileas)} \
              /^EMAIL[;:]/ {email=$2;}'\
-       | grep -ia "$@"
+       | grep -ia "$@" || :
     fi
 }
diff -Nru lbdb-0.36/m_fido.sh.in lbdb-0.36+nmu1/m_fido.sh.in
--- lbdb-0.36/m_fido.sh.in      2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_fido.sh.in 2009-02-13 10:13:04.000000000 +0100
@@ -26,5 +26,5 @@
 m_fido_query()
 {
     test -f $m_fido_db || return
-    grep -ia "$...@." $m_fido_db
+    grep -ia "$...@." $m_fido_db || :
 }
diff -Nru lbdb-0.36/m_finger.sh.in lbdb-0.36+nmu1/m_finger.sh.in
--- lbdb-0.36/m_finger.sh.in    2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_finger.sh.in       2009-02-13 10:13:08.000000000 +0100
@@ -45,8 +45,7 @@
            $FINGER $f_user$athost 2> /dev/null \
            | sed -n -e "s/^Login: *\([^ ]*\)[  ]*Name: \(.*\)$/\...@$mailhost  
\2      (finger)/p" \
                     -e "s/^Login name: *\([^ ]*\)[     ]*In real life: 
\(.*\)$/\...@$mailhost  \2      (finger)/p" \
-           | grep -av 'In real life: ???' \
-                       || true
+           | grep -av 'In real life: ???' || :
         done
     fi
 }
diff -Nru lbdb-0.36/m_gnomecard.sh.in lbdb-0.36+nmu1/m_gnomecard.sh.in
--- lbdb-0.36/m_gnomecard.sh.in 2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_gnomecard.sh.in    2009-02-13 10:13:17.000000000 +0100
@@ -65,7 +65,7 @@
                                         type=substr($1,7); \
                                         printf ("%s\t%s\tGC:%s\n", \
                                                 email, name, type) }' \
-            < $file | grep -ia "$@"
+            < $file | grep -ia "$@" || :
        fi
     done
 }
diff -Nru lbdb-0.36/m_gpg.sh.in lbdb-0.36+nmu1/m_gpg.sh.in
--- lbdb-0.36/m_gpg.sh.in       2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_gpg.sh.in  2009-02-13 10:13:20.000000000 +0100
@@ -31,7 +31,7 @@
        | grep -a '^\(pub\|uid\):[^re]:\([^:]*:\)\{7,7\}[^<>:]* <[^<>@: 
]...@[^<>@: ]*>[^<>@:]*:' \
        | sed -e 's/^\([^:]*:\)\{9,9\}\([^<:]*\) <\([^>:]*\)>.*:.*$/\3  \2      
(GnuPG)/' \
        | sed -e 's/    \([^    ]\{27,27\}\)[^  ]*      /       \1...   /' \
-        | grep -ia "$@"
+        | grep -ia "$@" || :
 
 #      $GPG --list-keys --no-greeting "$@" 2>/dev/null \
 #      | grep -a '^\(pub\|uid\)  .\{25,25\} [^<>]* <[^<>@ ]...@[^<>@ ]*>' \
diff -Nru lbdb-0.36/m_inmail.sh.in lbdb-0.36+nmu1/m_inmail.sh.in
--- lbdb-0.36/m_inmail.sh.in    2005-10-29 16:48:09.000000000 +0200
+++ lbdb-0.36+nmu1/m_inmail.sh.in       2009-02-13 10:13:29.000000000 +0100
@@ -30,5 +30,5 @@
        export SORT_OUTPUT
        $libdir/lbdb-munge
        test -f $m_inmail_db  || return
-       grep -ia "$...@." $m_inmail_db
+       grep -ia "$...@." $m_inmail_db || :
 }
diff -Nru lbdb-0.36/m_ldap.sh.in lbdb-0.36+nmu1/m_ldap.sh.in
--- lbdb-0.36/m_ldap.sh.in      2005-10-29 16:48:10.000000000 +0200
+++ lbdb-0.36+nmu1/m_ldap.sh.in 2009-02-13 10:13:45.000000000 +0100
@@ -31,9 +31,9 @@
     then
        for NICK in $LDAP_NICKS
        do
-           $libdir/mutt_ldap_query --lbdb_output --nickname=$NICK "$@"
+           $libdir/mutt_ldap_query --lbdb_output --nickname=$NICK "$@" || :
        done
     else
-       $libdir/mutt_ldap_query --lbdb_output "$@"
+       $libdir/mutt_ldap_query --lbdb_output "$@" || :
     fi
 }
diff -Nru lbdb-0.36/m_muttalias.sh.in lbdb-0.36+nmu1/m_muttalias.sh.in
--- lbdb-0.36/m_muttalias.sh.in 2007-05-27 10:42:22.000000000 +0200
+++ lbdb-0.36+nmu1/m_muttalias.sh.in    2009-02-13 10:13:48.000000000 +0100
@@ -39,7 +39,7 @@
                  -e 's/^alias[         ][      ]*\([^  ][^     ]*\)[   ][      
]*\(\\\".*\\\"[^<>()]*\|[^<>()]*\)<\([^<>()]*\)>[^<>]*$/\3      \2      alias 
\1/' \
                  -e 's/^alias[         ][      ]*\([^  ][^     ]*\)[   ][      
]*\([^<>()]*\)(\(\\\".*\\\"[^<>()]*\|[^<>()]*\))[^()<>]*$/\2    \3      alias 
\1/' \
                  -e 's/\\\"//g' \
-           | grep -va '^alias[         ][      ]*[^,][^,]*[    ][      
]*[^,]*$'
+           | grep -va '^alias[         ][      ]*[^,][^,]*[    ][      
]*[^,]*$' || :
        fi  
     done
 }
diff -Nru lbdb-0.36/m_osx_addressbook.sh.in 
lbdb-0.36+nmu1/m_osx_addressbook.sh.in
--- lbdb-0.36/m_osx_addressbook.sh.in   2005-10-29 16:48:10.000000000 +0200
+++ lbdb-0.36+nmu1/m_osx_addressbook.sh.in      2009-02-13 10:13:56.000000000 
+0100
@@ -24,5 +24,5 @@
 
 m_osx_addressbook_query()
 {
-  $libdir/ABQuery "$@" | grep -ia "$@"
+  $libdir/ABQuery "$@" | grep -ia "$@" || :
 }
diff -Nru lbdb-0.36/m_palm.sh.in lbdb-0.36+nmu1/m_palm.sh.in
--- lbdb-0.36/m_palm.sh.in      2005-10-29 16:48:10.000000000 +0200
+++ lbdb-0.36+nmu1/m_palm.sh.in 2009-02-13 10:14:00.000000000 +0100
@@ -30,5 +30,5 @@
 {
     palmdatabase=${PALM_ADDRESS_DATABASE:-$HOME/.jpilot/AddressDB.pdb}
     test -f $palmdatabase || return
-    $libdir/palm_lsaddr $palmdatabase | grep -ia "$@"
+    $libdir/palm_lsaddr $palmdatabase | grep -ia "$@" || :
 }
diff -Nru lbdb-0.36/m_passwd.sh.in lbdb-0.36+nmu1/m_passwd.sh.in
--- lbdb-0.36/m_passwd.sh.in    2005-10-29 16:48:10.000000000 +0200
+++ lbdb-0.36+nmu1/m_passwd.sh.in       2009-02-13 10:14:05.000000000 +0100
@@ -34,5 +34,5 @@
     esac
 
     sed -e "s/^\([^:]*\):[^:]*:\([^:]*\):[^:]*:\([^:,]*\)[,:].*\$/\...@$host   
\3      UID \2/" /etc/passwd \
-    | grep -ia "$@" | grep -a "$IGNORESYS"
+    | grep -ia "$@" | grep -a "$IGNORESYS" || :
 }
diff -Nru lbdb-0.36/m_pgp5.sh.in lbdb-0.36+nmu1/m_pgp5.sh.in
--- lbdb-0.36/m_pgp5.sh.in      2005-10-29 16:48:10.000000000 +0200
+++ lbdb-0.36+nmu1/m_pgp5.sh.in 2009-02-13 10:14:12.000000000 +0100
@@ -31,6 +31,6 @@
        | grep -a '^uid  ...* <[^<>@:/ ]...@[^<>@ ]*>[^<>@]*$' \
        | sed -e 's/^uid  \(.*\) <\(.*\)>.*$/\2 \1      (PGP5)/' \
        | sed -e 's/    \([^    ]\{27,27\}\)[^  ]*      /       \1...   /' \
-       | grep -ia "$@"
+       | grep -ia "$@" || :
     fi
 }
diff -Nru lbdb-0.36/m_wanderlust.sh.in lbdb-0.36+nmu1/m_wanderlust.sh.in
--- lbdb-0.36/m_wanderlust.sh.in        2005-10-29 16:48:10.000000000 +0200
+++ lbdb-0.36+nmu1/m_wanderlust.sh.in   2009-02-13 10:14:50.000000000 +0100
@@ -28,6 +28,6 @@
     then
        grep -ia "$@" $addresses \
        | sed -e 's,^\([^       ]\+\)[  ]\+"\([^"]*\)"[         
]\+"\([^"]\+\)",\1      \3      wl \2,g' \
-       | grep -a '^[^  ][^     ]*      [^      ][^     ]*      wl '
+       | grep -a '^[^  ][^     ]*      [^      ][^     ]*      wl ' || :
     fi
 }

Attachment: digital_signature_gpg.asc
Description: Digital signature (see http://martin-krafft.net/gpg/)

Reply via email to