#! /bin/sh -e
## 
## All lines beginning with `## DP:' are a description of the patch.
## DP: Fix syntax errors in netbug 

[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
patch_opts="${patch_opts:--f --no-backup-if-mismatch}"

if [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
       -patch) patch $patch_opts -p0 < $0;;
       -unpatch) patch $patch_opts -p0 -R < $0;;
        *)
                echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
                exit 1;;
esac

exit 0
@DPATCH@
--- misc/netbug.orig	2005-11-02 09:55:12.000000000 +0100
+++ misc/netbug	2005-11-02 09:56:07.000000000 +0100
@@ -6,8 +6,8 @@
 IFS="" read mail || exit 1
 [ -z "$mail" ] && mail=kuznet@ms2.inr.ac.ru
 
-netbug=`mktemp -d -t netbug.XXXXXX` || {echo "$0: Cannot create temporary directory" >&2; exit 1;  }
-netbugtar=`tempfile -d $netbug --suffix=tar.gz` || {echo "$0: Cannot create temporary file" >&2; exit 1;  }
+netbug=`mktemp -d -t netbug.XXXXXX` || (echo "$0: Cannot create temporary directory" >&2; exit 1;  )
+netbugtar=`tempfile -d $netbug --suffix=tar.gz` || (echo "$0: Cannot create temporary file" >&2; exit 1;  )
 tmppath=$netbug
 trap "/bin/rm -rf $netbug $netbugtar" 0 1 2 3 13 15
 
