#! /bin/sh -e

# DP: Add Debian URL for bug reporting isntructions.

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir=$3/
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi
case "$1" in
    -patch)
	patch $pdir -f --no-backup-if-mismatch -p0 < $0
	if grep -q debian_bug_report_url ${dir}gcc/version.c; then
	  :
	else
	  echo 'const char debian_bug_report_url[] = "<URL:file:///usr/share/doc/gcc-3.3/README.Bugs>";' >> ${dir}gcc/version.c
	fi
	;;
    -unpatch)
	grep -v debian_bug_report_url ${dir}gcc/version.c > ${dir}gcc/version.c.new
	${dir}move-if-change ${dir}gcc/version.c.new ${dir}gcc/version.c
	patch $pdir -f --no-backup-if-mismatch -R -p0 < $0
	;;
    *)
	echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
	exit 1
esac
exit 0

--- gcc/gccbug.in~	Tue Nov 14 07:21:47 2000
+++ gcc/gccbug.in	Tue Nov 14 07:24:59 2000
@@ -24,13 +24,13 @@
 VERSION=3.113
 
 # The submitter-id for your site.
-SUBMITTER=net
+SUBMITTER=net # net-debian
 
 # The default mail address for PR submissions. 
-GNATS_ADDR=gcc-gnats@gcc.gnu.org
+GNATS_ADDR="gcc-gnats@gcc.gnu.org,debian-gcc@lists.debian.org"
 
 # The default release for this host.
-DEFAULT_RELEASE="@gcc_version_full@"
+DEFAULT_RELEASE="@gcc_version_full@ (Debian testing/unstable)"
 
 # The default organization.
 DEFAULT_ORGANIZATION=

--- gcc/java/gjavah.c~	2003-03-28 23:18:48.000000000 +0100
+++ gcc/java/gjavah.c	2004-05-14 07:26:44.000000000 +0200
@@ -2320,6 +2320,8 @@
   printf ("\n");
   printf ("For bug reporting instructions, please see:\n");
   printf ("%s.\n", bug_report_url);
+  printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
+  printf ("%s.\n", debian_bug_report_url);
   exit (0);
 }
 
--- gcc/java/jcf-dump.c~	2003-03-28 23:18:48.000000000 +0100
+++ gcc/java/jcf-dump.c	2004-05-14 07:27:03.000000000 +0200
@@ -893,6 +893,8 @@
   printf ("\n");
   printf ("For bug reporting instructions, please see:\n");
   printf ("%s.\n", bug_report_url);
+  printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
+  printf ("%s.\n", debian_bug_report_url);
   exit (0);
 }
 
--- gcc/java/jv-scan.c~	2003-02-03 15:06:32.000000000 +0100
+++ gcc/java/jv-scan.c	2004-05-14 07:27:26.000000000 +0200
@@ -116,6 +116,8 @@
   printf ("\n");
   printf ("For bug reporting instructions, please see:\n");
   printf ("%s.\n", bug_report_url);
+  printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
+  printf ("%s.\n", debian_bug_report_url);
   exit (0);
 }
 
--- gcc/diagnostic.c~	2003-05-29 21:09:55.000000000 +0200
+++ gcc/diagnostic.c	2004-05-14 07:28:51.000000000 +0200
@@ -1207,7 +1207,9 @@
   fnotice (stderr,
 "Please submit a full bug report,\n\
 with preprocessed source if appropriate.\n\
-See %s for instructions.\n", bug_report_url);
+See %s for instructions.\n\
+For Debian GNU/Linux specific bug reporting instructions, see\n\
+%s.\n", bug_report_url, debian_bug_report_url);
   exit (FATAL_EXIT_CODE);
 }
 
@@ -1315,7 +1317,8 @@
   fnotice (stderr,
 "Please submit a full bug report,\n\
 with preprocessed source if appropriate.\n\
-See %s for instructions.\n", bug_report_url);
+For Debian GNU/Linux specific bug reporting instructions, see\n\
+%s.\n", bug_report_url, debian_bug_report_url);
   exit (FATAL_EXIT_CODE);
 }
 
--- gcc/gcov.c~	2002-10-08 21:45:17.000000000 +0200
+++ gcc/gcov.c	2004-05-14 07:28:07.000000000 +0200
@@ -350,6 +350,8 @@
   fnotice (file, "  -p, --preserve-paths            Preserve all pathname components\n");
   fnotice (file, "\nFor bug reporting instructions, please see:\n%s.\n",
 	   bug_report_url);
+  fnotice (file, "\nFor Debian GNU/Linux specific bug reporting instructions, please see:\n%s.\n",
+	   debian_bug_report_url);
   exit (status);
 }
 
--- gcc/version.h~	2002-10-08 19:27:39.000000000 +0200
+++ gcc/version.h	2004-05-14 07:14:38.000000000 +0200
@@ -2,4 +2,5 @@
 #define GCC_VERSION_H
 extern const char version_string[];
 extern const char bug_report_url[];
+extern const char debian_bug_report_url[];
 #endif /* ! GCC_VERSION_H */
--- gcc/gcc.c~	2004-05-17 00:50:54.000000000 +0200
+++ gcc/gcc.c	2004-05-17 00:53:04.000000000 +0200
@@ -2796,9 +2796,11 @@
 		    fatal ("\
 Internal error: %s (program %s)\n\
 Please submit a full bug report.\n\
-See %s for instructions.",
+See %s for instructions.\n\
+For Debian GNU/Linux specific bug reporting instructions,\n\
+see %s.\n",
 			   strsignal (WTERMSIG (status)), commands[j].prog,
-			   bug_report_url);
+			   bug_report_url, debian_bug_report_url);
 		  signal_count++;
 		  ret_code = -1;
 		}
@@ -6234,6 +6236,8 @@
 	{
 	  printf (_("\nFor bug reporting instructions, please see:\n"));
 	  printf ("%s.\n", bug_report_url);
+	  printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
+	  printf ("%s.\n", debian_bug_report_url);
 
 	  return (0);
 	}
@@ -6409,6 +6413,8 @@
     {
       printf (("\nFor bug reporting instructions, please see:\n"));
       printf ("%s\n", bug_report_url);
+      printf ("For Debian GNU/Linux specific bug reporting instructions, please see:\n");
+      printf ("%s\n", debian_bug_report_url);
     }
 
   return (signal_count != 0 ? 2
