The following commit has been merged in the master branch:
commit e547cbf6aaa2e34359d5a042298bf3b0db73a2fc
Author: Guillem Jover <[email protected]>
Date: Mon Feb 22 23:00:19 2010 +0100
Unify execution error strings
diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c
index 9ca729b..1bc0493 100644
--- a/dpkg-deb/build.c
+++ b/dpkg-deb/build.c
@@ -398,7 +398,7 @@ void do_build(const char *const *argv) {
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
if (chdir(BUILDCONTROLDIR)) ohshite(_("failed to chdir to .../DEBIAN"));
execlp(TAR, "tar", "-cf", "-", "--format=gnu", ".", NULL);
- ohshite(_("failed to exec tar -cf"));
+ ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);
}
close(p1[1]);
/* Create a temporary file to store the control data in. Immediately unlink
@@ -464,7 +464,7 @@ void do_build(const char *const *argv) {
m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
execlp(TAR, "tar", "-cf", "-", "--format=gnu", "--null", "-T", "-",
"--no-recursion", NULL);
- ohshite(_("failed to exec tar -cf"));
+ ohshite(_("unable to execute %s (%s)"), "tar -cf", TAR);
}
close(p1[0]);
close(p2[1]);
@@ -488,7 +488,7 @@ void do_build(const char *const *argv) {
if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
execlp(FIND, "find", ".", "-path", "./" BUILDCONTROLDIR, "-prune", "-o",
"-print0", NULL);
- ohshite(_("failed to exec find"));
+ ohshite(_("unable to execute %s (%s)"), "find", FIND);
}
close(p3[1]);
/* We need to reorder the files so we can make sure that symlinks
diff --git a/dpkg-deb/extract.c b/dpkg-deb/extract.c
index 497fb4c..d85b337 100644
--- a/dpkg-deb/extract.c
+++ b/dpkg-deb/extract.c
@@ -55,9 +55,10 @@ static void movecontrolfiles(const char *thing) {
c1 = subproc_fork();
if (!c1) {
execlp("sh", "sh", "-c", buf, NULL);
- ohshite(_("failed to exec sh -c mv foo/* &c"));
+ ohshite(_("unable to execute %s (%s)"),
+ _("shell command to move files"), buf);
}
- subproc_wait_check(c1, "sh -c mv foo/* &c", 0);
+ subproc_wait_check(c1, _("shell command to move files"), 0);
}
static void DPKG_ATTR_NORET
@@ -308,7 +309,7 @@ void extracthalf(const char *debar, const char *directory,
unsetenv("TAR_OPTIONS");
execlp(TAR, "tar", buffer, "-", NULL);
- ohshite(_("failed to exec tar"));
+ ohshite(_("unable to execute %s (%s)"), "tar", TAR);
}
close(p2[0]);
subproc_wait_check(c3, "tar", 0);
diff --git a/dpkg-deb/info.c b/dpkg-deb/info.c
index 56cf823..d0621a5 100644
--- a/dpkg-deb/info.c
+++ b/dpkg-deb/info.c
@@ -60,9 +60,9 @@ static void cu_info_prepare(int argc, void **argv) {
c1 = subproc_fork();
if (!c1) {
execlp(RM, "rm", "-rf", directory, NULL);
- ohshite(_("failed to exec rm for cleanup"));
+ ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM);
}
- subproc_wait_check(c1, "rm cleanup", 0);
+ subproc_wait_check(c1, _("rm command for cleanup"), 0);
}
static void info_prepare(const char *const **argvp,
diff --git a/dpkg-split/split.c b/dpkg-split/split.c
index fa75336..4d54cf2 100644
--- a/dpkg-split/split.c
+++ b/dpkg-split/split.c
@@ -65,18 +65,19 @@ deb_field(const char *filename, const char *field)
close(p[1]);
execlp(BACKEND, BACKEND, "--field", filename, field, NULL);
- ohshite(_("failed to exec dpkg-deb to extract field value"));
+ ohshite(_("unable to execute %s (%s)"),
+ _("package field value extraction"), BACKEND);
}
close(p[1]);
/* Parant reads from pipe. */
varbufreset(&buf);
- fd_vbuf_copy(p[0], &buf, -1, _("dpkg-deb field extraction"));
+ fd_vbuf_copy(p[0], &buf, -1, _("package field value extraction"));
varbufaddc(&buf, '\0');
close(p[0]);
- subproc_wait_check(pid, _("dpkg-deb field extraction"), PROCPIPE);
+ subproc_wait_check(pid, _("package field value extraction"), PROCPIPE);
/* Trim down trailing junk. */
for (end = buf.buf + strlen(buf.buf) - 1; end - buf.buf >= 1; end--)
diff --git a/scripts/Dpkg/IPC.pm b/scripts/Dpkg/IPC.pm
index f89dee1..b839771 100644
--- a/scripts/Dpkg/IPC.pm
+++ b/scripts/Dpkg/IPC.pm
@@ -268,7 +268,7 @@ sub spawn {
# Close some inherited filehandles
close($_) foreach (@{$opts{"close_in_child"}});
# Execute the program
- exec({ $prog[0] } @prog) or syserr(_g("exec %s"), "@prog");
+ exec({ $prog[0] } @prog) or syserr(_g("unable to execute %s"), "@prog");
}
# Close handle that we can't use any more
close($opts{"from_handle"}) if exists $opts{"from_handle"};
diff --git a/scripts/Dpkg/Shlibs/Cppfilt.pm b/scripts/Dpkg/Shlibs/Cppfilt.pm
index 8ce77f9..ee4107d 100644
--- a/scripts/Dpkg/Shlibs/Cppfilt.pm
+++ b/scripts/Dpkg/Shlibs/Cppfilt.pm
@@ -47,7 +47,8 @@ sub get_cppfilt {
$filt->{pid} = spawn(exec => [ 'c++filt', "--format=$type" ],
from_pipe => \$filt->{from},
to_pipe => \$filt->{to});
- internerr(_g("unable to execute c++filt")) unless defined $filt->{from};
+ internerr(_g("unable to execute %s"), "c++filt")
+ unless defined $filt->{from};
$filt->{from}->autoflush(1);
$cppfilts{$type} = $filt;
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index cdbd8f8..0b89479 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/scripts/dpkg-gencontrol.pl
@@ -301,7 +301,7 @@ if (!defined($substvars->get('Installed-Size'))) {
if (!$c) {
chdir("$packagebuilddir") ||
syserr(_g("chdir for du to \`%s'"), $packagebuilddir);
- exec("du", "-k", "-s", ".") or syserr(_g("exec %s"), "du");
+ exec("du", "-k", "-s", ".") or syserr(_g("unable to execute %s"),
"du");
}
my $duo = '';
while (<DU>) {
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 9bc2e17..b82ec20 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -825,7 +825,7 @@ sub find_packages {
open STDERR, ">", "/dev/null";
$ENV{LC_ALL} = "C";
exec("dpkg", "--search", "--", @files)
- || syserr(_g("cannot exec dpkg"));
+ || syserr(_g("unable to execute %s"), "dpkg");
}
while(defined($_ = <DPKG>)) {
chomp($_);
diff --git a/src/configure.c b/src/configure.c
index 8300738..bbf2d47 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -515,11 +515,12 @@ showdiff(const char *old, const char *new)
shell = DEFAULTSHELL;
execlp(shell, shell, "-c", cmdbuf, NULL);
- ohshite(_("failed to run %s (%.250s)"), DIFF, cmdbuf);
+ ohshite(_("unable to execute %s (%s)"),
+ _("conffile difference visualizer"), cmdbuf);
}
/* Parent process. */
- subproc_wait(pid, "shell");
+ subproc_wait(pid, _("conffile difference visualizer"));
}
/**
@@ -553,11 +554,12 @@ spawn_shell(const char *confold, const char *confnew)
setenv("DPKG_CONFFILE_NEW", confnew, 1);
execlp(shell, shell, "-i", NULL);
- ohshite(_("failed to exec shell (%.250s)"), shell);
+ ohshite(_("unable to execute %s (%s)"),
+ _("conffile shell"), shell);
}
/* Parent process. */
- subproc_wait(pid, "shell");
+ subproc_wait(pid, _("conffile shell"));
}
/**
diff --git a/src/help.c b/src/help.c
index 1fd1b6a..bcacda7 100644
--- a/src/help.c
+++ b/src/help.c
@@ -584,7 +584,7 @@ void ensure_pathname_nonexisting(const char *pathname) {
c1 = subproc_fork();
if (!c1) {
execlp(RM, "rm", "-rf", "--", pathname, NULL);
- ohshite(_("failed to exec rm for cleanup"));
+ ohshite(_("unable to execute %s (%s)"), _("rm command for cleanup"), RM);
}
debug(dbg_eachfile,"ensure_pathname_nonexisting running rm -rf");
subproc_wait_check(c1, "rm cleanup", 0);
diff --git a/src/processarc.c b/src/processarc.c
index e2d2a30..2199e68 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -146,7 +146,8 @@ void process_archive(const char *filename) {
c1 = subproc_fork();
if (!c1) {
execlp(SPLITTER, SPLITTER, "-Qao", reasmbuf, filename, NULL);
- ohshite(_("failed to exec dpkg-split to see if it's part of a
multiparter"));
+ ohshite(_("unable to execute %s (%s)"),
+ _("split package reassembly"), SPLITTER);
}
status = subproc_wait(c1, SPLITTER);
switch (WIFEXITED(status) ? WEXITSTATUS(status) : -1) {
@@ -174,7 +175,8 @@ void process_archive(const char *filename) {
c1 = subproc_fork();
if (!c1) {
execl(DEBSIGVERIFY, DEBSIGVERIFY, "-q", filename, NULL);
- ohshite(_("failed to execl debsig-verify"));
+ ohshite(_("unable to execute %s (%s)"),
+ _("package signature verification"), DEBSIGVERIFY);
} else {
int status;
@@ -224,7 +226,8 @@ void process_archive(const char *filename) {
if (!c1) {
cidirrest[-1] = '\0';
execlp(BACKEND, BACKEND, "--control", filename, cidir, NULL);
- ohshite(_("failed to exec dpkg-deb to extract control information"));
+ ohshite(_("unable to execute %s (%s)"),
+ _("package control information extraction"), BACKEND);
}
subproc_wait_check(c1, BACKEND " --control", 0);
@@ -619,7 +622,8 @@ void process_archive(const char *filename) {
if (!c1) {
m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
execlp(BACKEND, BACKEND, "--fsys-tarfile", filename, NULL);
- ohshite(_("unable to exec dpkg-deb to get filesystem archive"));
+ ohshite(_("unable to execute %s (%s)"),
+ _("package filesystem archive extraction"), BACKEND);
}
close(p1[1]);
p1[1] = -1;
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]