summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/enquiry.c8
-rw-r--r--src/main.c61
-rw-r--r--src/query.c35
-rw-r--r--src/trigcmd.c32
4 files changed, 69 insertions, 67 deletions
diff --git a/src/enquiry.c b/src/enquiry.c
index 3829df66a..5c918c7b6 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -385,7 +385,7 @@ void printarch(const char *const *argv) {
if (*argv)
badusage(_("--%s takes no arguments"), cipaction->olong);
- if (printf("%s\n",architecture) == EOF) werr("stdout");
+ printf("%s\n", architecture);
m_output(stdout, _("<standard output>"));
}
@@ -444,8 +444,7 @@ void cmpversions(const char *const *argv) {
if (*argv[0] && strcmp(argv[0],"<unknown>")) {
emsg= parseversion(&a,argv[0]);
if (emsg) {
- if (printf(_("dpkg: version '%s' has bad syntax: %s\n"), argv[0], emsg) == EOF)
- werr("stdout");
+ printf(_("dpkg: version '%s' has bad syntax: %s\n"), argv[0], emsg);
m_output(stdout, _("<standard output>"));
exit(1);
}
@@ -455,8 +454,7 @@ void cmpversions(const char *const *argv) {
if (*argv[2] && strcmp(argv[2],"<unknown>")) {
emsg= parseversion(&b,argv[2]);
if (emsg) {
- if (printf(_("dpkg: version '%s' has bad syntax: %s\n"), argv[2], emsg) == EOF)
- werr("stdout");
+ printf(_("dpkg: version '%s' has bad syntax: %s\n"), argv[2], emsg);
m_output(stdout, _("<standard output>"));
exit(1);
}
diff --git a/src/main.c b/src/main.c
index 46ad65836..5fdc9101d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -53,12 +53,14 @@
void
printversion(void)
{
- if (printf(_("Debian `%s' package management program version %s.\n"),
- DPKG, DPKG_VERSION_ARCH) < 0) werr("stdout");
- if (printf(_("This is free software; see the GNU General Public License version 2 or\n"
- "later for copying conditions. There is NO warranty.\n"
- "See %s --license for copyright and license details.\n"),
- DPKG) < 0) werr("stdout");
+ printf(_("Debian `%s' package management program version %s.\n"),
+ DPKG, DPKG_VERSION_ARCH);
+ printf(_(
+"This is free software; see the GNU General Public License version 2 or\n"
+"later for copying conditions. There is NO warranty.\n"
+"See %s --license for copyright and license details.\n"), DPKG);
+
+ m_output(stdout, _("<standard output>"));
}
/*
options that need fixing:
@@ -67,11 +69,11 @@ printversion(void)
void
usage(void)
{
- if (fprintf (stdout, _(
+ printf(_(
"Usage: %s [<option> ...] <command>\n"
-"\n"), DPKG) < 0) werr ("stdout");
+"\n"), DPKG);
- if (fprintf (stdout, _(
+ printf(_(
"Commands:\n"
" -i|--install <.deb file name> ... | -R|--recursive <directory> ...\n"
" --unpack <.deb file name> ... | -R|--recursive <directory> ...\n"
@@ -97,25 +99,25 @@ usage(void)
" --compare-versions <a> <op> <b> Compare version numbers - see below.\n"
" --force-help Show help on forcing.\n"
" -Dh|--debug=help Show help on debugging.\n"
-"\n")) < 0) werr ("stdout");
+"\n"));
- if (fprintf (stdout, _(
+ printf(_(
" -h|--help Show this help message.\n"
" --version Show the version.\n"
" --license|--licence Show the copyright licensing terms.\n"
-"\n")) < 0) werr ("stdout");
+"\n"));
- if (fprintf (stdout, _(
+ printf(_(
"Use dpkg -b|--build|-c|--contents|-e|--control|-I|--info|-f|--field|\n"
" -x|--extract|-X|--vextract|--fsys-tarfile on archives (type %s --help).\n"
-"\n"), BACKEND) < 0) werr ("stdout");
+"\n"), BACKEND);
- if (fprintf (stdout, _(
+ printf(_(
"For internal use: dpkg --assert-support-predepends | --predep-package |\n"
" --assert-working-epoch | --assert-long-filenames | --assert-multi-conrep.\n"
-"\n")) < 0) werr ("stdout");
+"\n"));
- if (fprintf (stdout, _(
+ printf(_(
"Options:\n"
" --admindir=<directory> Use <directory> instead of %s.\n"
" --root=<directory> Install on a different root directory.\n"
@@ -137,18 +139,19 @@ usage(void)
" --no-force-...|--refuse-...\n"
" Stop when problems encountered.\n"
" --abort-after <n> Abort after encountering <n> errors.\n"
-"\n"), ADMINDIR) < 0) werr ("stdout");
+"\n"), ADMINDIR);
- if (fprintf (stdout, _(
+ printf(_(
"Comparison operators for --compare-versions are:\n"
" lt le eq ne ge gt (treat empty version as earlier than any version);\n"
" lt-nl le-nl ge-nl gt-nl (treat empty version as later than any version);\n"
" < << <= = >= >> > (only for compatibility with control file syntax).\n"
-"\n")) < 0) werr ("stdout");
+"\n"));
- if (fprintf (stdout, _(
-"Use `dselect' or `aptitude' for user-friendly package management.\n")) < 0)
- werr ("stdout");
+ printf(_(
+"Use `dselect' or `aptitude' for user-friendly package management.\n"));
+
+ m_output(stdout, _("<standard output>"));
}
const char thisname[]= "dpkg";
@@ -223,7 +226,7 @@ static void setdebug(const struct cmdinfo *cpi, const char *value) {
char *endp;
if (*value == 'h') {
- if (printf(_(
+ printf(_(
"%s debugging option, --debug=<octal> or -D<octal>:\n"
"\n"
" number ref. in source description\n"
@@ -242,8 +245,8 @@ static void setdebug(const struct cmdinfo *cpi, const char *value) {
" 2000 stupidlyverbose Insane amounts of drivel\n"
"\n"
"Debugging options are be mixed using bitwise-or.\n"
-"Note that the meanings and values are subject to change.\n"),
- DPKG) < 0) werr("stdout");
+"Note that the meanings and values are subject to change.\n"), DPKG);
+ m_output(stdout, _("<standard output>"));
exit(0);
}
@@ -378,7 +381,7 @@ static void setforce(const struct cmdinfo *cip, const char *value) {
const struct forceinfo *fip;
if (!strcmp(value,"help")) {
- if (printf(_(
+ printf(_(
"%s forcing options - control behaviour when problems found:\n"
" warn but continue: --force-<thing>,<thing>,...\n"
" stop with error: --refuse-<thing>,<thing>,... | --no-force-<thing>,...\n"
@@ -409,8 +412,8 @@ static void setforce(const struct cmdinfo *cip, const char *value) {
" remove-essential [!] Remove an essential package\n"
"\n"
"WARNING - use of options marked [!] can seriously damage your installation.\n"
-"Forcing options marked [*] are enabled by default.\n"),
- DPKG) < 0) werr("stdout");
+"Forcing options marked [*] are enabled by default.\n"), DPKG);
+ m_output(stdout, _("<standard output>"));
exit(0);
}
diff --git a/src/query.c b/src/query.c
index 46bdfde5f..35202953d 100644
--- a/src/query.c
+++ b/src/query.c
@@ -439,22 +439,23 @@ void showpackages(const char *const *argv) {
void
printversion(void)
{
- if (printf(_("Debian `%s' package management program query tool\n"),
- DPKGQUERY) < 0) werr("stdout");
- if (printf(_("This is free software; see the GNU General Public License version 2 or\n"
- "later for copying conditions. There is NO warranty.\n"
- "See %s --license for copyright and license details.\n"),
- DPKGQUERY) < 0) werr("stdout");
+ printf(_("Debian `%s' package management program query tool\n"), DPKGQUERY);
+ printf(_(
+"This is free software; see the GNU General Public License version 2 or\n"
+"later for copying conditions. There is NO warranty.\n"
+"See %s --license for copyright and license details.\n"), DPKGQUERY);
+
+ m_output(stdout, _("<standard output>"));
}
void
usage(void)
{
- if (printf(_(
+ printf(_(
"Usage: %s [<option> ...] <command>\n"
-"\n"), DPKGQUERY) < 0) werr ("stdout");
+"\n"), DPKGQUERY);
- if (printf(_(
+ printf(_(
"Commands:\n"
" -s|--status <package> ... Display package status details.\n"
" -p|--print-avail <package> ... Display available version details.\n"
@@ -462,28 +463,30 @@ usage(void)
" -l|--list [<pattern> ...] List packages concisely.\n"
" -W|--show <pattern> ... Show information on package(s).\n"
" -S|--search <pattern> ... Find package(s) owning file(s).\n"
-"\n")) < 0) werr ("stdout");
+"\n"));
- if (printf(_(
+ printf(_(
" -h|--help Show this help message.\n"
" --version Show the version.\n"
" --license|--licence Show the copyright licensing terms.\n"
-"\n")) < 0) werr ("stdout");
+"\n"));
- if (printf(_(
+ printf(_(
"Options:\n"
" --admindir=<directory> Use <directory> instead of %s.\n"
" -f|--showformat=<format> Use alternative format for --show.\n"
-"\n"), ADMINDIR) < 0) werr ("stdout");
+"\n"), ADMINDIR);
- if (printf(_(
+ printf(_(
"Format syntax:\n"
" A format is a string that will be output for each package. The format\n"
" can include the standard escape sequences \\n (newline), \\r (carriage\n"
" return) or \\\\ (plain backslash). Package information can be included\n"
" by inserting variable references to package fields using the ${var[;width]}\n"
" syntax. Fields will be right-aligned unless the width is negative in which\n"
-" case left alignment will be used.\n")) < 0) werr ("stdout");
+" case left alignment will be used.\n"));
+
+ m_output(stdout, _("<standard output>"));
}
const char thisname[]= "dpkg-query";
diff --git a/src/trigcmd.c b/src/trigcmd.c
index 442bfe337..3fd7d0782 100644
--- a/src/trigcmd.c
+++ b/src/trigcmd.c
@@ -75,47 +75,45 @@ const char printforhelp[] = N_(
void
printversion(void)
{
- if (printf(_("Debian %s package trigger utility.\n"), thisname) < 0)
- werr("stdout");
+ printf(_("Debian %s package trigger utility.\n"), thisname);
- if (printf(_(
+ printf(_(
"This is free software; see the GNU General Public License version 2 or\n"
"later for copying conditions. There is NO warranty.\n"
-"See %s --license for copyright and license details.\n"), thisname) < 0)
- werr("stdout");
+"See %s --license for copyright and license details.\n"), thisname);
+
+ m_output(stdout, _("<standard output>"));
}
void
usage(void)
{
- if (printf(_(
+ printf(_(
"Usage: %s [<options> ...] <trigger-name>\n"
" %s [<options> ...] <command>\n"
-"\n"), thisname, thisname) < 0)
- werr ("stdout");
+"\n"), thisname, thisname);
- if (printf(_(
+ printf(_(
"Commands:\n"
" --check-supported Check if the running dpkg supports triggers.\n"
-"\n")) < 0)
- werr ("stdout");
+"\n"));
- if (printf(_(
+ printf(_(
" -h|--help Show this help message.\n"
" --version Show the version.\n"
" --license|--licence Show the copyright licensing terms.\n"
-"\n")) < 0)
- werr ("stdout");
+"\n"));
- if (printf(_(
+ printf(_(
"Options:\n"
" --admindir=<directory> Use <directory> instead of %s.\n"
" --by-package=<package> Override trigger awaiter (normally set\n"
" by dpkg).\n"
" --no-await No package needs to await the processing.\n"
" --no-act Just test - don't actually change anything.\n"
-"\n"), admindir) < 0)
- werr("stdout");
+"\n"), admindir);
+
+ m_output(stdout, _("<standard output>"));
}
static int done_trig, ctrig;