Просмотр исходного кода

libdpkg: Move loadcfgfile from standard_startup to its callers

Guillem Jover лет назад: 18
Родитель
Сommit
9bf0b5bcc2
7 измененных файлов с 13 добавлено и 8 удалено
  1. 6 0
      ChangeLog
  2. 1 1
      dpkg-deb/main.c
  3. 1 1
      dpkg-split/main.c
  4. 1 3
      lib/dpkg.h
  5. 2 1
      src/main.c
  6. 1 1
      src/query.c
  7. 1 1
      src/trigcmd.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2008-09-14  Guillem Jover  <guillem@debian.org>
+
+	* lib/dpkg.h (standard_startup): Do not take prog, loadcfg and
+	cmdinfos as arguments, and do not call loadcfgfile. Fix all callers.
+	* src/main.c: Call loadcfgfile directly.
+
 2008-09-14  Guillem Jover  <guillem@debian.org>
 
 	* lib/dpkg.h: Do not include <myopt.h>.

+ 1 - 1
dpkg-deb/main.c

@@ -207,7 +207,7 @@ int main(int argc, const char *const *argv) {
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
 
-  standard_startup(&ejbuf, NULL, NULL, cmdinfos);
+  standard_startup(&ejbuf);
   myopt(&argv, cmdinfos);
 
   if (!cipaction) badusage(_("need an action option"));

+ 1 - 1
dpkg-split/main.c

@@ -173,7 +173,7 @@ int main(int argc, const char *const *argv) {
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
 
-  standard_startup(&ejbuf, NULL, 0, cmdinfos);
+  standard_startup(&ejbuf);
   myopt(&argv, cmdinfos);
 
   if (!cipaction) badusage(_("need an action option"));

+ 1 - 3
lib/dpkg.h

@@ -152,14 +152,12 @@ extern const char printforhelp[];
 
 /*** from startup.c ***/
 
-#define standard_startup(ejbuf, prog, loadcfg, cmdinfos) do {\
+#define standard_startup(ejbuf) do {\
   if (setjmp(*ejbuf)) { /* expect warning about possible clobbering of argv */\
     error_unwind(ehflag_bombout); exit(2);\
   }\
   push_error_handler(ejbuf, print_error_fatal, NULL); \
   umask(022); /* Make sure all our status databases are readable. */\
-  if (loadcfg)\
-    loadcfgfile(prog, cmdinfos);\
 } while (0)
 
 #define standard_shutdown() do { \

+ 2 - 1
src/main.c

@@ -632,7 +632,8 @@ int main(int argc, const char *const *argv) {
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
 
-  standard_startup(&ejbuf, DPKG, 1, cmdinfos);
+  standard_startup(&ejbuf);
+  loadcfgfile(DPKG, cmdinfos);
   myopt(&argv, cmdinfos);
 
   if (!cipaction) badusage(_("need an action option"));

+ 1 - 1
src/query.c

@@ -564,7 +564,7 @@ int main(int argc, const char *const *argv) {
   bindtextdomain(PACKAGE, LOCALEDIR);
   textdomain(PACKAGE);
 
-  standard_startup(&ejbuf, NULL, 0, cmdinfos);
+  standard_startup(&ejbuf);
   myopt(&argv, cmdinfos);
 
   if (!cipaction) badusage(_("need an action option"));

+ 1 - 1
src/trigcmd.c

@@ -193,7 +193,7 @@ main(int argc, const char *const *argv)
 	bindtextdomain(PACKAGE, LOCALEDIR);
 	textdomain(PACKAGE);
 
-	standard_startup(&ejbuf, NULL, 0, cmdinfos);
+	standard_startup(&ejbuf);
 	myopt(&argv, cmdinfos);
 
 	setvbuf(stdout, NULL, _IONBF, 0);