Commit 0b8652b2 authored by Guillem Jover's avatar Guillem Jover

Change debug, progress and error output to use package specifiers

Replace pkg->set->name with varbuf_add_pkgbin_name(), pkgbin_name() or
pkg_name(). This only changes informative output, so no behaviour change
should result from this.
Based-on-patch-by: Raphaël Hertzog's avatarRaphaël Hertzog <hertzog@debian.org>
Patch-sponsored-by: Linaro Limited
Signed-off-by: Guillem Jover's avatarGuillem Jover <guillem@debian.org>
parent ff66f87a
......@@ -436,8 +436,8 @@ do_build(const char *const *argv)
pkg = check_new_pkg(dir);
if (subdir)
debar = pkg_get_pathname(debar, pkg);
printf(_("dpkg-deb: building package `%s' in `%s'.\n"), pkg->set->name,
debar);
printf(_("dpkg-deb: building package `%s' in `%s'.\n"),
pkgbin_name(pkg, &pkg->available, pnaw_nonambig), debar);
}
m_output(stdout, _("<standard output>"));
......
......@@ -352,19 +352,24 @@ modstatdb_note_core(struct pkginfo *pkg)
varbufrecord(&uvb, pkg, &pkg->installed);
if (fwrite(uvb.buf, 1, uvb.used, importanttmp) != uvb.used)
ohshite(_("unable to write updated status of `%.250s'"), pkg->set->name);
ohshite(_("unable to write updated status of `%.250s'"),
pkg_name(pkg, pnaw_nonambig));
if (fflush(importanttmp))
ohshite(_("unable to flush updated status of `%.250s'"), pkg->set->name);
ohshite(_("unable to flush updated status of `%.250s'"),
pkg_name(pkg, pnaw_nonambig));
if (ftruncate(fileno(importanttmp), uvb.used))
ohshite(_("unable to truncate for updated status of `%.250s'"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
if (fsync(fileno(importanttmp)))
ohshite(_("unable to fsync updated status of `%.250s'"), pkg->set->name);
ohshite(_("unable to fsync updated status of `%.250s'"),
pkg_name(pkg, pnaw_nonambig));
if (fclose(importanttmp))
ohshite(_("unable to close updated status of `%.250s'"), pkg->set->name);
ohshite(_("unable to close updated status of `%.250s'"),
pkg_name(pkg, pnaw_nonambig));
sprintf(updatefnrest, IMPORTANTFMT, nextupdate);
if (rename(importanttmpfile, updatefnbuf))
ohshite(_("unable to install updated status of `%.250s'"), pkg->set->name);
ohshite(_("unable to install updated status of `%.250s'"),
pkg_name(pkg, pnaw_nonambig));
dir_sync_path(updatesdir);
......
......@@ -436,9 +436,17 @@ writerecord(FILE *file, const char *filename,
varbufrecord(&vb,pigp,pifp);
varbuf_end_str(&vb);
if (fputs(vb.buf,file) < 0)
if (fputs(vb.buf,file) < 0) {
struct varbuf pkgname = VARBUF_INIT;
int errno_saved = errno;
varbuf_add_pkgbin_name(&pkgname, pigp, pifp, pnaw_nonambig);
errno = errno_saved;
ohshite(_("failed to write details of `%.50s' to `%.250s'"),
pigp->set->name, filename);
pkgname.buf, filename);
}
varbuf_destroy(&vb);
}
......@@ -472,7 +480,7 @@ writedb(const char *filename, enum writedb_flags flags)
varbuf_end_str(&vb);
if (fputs(vb.buf, file->fp) < 0)
ohshite(_("failed to write %s database record about '%.50s' to '%.250s'"),
which, pigp->set->name, filename);
which, pkgbin_name(pigp, pifp, pnaw_nonambig), filename);
varbuf_reset(&vb);
}
pkg_db_iter_free(it);
......
......@@ -44,7 +44,8 @@ parse_error_msg(struct parsedb_state *ps, const char *fmt)
if (ps->pkg && ps->pkg->set->name)
sprintf(msg, _("parsing file '%.255s' near line %d package '%.255s':\n"
" %.255s"), filename, ps->lno, ps->pkg->set->name, fmt);
" %.255s"), filename, ps->lno,
pkgbin_name(ps->pkg, ps->pkgbin, pnaw_nonambig), fmt);
else
sprintf(msg, _("parsing file '%.255s' near line %d:\n"
" %.255s"), filename, ps->lno, fmt);
......
......@@ -223,7 +223,7 @@ trk_unknown_interest_change(const char *trig, struct pkginfo *pkg,
{
ohshit(_("invalid or unknown syntax in trigger name `%.250s'"
" (in trigger interests for package `%.250s')"),
trig, pkg->set->name);
trig, pkgbin_name(pkg, pkgbin, pnaw_nonambig));
}
static const struct trigkindinfo tki_unknown = {
......@@ -420,7 +420,8 @@ found:
tfi->options = opts;
if (signum > 1)
ohshit(_("duplicate file trigger interest for filename `%.250s' "
"and package `%.250s'"), trig, pkg->set->name);
"and package `%.250s'"), trig,
pkgbin_name(pkg, pkgbin, pnaw_nonambig));
if (signum > 0)
return;
......
This diff is collapsed.
......@@ -167,7 +167,8 @@ deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff)
strcpy(cdr2rest, DPKGOLDEXT);
if (unlink(cdr2.buf) && errno != ENOENT)
warning(_("%s: failed to remove old backup '%.250s': %s"),
pkg->set->name, cdr2.buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), cdr2.buf,
strerror(errno));
varbuf_add_str(&cdr, DPKGDISTEXT);
varbuf_end_str(&cdr);
......@@ -175,27 +176,32 @@ deferred_configure_conffile(struct pkginfo *pkg, struct conffile *conff)
trig_file_activate(usenode, pkg);
if (rename(cdr2.buf, cdr.buf))
warning(_("%s: failed to rename '%.250s' to '%.250s': %s"),
pkg->set->name, cdr2.buf, cdr.buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), cdr2.buf, cdr.buf,
strerror(errno));
break;
case cfo_keep:
strcpy(cdr2rest, DPKGNEWEXT);
if (unlink(cdr2.buf))
warning(_("%s: failed to remove '%.250s': %s"),
pkg->set->name, cdr2.buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), cdr2.buf,
strerror(errno));
break;
case cfo_install | cfof_backup:
strcpy(cdr2rest, DPKGDISTEXT);
if (unlink(cdr2.buf) && errno != ENOENT)
warning(_("%s: failed to remove old distributed version '%.250s': %s"),
pkg->set->name, cdr2.buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), cdr2.buf,
strerror(errno));
strcpy(cdr2rest, DPKGOLDEXT);
if (unlink(cdr2.buf) && errno != ENOENT)
warning(_("%s: failed to remove '%.250s' (before overwrite): %s"),
pkg->set->name, cdr2.buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), cdr2.buf,
strerror(errno));
if (!(what & cfof_userrmd))
if (link(cdr.buf, cdr2.buf))
warning(_("%s: failed to link '%.250s' to '%.250s': %s"),
pkg->set->name, cdr.buf, cdr2.buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), cdr.buf,
cdr2.buf, strerror(errno));
/* Fall through. */
case cfo_install:
printf(_("Installing new version of config file %s ...\n"),
......@@ -256,14 +262,15 @@ deferred_configure(struct pkginfo *pkg)
if (pkg->status == stat_notinstalled)
ohshit(_("no package named `%s' is installed, cannot configure"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
if (pkg->status == stat_installed)
ohshit(_("package %.250s is already installed and configured"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
if (pkg->status != stat_unpacked && pkg->status != stat_halfconfigured)
ohshit(_("package %.250s is not ready for configuration\n"
" cannot configure (current status `%.250s')"),
pkg->set->name, statusinfos[pkg->status].name);
pkg_name(pkg, pnaw_nonambig),
statusinfos[pkg->status].name);
if (dependtry > 1)
if (findbreakcycle(pkg))
......@@ -293,14 +300,14 @@ deferred_configure(struct pkginfo *pkg)
varbuf_end_str(&aemsgs);
fprintf(stderr,
_("dpkg: dependency problems prevent configuration of %s:\n%s"),
pkg->set->name, aemsgs.buf);
pkg_name(pkg, pnaw_nonambig), aemsgs.buf);
varbuf_destroy(&aemsgs);
ohshit(_("dependency problems - leaving unconfigured"));
} else if (aemsgs.used) {
varbuf_end_str(&aemsgs);
fprintf(stderr,
_("dpkg: %s: dependency problems, but configuring anyway as you requested:\n%s"),
pkg->set->name, aemsgs.buf);
pkg_name(pkg, pnaw_nonambig), aemsgs.buf);
}
varbuf_destroy(&aemsgs);
sincenothing = 0;
......@@ -310,7 +317,7 @@ deferred_configure(struct pkginfo *pkg)
_("Package is in a very bad inconsistent state - you should\n"
" reinstall it before attempting configuration."));
printf(_("Setting up %s (%s) ...\n"), pkg->set->name,
printf(_("Setting up %s (%s) ...\n"), pkg_name(pkg, pnaw_nonambig),
versiondescribe(&pkg->installed.version, vdew_nonambig));
log_action("configure", pkg, &pkg->installed);
......@@ -396,7 +403,8 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
if (errno != ENOENT)
warning(_("%s: unable to stat config file '%s'\n"
" (= '%s'): %s"),
pkg->set->name, in, result->buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), in,
result->buf, strerror(errno));
debug(dbg_conffdetail, "conffderef nonexistent");
return 0;
} else if (S_ISREG(stab.st_mode)) {
......@@ -408,7 +416,9 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
loopprotect);
if (loopprotect++ >= 25) {
warning(_("%s: config file '%s' is a circular link\n"
" (= '%s')"), pkg->set->name, in, result->buf);
" (= '%s')"),
pkg_name(pkg, pnaw_nonambig), in,
result->buf);
return -1;
}
......@@ -418,7 +428,8 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
if (r < 0) {
warning(_("%s: unable to readlink conffile '%s'\n"
" (= '%s'): %s"),
pkg->set->name, in, result->buf, strerror(errno));
pkg_name(pkg, pnaw_nonambig), in,
result->buf, strerror(errno));
return -1;
} else if (r != stab.st_size) {
warning(_("symbolic link '%.250s' size has "
......@@ -444,8 +455,8 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
if (r < 0) {
warning(_("%s: conffile '%.250s' resolves to degenerate filename\n"
" ('%s' is a symlink to '%s')"),
pkg->set->name, in, result->buf,
target.buf);
pkg_name(pkg, pnaw_nonambig),
in, result->buf, target.buf);
return -1;
}
if (result->buf[r] == '/')
......@@ -459,7 +470,7 @@ conffderef(struct pkginfo *pkg, struct varbuf *result, const char *in)
varbuf_end_str(result);
} else {
warning(_("%s: conffile '%.250s' is not a plain file or symlink (= '%s')"),
pkg->set->name, in, result->buf);
pkg_name(pkg, pnaw_nonambig), in, result->buf);
return -1;
}
}
......@@ -491,7 +502,7 @@ md5hash(struct pkginfo *pkg, char *hashbuf, const char *fn)
strcpy(hashbuf, NONEXISTENTFLAG);
} else {
warning(_("%s: unable to open conffile %s for hash: %s"),
pkg->set->name, fn, strerror(errno));
pkg_name(pkg, pnaw_nonambig), fn, strerror(errno));
strcpy(hashbuf, "-");
}
}
......
......@@ -147,7 +147,7 @@ foundcyclebroken(struct cyclesofarlink *thislink, struct cyclesofarlink *sofar,
sol->possi->cyclebreak = true;
debug(dbg_depcon, "cycle broken at %s -> %s",
sol->possi->up->up->set->name, sol->possi->ed->name);
pkg_name(sol->possi->up->up, pnaw_nonambig), sol->possi->ed->name);
return true;
}
......@@ -175,11 +175,11 @@ findbreakcyclerecursive(struct pkginfo *pkg, struct cyclesofarlink *sofar)
for (sol = sofar; sol; sol = sol->prev) {
varbuf_add_str(&str_pkgs, " <- ");
varbuf_add_str(&str_pkgs, sol->pkg->set->name);
varbuf_add_pkgbin_name(&str_pkgs, sol->pkg, &sol->pkg->installed, pnaw_nonambig);
}
varbuf_end_str(&str_pkgs);
debug(dbg_depcondetail, "findbreakcyclerecursive %s %s", pkg->set->name,
str_pkgs.buf);
debug(dbg_depcondetail, "findbreakcyclerecursive %s %s",
pkg_name(pkg, pnaw_nonambig), str_pkgs.buf);
varbuf_destroy(&str_pkgs);
}
thislink.pkg= pkg;
......@@ -271,7 +271,7 @@ void describedepcon(struct varbuf *addto, struct dependency *dep) {
varbufdependency(&depstr, dep);
varbuf_end_str(&depstr);
varbuf_printf(addto, fmt, dep->up->set->name, depstr.buf);
varbuf_printf(addto, fmt, pkg_name(dep->up, pnaw_nonambig), depstr.buf);
varbuf_destroy(&depstr);
}
......@@ -371,11 +371,11 @@ depisok(struct dependency *dep, struct varbuf *whynot,
switch (pkg_pos->clientdata->istobe) {
case itb_remove:
sprintf(linebuf, _(" %.250s is to be removed.\n"),
pkg_pos->set->name);
pkg_name(pkg_pos, pnaw_nonambig));
break;
case itb_deconfigure:
sprintf(linebuf, _(" %.250s is to be deconfigured.\n"),
pkg_pos->set->name);
pkg_name(pkg_pos, pnaw_nonambig));
break;
case itb_installnew:
if (versionsatisfied(&pkg_pos->available, possi)) {
......@@ -384,7 +384,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
}
sprintf(linebuf, _(" %.250s is to be installed, but is version "
"%.250s.\n"),
pkg_pos->set->name,
pkgbin_name(pkg_pos, &pkg_pos->available, pnaw_nonambig),
versiondescribe(&pkg_pos->available.version, vdew_nonambig));
break;
case itb_normal:
......@@ -397,7 +397,8 @@ depisok(struct dependency *dep, struct varbuf *whynot,
return true;
}
sprintf(linebuf, _(" %.250s is installed, but is version "
"%.250s.\n"), pkg_pos->set->name,
"%.250s.\n"),
pkg_name(pkg_pos, pnaw_nonambig),
versiondescribe(&pkg_pos->installed.version, vdew_nonambig));
break;
case stat_notinstalled:
......@@ -417,12 +418,12 @@ depisok(struct dependency *dep, struct varbuf *whynot,
if (!informativeversion(&pkg_pos->configversion)) {
sprintf(linebuf, _(" %.250s is unpacked, but has never been "
"configured.\n"),
pkg_pos->set->name);
pkg_name(pkg_pos, pnaw_nonambig));
break;
} else if (!versionsatisfied(&pkg_pos->installed, possi)) {
sprintf(linebuf, _(" %.250s is unpacked, but is version "
"%.250s.\n"),
pkg_pos->set->name,
pkg_name(pkg_pos, pnaw_nonambig),
versiondescribe(&pkg_pos->installed.version,
vdew_nonambig));
break;
......@@ -430,7 +431,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
&possi->version, possi->verrel)) {
sprintf(linebuf, _(" %.250s latest configured version is "
"%.250s.\n"),
pkg_pos->set->name,
pkg_name(pkg_pos, pnaw_nonambig),
versiondescribe(&pkg_pos->configversion, vdew_nonambig));
break;
} else {
......@@ -441,7 +442,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
/* Fall through. */
default:
sprintf(linebuf, _(" %.250s is %s.\n"),
pkg_pos->set->name,
pkg_name(pkg_pos, pnaw_nonambig),
gettext(statusstrings[pkg_pos->status]));
break;
}
......@@ -479,11 +480,13 @@ depisok(struct dependency *dep, struct varbuf *whynot,
continue;
case itb_remove:
sprintf(linebuf, _(" %.250s provides %.250s but is to be removed.\n"),
provider->up->up->set->name, possi->ed->name);
pkg_name(provider->up->up, pnaw_nonambig),
possi->ed->name);
break;
case itb_deconfigure:
sprintf(linebuf, _(" %.250s provides %.250s but is to be deconfigured.\n"),
provider->up->up->set->name, possi->ed->name);
pkg_name(provider->up->up, pnaw_nonambig),
possi->ed->name);
break;
case itb_normal: case itb_preinstall:
if (provider->up->up->status == stat_installed ||
......@@ -492,7 +495,8 @@ depisok(struct dependency *dep, struct varbuf *whynot,
if (provider->up->up->status == stat_triggersawaited)
*canfixbytrigaw = provider->up->up;
sprintf(linebuf, _(" %.250s provides %.250s but is %s.\n"),
provider->up->up->set->name, possi->ed->name,
pkg_name(provider->up->up, pnaw_nonambig),
possi->ed->name,
gettext(statusstrings[provider->up->up->status]));
break;
default:
......@@ -539,7 +543,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
if (!versionsatisfied(&pkg_pos->available, possi))
break;
sprintf(linebuf, _(" %.250s (version %.250s) is to be installed.\n"),
pkg_pos->set->name,
pkgbin_name(pkg_pos, &pkg_pos->available, pnaw_nonambig),
versiondescribe(&pkg_pos->available.version, vdew_nonambig));
varbuf_add_str(whynot, linebuf);
if (!canfixbyremove)
......@@ -568,7 +572,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
if (!versionsatisfied(&pkg_pos->installed, possi))
break;
sprintf(linebuf, _(" %.250s (version %.250s) is present and %s.\n"),
pkg_pos->set->name,
pkg_name(pkg_pos, pnaw_nonambig),
versiondescribe(&pkg_pos->installed.version, vdew_nonambig),
gettext(statusstrings[pkg_pos->status]));
varbuf_add_str(whynot, linebuf);
......@@ -595,7 +599,8 @@ depisok(struct dependency *dep, struct varbuf *whynot,
if (provider->up->up->set == dep->up->set)
continue; /* Conflicts and provides the same. */
sprintf(linebuf, _(" %.250s provides %.250s and is to be installed.\n"),
provider->up->up->set->name, possi->ed->name);
pkgbin_name(provider->up->up, &provider->up->up->available,
pnaw_nonambig), possi->ed->name);
varbuf_add_str(whynot, linebuf);
/* We can't remove the one we're about to install: */
if (canfixbyremove)
......@@ -637,7 +642,7 @@ depisok(struct dependency *dep, struct varbuf *whynot,
case stat_triggersawaited:
sprintf(linebuf,
_(" %.250s provides %.250s and is present and %s.\n"),
provider->up->up->set->name, possi->ed->name,
pkg_name(provider->up->up, pnaw_nonambig), possi->ed->name,
gettext(statusstrings[provider->up->up->status]));
varbuf_add_str(whynot, linebuf);
if (!canfixbyremove)
......
......@@ -472,7 +472,8 @@ predeppackage(const char *const *argv)
varbuf_end_str(&vb);
fprintf(stderr, _("dpkg: cannot see how to satisfy pre-dependency:\n %s\n"),vb.buf);
ohshit(_("cannot satisfy pre-dependencies for %.250s (wanted due to %.250s)"),
dep->up->set->name, startpkg->set->name);
pkgbin_name(dep->up, &dep->up->available, pnaw_nonambig),
pkgbin_name(startpkg, &startpkg->available, pnaw_nonambig));
}
pkg->clientdata->istobe= itb_preinstall;
for (dep= pkg->available.depends; dep; dep= dep->next) {
......
......@@ -103,11 +103,11 @@ skip_due_to_hold(struct pkginfo *pkg)
return false;
if (fc_hold) {
fprintf(stderr, _("Package %s was on hold, processing it anyway as you requested\n"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
return false;
}
printf(_("Package %s is on hold, not touching it. Use --force-hold to override.\n"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
return true;
}
......
......@@ -307,12 +307,13 @@ ensure_packagefiles_available(struct pkginfo *pkg)
if (fd==-1) {
if (errno != ENOENT)
ohshite(_("unable to open files list file for package `%.250s'"),
pkg->set->name);
pkg_name(pkg, pnaw_foreign));
onerr_abort--;
if (pkg->status != stat_configfiles) {
if (saidread == 1) putc('\n',stderr);
warning(_("files list file for package `%.250s' missing, assuming "
"package has no files currently installed."), pkg->set->name);
"package has no files currently installed."),
pkg_name(pkg, pnaw_nonambig));
}
pkg->clientdata->files = NULL;
pkg->clientdata->fileslistvalid = true;
......@@ -323,25 +324,26 @@ ensure_packagefiles_available(struct pkginfo *pkg)
if(fstat(fd, &stat_buf))
ohshite(_("unable to stat files list file for package '%.250s'"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
if (!S_ISREG(stat_buf.st_mode))
ohshit(_("files list for package '%.250s' is not a regular file"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
if (stat_buf.st_size) {
loaded_list = nfmalloc(stat_buf.st_size);
loaded_list_end = loaded_list + stat_buf.st_size;
if (fd_read(fd, loaded_list, stat_buf.st_size) < 0)
ohshite(_("reading files list for package '%.250s'"), pkg->set->name);
ohshite(_("reading files list for package '%.250s'"),
pkg_name(pkg, pnaw_nonambig));
lendp= &pkg->clientdata->files;
thisline = loaded_list;
while (thisline < loaded_list_end) {
if (!(ptr = memchr(thisline, '\n', loaded_list_end - thisline)))
ohshit(_("files list file for package '%.250s' is missing final newline"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
/* Where to start next time around. */
nextline = ptr + 1;
/* Strip trailing ‘/’. */
......@@ -349,7 +351,7 @@ ensure_packagefiles_available(struct pkginfo *pkg)
/* Add the file to the list. */
if (ptr == thisline)
ohshit(_("files list file for package `%.250s' contains empty filename"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
*ptr = '\0';
lendp = pkg_files_add_file(pkg, thisline, fnn_nocopy, lendp);
thisline = nextline;
......@@ -358,7 +360,7 @@ ensure_packagefiles_available(struct pkginfo *pkg)
pop_cleanup(ehflag_normaltidy); /* fd = open() */
if (close(fd))
ohshite(_("error closing files list file for package `%.250s'"),
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
onerr_abort--;
......
......@@ -67,7 +67,7 @@ namenodetouse(struct filenamenode *namenode, struct pkginfo *pkg,
}
debug(dbg_eachfile,"namenodetouse namenode=`%s' pkg=%s",
namenode->name, pkg->set->name);
namenode->name, pkgbin_name(pkg, pkgbin, pnaw_nonambig));
r=
(namenode->divert->useinstead && namenode->divert->pkgset != pkg->set)
......@@ -495,13 +495,13 @@ dir_has_conffiles(struct filenamenode *file, struct pkginfo *pkg)
size_t namelen;
debug(dbg_veryverbose, "dir_has_conffiles '%s' (from %s)", file->name,
pkg->set->name);
pkg_name(pkg, pnaw_nonambig));
namelen = strlen(file->name);
for (conff= pkg->installed.conffiles; conff; conff= conff->next) {
if (strncmp(file->name, conff->name, namelen) == 0 &&
conff->name[namelen] == '/') {
debug(dbg_veryverbose, "directory %s has conffile %s from %s",
file->name, conff->name, pkg->set->name);
file->name, conff->name, pkg_name(pkg, pnaw_nonambig));
return true;
}
}
......@@ -520,12 +520,12 @@ dir_is_used_by_others(struct filenamenode *file, struct pkginfo *pkg)
struct pkginfo *other_pkg;
debug(dbg_veryverbose, "dir_is_used_by_others '%s' (except %s)", file->name,
pkg ? pkg->set->name : "<none>");
pkg ? pkg_name(pkg, pnaw_nonambig) : "<none>");
iter = filepackages_iter_new(file);
while ((other_pkg = filepackages_iter_next(iter))) {
debug(dbg_veryverbose, "dir_is_used_by_others considering %s ...",
other_pkg->set->name);
pkg_name(other_pkg, pnaw_nonambig));
if (other_pkg == pkg)
continue;
......@@ -549,7 +549,7 @@ dir_is_used_by_pkg(struct filenamenode *file, struct pkginfo *pkg,
size_t namelen;
debug(dbg_veryverbose, "dir_is_used_by_pkg '%s' (by %s)",
file->name, pkg ? pkg->set->name : "<none>");
file->name, pkg ? pkg_name(pkg, pnaw_nonambig) : "<none>");
namelen = strlen(file->name);
......
......@@ -179,12 +179,12 @@ void process_queue(void) {
case act_triggers:
case act_configure: case act_remove: case act_purge:
printf(_("Package %s listed more than once, only processing once.\n"),
rundown->pkg->set->name);
pkg_name(rundown->pkg, pnaw_nonambig));
break;
case act_install:
printf(_("More than one copy of package %s has been unpacked\n"
" in this run ! Only configuring it once.\n"),
rundown->pkg->set->name);
pkg_name(rundown->pkg, pnaw_nonambig));
break;
default:
internerr("unknown action '%d'", cipaction->arg_int);
......@@ -233,7 +233,7 @@ void process_queue(void) {
if (!pkg->trigpend_head)
ohshit(_("package %.250s is not ready for trigger processing\n"
" (current status `%.250s' with no pending triggers)"),
pkg->set->name, statusinfos[pkg->status].name);
pkg_name(pkg, pnaw_nonambig), statusinfos[pkg->status].name);
/* Fall through. */
case act_install:
/* Don't try to configure pkgs that we've just disappeared. */
......@@ -334,10 +334,10 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
if (providing) {
varbuf_printf(oemsgs,
_(" Package %s which provides %s is to be removed.\n"),
possdependee->set->name, providing->name);
pkg_name(possdependee, pnaw_nonambig), providing->name);
} else {
varbuf_printf(oemsgs, _(" Package %s is to be removed.\n"),
possdependee->set->name);
pkg_name(possdependee, pnaw_nonambig));
}
*matched = true;
......@@ -354,7 +354,7 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
case stat_installed:
if (checkversion && !versionsatisfied(&possdependee->installed,checkversion)) {
varbuf_printf(oemsgs, _(" Version of %s on system is %s.\n"),
possdependee->set->name,
pkg_name(possdependee, pnaw_nonambig),
versiondescribe(&possdependee->installed.version,
vdew_nonambig));
assert(checkversion->verrel != dvr_none);
......@@ -376,11 +376,11 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
if (providing) {
varbuf_printf(oemsgs,
_(" Package %s which provides %s awaits trigger processing.\n"),
possdependee->set->name, providing->name);
pkg_name(possdependee, pnaw_nonambig), providing->name);
} else {
varbuf_printf(oemsgs,
_(" Package %s awaits trigger processing.\n"),
possdependee->set->name);
pkg_name(possdependee, pnaw_nonambig));
}
debug(dbg_depcondetail, " triggers-awaited, no fixbytrig");
goto unsuitable;
......@@ -398,7 +398,7 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
*fixbytrig = possdependee->trigaw.head->pend;
debug(dbg_depcondetail,
" triggers-awaited, fixbytrig '%s', defer",
(*fixbytrig)->set->name);
pkg_name(*fixbytrig, pnaw_nonambig));
return found_defer;
}
if (possdependee->clientdata &&
......@@ -410,7 +410,8 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
!(possdependee->status == stat_halfconfigured)) {
fprintf(stderr,
_("dpkg: also configuring `%s' (required by `%s')\n"),
possdependee->set->name, requiredby->set->name);
pkg_name(possdependee, pnaw_nonambig),
pkg_name(requiredby, pnaw_nonambig));
add_to_queue(possdependee);
sincenothing = 0;
return found_defer;
......@@ -418,10 +419,10 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
if (providing) {
varbuf_printf(oemsgs,
_(" Package %s which provides %s is not configured yet.\n"),
possdependee->set->name, providing->name);
pkg_name(possdependee, pnaw_nonambig), providing->name);
} else {
varbuf_printf(oemsgs, _(" Package %s is not configured yet.\n"),
possdependee->set->name);
pkg_name(possdependee, pnaw_nonambig));
}
debug(dbg_depcondetail, " not configured/able");
......@@ -432,10 +433,10 @@ deppossi_ok_found(struct pkginfo *possdependee, struct pkginfo *requiredby,
if (providing) {
varbuf_printf(oemsgs,
_(" Package %s which provides %s is not installed.\n"),
possdependee->set->name, providing->name);
pkg_name(possdependee, pnaw_nonambig), providing->name);
} else {
varbuf_printf(oemsgs, _(" Package %s is not installed.\n"),
possdependee->set->name);
pkg_name(possdependee, pnaw_nonambig));
}
debug(dbg_depcondetail, " not installed");
......@@ -460,7 +461,8 @@ breaks_check_one(struct varbuf *aemsgs, enum dep_check *ok,
struct varbuf depmsg = VARBUF_INIT;
debug(dbg_depcondetail, " checking breaker %s virtbroken %s",
breaker->set->name, virtbroken ? virtbroken->name : "<none>");
pkg_name(breaker, pnaw_nonambig),
virtbroken ? virtbroken->name : "<none>");
if (breaker->status == stat_notinstalled ||
breaker->status == stat_configfiles) return;
......@@ -472,18 +474,20 @@ breaks_check_one(struct varbuf *aemsgs, enum dep_check *ok,
varbufdependency(&depmsg, breaks->up);
varbuf_end_str(&depmsg);
varbuf_printf(aemsgs, _(" %s (%s) breaks %s and is %s.\n"), breaker->set->name,
varbuf_printf(aemsgs, _(" %s (%s) breaks %s and is %s.\n"),
pkg_name(breaker, pnaw_nonambig),
versiondescribe(&breaker->installed.version, vdew_nonambig),
depmsg.buf, gettext(statusstrings[breaker->status]));
varbuf_destroy(&depmsg);
if (virtbroken) {
varbuf_printf(aemsgs, _(" %s (%s) provides %s.\n"), broken->set->name,
varbuf_printf(aemsgs, _(" %s (%s) provides %s.\n"),
pkg_name(broken, pnaw_nonambig),
versiondescribe(&broken->installed.version, vdew_nonambig),
virtbroken->name);
} else if (breaks->verrel != dvr_none) {
varbuf_printf(aemsgs, _(" Version of %s to be configured is %s.\n"),
broken->set->name,
pkg_name(broken, pnaw_nonambig),
versiondescribe(&broken->installed.version, vdew_nonambig));
if (fc_dependsversion) return;
}
......@@ -546,7 +550,8 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
interestingwarnings= 0;
ok = dep_check_ok;
debug(dbg_depcon,"checking dependencies of %s (- %s)",
pkg->set->name, removing ? removing->set->name : "<none>");
pkg_name(pkg, pnaw_nonambig),
removing ? pkg_name(removing, pnaw_nonambig) : "<none>");
anycannotfixbytrig = false;
canfixbytrig = NULL;
......@@ -588,7 +593,7 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
if (provider->up->type != dep_provides)
continue;
debug(dbg_depcondetail, " checking provider %s",
provider->up->up->set->name);
pkg_name(provider->up->up, pnaw_nonambig));
thisf = deppossi_ok_found(provider->up->up, pkg, removing,
possi->ed,
&possfixbytrig, &matched, NULL,
......@@ -601,7 +606,8 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
if (thisf > found) found= thisf;
}
debug(dbg_depcondetail, " found %d matched %d possfixbytrig %s",
found, matched, possfixbytrig ? possfixbytrig->set->name : "-");
found, matched,
possfixbytrig ? pkg_name(possfixbytrig, pnaw_nonambig) : "-");
if (removing && !matched) continue;
switch (found) {
case found_none:
......@@ -609,7 +615,7 @@ dependencies_ok(struct pkginfo *pkg, struct pkginfo *removing,
ok = dep_check_halt;
case found_forced:
varbuf_add_str(aemsgs, " ");
varbuf_add_str(aemsgs, pkg