[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#200351: dpkg-issue then...



* Adam Heath <doogie@debian.org> [030912 17:50]:
> > wrong. The following patch resolves the problem for me:
> 
> Please regenerate this patch, using -u, and attach it to the email, instead of
> including it inline.

Hmpf, I guess there has to be something I forget with anything...
diff -r -u dpkg-1.10.10.old/dpkg-deb/main.c dpkg-1.10.10/dpkg-deb/main.c
--- dpkg-1.10.10.old/dpkg-deb/main.c	2002-09-01 06:47:03.000000000 +0200
+++ dpkg-1.10.10/dpkg-deb/main.c	2003-09-12 13:48:39.000000000 +0200
@@ -165,7 +165,12 @@
   jmp_buf ejbuf;
 
   setlocale(LC_NUMERIC, "POSIX");
-  standard_startup(&ejbuf, argc, &argv, NULL, 0, cmdinfos);
+  if (setjmp(ejbuf)) { /* expect warning about possible clobbering of argv */
+    error_unwind(ehflag_bombout); exit(2);
+  }
+  push_error_handler(&ejbuf,print_error_fatal,0);
+
+  standard_startup(argc, &argv, NULL, 0, cmdinfos);
   if (!cipaction) badusage(_("need an action option"));
 
   unsetenv("GZIP");
diff -r -u dpkg-1.10.10.old/include/dpkg.h.in dpkg-1.10.10/include/dpkg.h.in
--- dpkg-1.10.10.old/include/dpkg.h.in	2002-09-01 06:47:05.000000000 +0200
+++ dpkg-1.10.10/include/dpkg.h.in	2003-09-12 13:50:14.000000000 +0200
@@ -167,7 +167,7 @@
 
 /*** from startup.c ***/
 
-void standard_startup(jmp_buf *ejbuf, int argc, const char *const **argv, const char *prog, int loadcfg, const struct cmdinfo cmdinfos[]);
+void standard_startup(int argc, const char *const **argv, const char *prog, int loadcfg, const struct cmdinfo cmdinfos[]);
 void standard_shutdown(int freemem);
 
 /*** from ehandle.c ***/
diff -r -u dpkg-1.10.10.old/lib/startup.c dpkg-1.10.10/lib/startup.c
--- dpkg-1.10.10.old/lib/startup.c	2002-09-01 06:47:05.000000000 +0200
+++ dpkg-1.10.10/lib/startup.c	2003-09-12 13:44:17.000000000 +0200
@@ -38,17 +38,12 @@
 #include <version.h>
 #include <myopt.h>
 
-void standard_startup(jmp_buf *ejbuf, int argc, const char *const **argv, const char *prog, int loadcfg, const struct cmdinfo cmdinfos[]) {
+void standard_startup(int argc, const char *const **argv, const char *prog, int loadcfg, const struct cmdinfo cmdinfos[]) {
 
   setlocale(LC_ALL, "");
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
 
-  if (setjmp(*ejbuf)) { /* expect warning about possible clobbering of argv */
-    error_unwind(ehflag_bombout); exit(2);
-  }
-  push_error_handler(ejbuf,print_error_fatal,0);
-
   umask(022); /* Make sure all our status databases are readable. */
  
   if (loadcfg)
diff -r -u dpkg-1.10.10.old/main/main.c dpkg-1.10.10/main/main.c
--- dpkg-1.10.10.old/main/main.c	2002-09-01 06:47:05.000000000 +0200
+++ dpkg-1.10.10/main/main.c	2003-09-12 13:45:04.000000000 +0200
@@ -548,7 +548,12 @@
   jmp_buf ejbuf;
   static void (*actionfunction)(const char *const *argv);
 
-  standard_startup(&ejbuf, argc, &argv, DPKG, 1, cmdinfos);
+  if (setjmp(ejbuf)) { /* expect warning about possible clobbering of argv */
+    error_unwind(ehflag_bombout); exit(2);
+  }
+  push_error_handler(&ejbuf,print_error_fatal,0);
+
+  standard_startup(argc, &argv, DPKG, 1, cmdinfos);
   if (!cipaction) badusage(_("need an action option"));
 
   setvbuf(stdout,0,_IONBF,0);
diff -r -u dpkg-1.10.10.old/main/query.c dpkg-1.10.10/main/query.c
--- dpkg-1.10.10.old/main/query.c	2002-09-01 06:47:05.000000000 +0200
+++ dpkg-1.10.10/main/query.c	2003-09-12 13:47:43.000000000 +0200
@@ -537,7 +537,12 @@
   jmp_buf ejbuf;
   static void (*actionfunction)(const char *const *argv);
 
-  standard_startup(&ejbuf, argc, &argv, NULL, 0, cmdinfos);
+  if (setjmp(ejbuf)) { /* expect warning about possible clobbering of argv */
+    error_unwind(ehflag_bombout); exit(2);
+  }
+  push_error_handler(&ejbuf,print_error_fatal,0);
+
+  standard_startup(argc, &argv, NULL, 0, cmdinfos);
   if (!cipaction) badusage(_("need an action option"));
 
   setvbuf(stdout,0,_IONBF,0);
Only in dpkg-1.10.10: mylog
Only in dpkg-1.10.10: mylog2
diff -r -u dpkg-1.10.10.old/split/main.c dpkg-1.10.10/split/main.c
--- dpkg-1.10.10.old/split/main.c	2002-09-01 06:47:05.000000000 +0200
+++ dpkg-1.10.10/split/main.c	2003-09-12 13:49:45.000000000 +0200
@@ -153,7 +153,12 @@
   int l;
   char *p;
 
-  standard_startup(&ejbuf, argc, &argv, NULL, 0, cmdinfos);
+  if (setjmp(ejbuf)) { /* expect warning about possible clobbering of argv */
+    error_unwind(ehflag_bombout); exit(2);
+  }
+  push_error_handler(&ejbuf,print_error_fatal,0);
+
+  standard_startup(argc, &argv, NULL, 0, cmdinfos);
   if (!cipaction) badusage(_("need an action option"));
 
   l= strlen(depotdir);

Reply to: