summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2008-09-08 03:09:49 +0300
committerGuillem Jover <guillem@debian.org>2008-09-14 05:57:44 +0300
commit9bf0b5bcc29dca312f4888532d67671a54fda180 (patch)
tree2a884db4ca1fc2e2534e4475fbd94fa4a69a213f
parent405accb78561ac2205b33627f2809a7f10e93ee6 (diff)
downloaddpkg-9bf0b5bcc29dca312f4888532d67671a54fda180.tar.gz
libdpkg: Move loadcfgfile from standard_startup to its callers
-rw-r--r--ChangeLog6
-rw-r--r--dpkg-deb/main.c2
-rw-r--r--dpkg-split/main.c2
-rw-r--r--lib/dpkg.h4
-rw-r--r--src/main.c3
-rw-r--r--src/query.c2
-rw-r--r--src/trigcmd.c2
7 files changed, 13 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 4588125f4..22d2d8dc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
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>.
(standard_startup): Do not take argc and argv as arguments, and do
not call myopt. Fix all callers.
diff --git a/dpkg-deb/main.c b/dpkg-deb/main.c
index caea05d58..980c3e352 100644
--- a/dpkg-deb/main.c
+++ b/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"));
diff --git a/dpkg-split/main.c b/dpkg-split/main.c
index 06a52e629..2b49709b2 100644
--- a/dpkg-split/main.c
+++ b/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"));
diff --git a/lib/dpkg.h b/lib/dpkg.h
index 58ce20e64..59148e7f0 100644
--- a/lib/dpkg.h
+++ b/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 { \
diff --git a/src/main.c b/src/main.c
index f19f67b88..63ca3a792 100644
--- a/src/main.c
+++ b/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"));
diff --git a/src/query.c b/src/query.c
index 3f59f3599..15d52f65b 100644
--- a/src/query.c
+++ b/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"));
diff --git a/src/trigcmd.c b/src/trigcmd.c
index 88f4fe481..d9ba7bda2 100644
--- a/src/trigcmd.c
+++ b/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);