summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillem Jover <guillem@debian.org>2011-03-01 04:43:29 +0100
committerGuillem Jover <guillem@debian.org>2012-02-01 06:33:38 +0100
commit0b8652b226a7601dfd71471797d15168a7337242 (patch)
tree3299284b6a613726fa3f94663319d015fcba44f0 /src
parentff66f87ae809dfad6fe0f621f54a105b999e38b2 (diff)
downloaddpkg-0b8652b226a7601dfd71471797d15168a7337242.tar.gz
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 <hertzog@debian.org> Patch-sponsored-by: Linaro Limited Signed-off-by: Guillem Jover <guillem@debian.org>
Diffstat (limited to 'src')
-rw-r--r--src/archives.c79
-rw-r--r--src/configure.c49
-rw-r--r--src/depcon.c45
-rw-r--r--src/enquiry.c3
-rw-r--r--src/errors.c4
-rw-r--r--src/filesdb.c18
-rw-r--r--src/help.c12
-rw-r--r--src/packages.c50
-rw-r--r--src/processarc.c46
-rw-r--r--src/querycmd.c15
-rw-r--r--src/remove.c35
-rw-r--r--src/trigproc.c46
12 files changed, 237 insertions, 165 deletions
diff --git a/src/archives.c b/src/archives.c
index 606a12839..29989cb12 100644
--- a/src/archives.c
+++ b/src/archives.c
@@ -118,7 +118,7 @@ filesavespackage(struct fileinlist *file,
struct pkginfo *thirdpkg;
debug(dbg_eachfiledetail,"filesavespackage file `%s' package %s",
- file->namenode->name, pkgtobesaved->set->name);
+ file->namenode->name, pkg_name(pkgtobesaved, pnaw_nonambig));
/* If the file is a contended one and it's overridden by either
* the package we're considering disappearing or the package
@@ -141,7 +141,7 @@ filesavespackage(struct fileinlist *file,
iter = filepackages_iter_new(file->namenode);
while ((thirdpkg = filepackages_iter_next(iter))) {
debug(dbg_eachfiledetail, "filesavespackage ... also in %s",
- thirdpkg->set->name);
+ pkg_name(thirdpkg, pnaw_nonambig));
/* Is this not the package being installed or the one being
* checked for disappearance? */
@@ -216,8 +216,10 @@ does_replace(struct pkginfo *newpigp, struct pkgbin *newpifp,
{
struct dependency *dep;
- debug(dbg_depcon,"does_replace new=%s old=%s (%s)", newpigp->set->name,
- oldpigp->set->name, versiondescribe(&oldpifp->version, vdew_always));
+ debug(dbg_depcon,"does_replace new=%s old=%s (%s)",
+ pkgbin_name(newpigp, newpifp, pnaw_nonambig),
+ pkgbin_name(oldpigp, oldpifp, pnaw_nonambig),
+ versiondescribe(&oldpifp->version, vdew_always));
for (dep= newpifp->depends; dep; dep= dep->next) {
if (dep->type != dep_replaces || dep->list->ed != oldpigp->set)
continue;
@@ -573,7 +575,8 @@ tarobject(void *ctx, struct tar_entry *ti)
while ((otherpkg = filepackages_iter_next(iter))) {
if (otherpkg == tc->pkg)
continue;
- debug(dbg_eachfile, "tarobject ... found in %s", otherpkg->set->name);
+ debug(dbg_eachfile, "tarobject ... found in %s",
+ pkg_name(otherpkg, pnaw_nonambig));
if (nifd->namenode->divert && nifd->namenode->divert->useinstead) {
/* Right, so we may be diverting this file. This makes the conflict
@@ -642,12 +645,12 @@ tarobject(void *ctx, struct tar_entry *ti)
if (does_replace(tc->pkg, &tc->pkg->available,
otherpkg, &otherpkg->installed)) {
printf(_("Replacing files in old package %s ...\n"),
- otherpkg->set->name);
+ pkg_name(otherpkg, pnaw_nonambig));
otherpkg->clientdata->replacingfilesandsaid = 1;
} else if (does_replace(otherpkg, &otherpkg->installed,
tc->pkg, &tc->pkg->available)) {
printf(_("Replaced by files in installed package %s ...\n"),
- otherpkg->set->name);
+ pkg_name(otherpkg, pnaw_nonambig));
otherpkg->clientdata->replacingfilesandsaid = 2;
nifd->namenode->flags &= ~fnnf_new_inarchive;
keepexisting = true;
@@ -657,14 +660,14 @@ tarobject(void *ctx, struct tar_entry *ti)
forcibleerr(fc_overwritedir,
_("trying to overwrite directory '%.250s' "
"in package %.250s %.250s with nondirectory"),
- nifd->namenode->name, otherpkg->set->name,
+ nifd->namenode->name, pkg_name(otherpkg, pnaw_nonambig),
versiondescribe(&otherpkg->installed.version,
vdew_nonambig));
} else {
forcibleerr(fc_overwrite,
_("trying to overwrite '%.250s', "
"which is also in package %.250s %.250s"),
- nifd->namenode->name, otherpkg->set->name,
+ nifd->namenode->name, pkg_name(otherpkg, pnaw_nonambig),
versiondescribe(&otherpkg->installed.version,
vdew_nonambig));
}
@@ -1008,11 +1011,12 @@ try_deconfigure_can(bool (*force_p)(struct deppossi *), struct pkginfo *pkg,
if (pkg->installed.essential) {
if (fc_removeessential) {
warning(_("considering deconfiguration of essential\n"
- " package %s, to enable %s."), pkg->set->name, action);
+ " package %s, to enable %s."),
+ pkg_name(pkg, pnaw_nonambig), action);
} else {
fprintf(stderr, _("dpkg: no, %s is essential, will not deconfigure\n"
" it in order to enable %s.\n"),
- pkg->set->name, action);
+ pkg_name(pkg, pnaw_nonambig), action);
return 0;
}
}
@@ -1034,7 +1038,7 @@ static int try_remove_can(struct deppossi *pdep,
struct pkginfo *fixbyrm,
const char *why) {
char action[512];
- sprintf(action, _("removal of %.250s"), fixbyrm->set->name);
+ sprintf(action, _("removal of %.250s"), pkg_name(fixbyrm, pnaw_nonambig));
return try_deconfigure_can(force_depends, pdep->up->up, pdep,
action, fixbyrm, why);
}
@@ -1059,20 +1063,23 @@ void check_breaks(struct dependency *dep, struct pkginfo *pkg,
ensure_package_clientdata(fixbydeconf);
assert(fixbydeconf->clientdata->istobe == itb_normal);
- sprintf(action, _("installation of %.250s"), pkg->set->name);
+ sprintf(action, _("installation of %.250s"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
fprintf(stderr, _("dpkg: considering deconfiguration of %s,"
" which would be broken by %s ...\n"),
- fixbydeconf->set->name, action);
+ pkg_name(fixbydeconf, pnaw_nonambig), action);
ok= try_deconfigure_can(force_breaks, fixbydeconf, dep->list,
action, NULL, why.buf);
if (ok == 1) {
fprintf(stderr, _("dpkg: yes, will deconfigure %s (broken by %s).\n"),
- fixbydeconf->set->name, pkg->set->name);
+ pkg_name(fixbydeconf, pnaw_nonambig),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
}
} else {
fprintf(stderr, _("dpkg: regarding %s containing %s:\n%s"),
- pfilename, pkg->set->name, why.buf);
+ pfilename, pkgbin_name(pkg, &pkg->available, pnaw_nonambig),
+ why.buf);
ok= 0;
}
varbuf_destroy(&why);
@@ -1086,10 +1093,11 @@ void check_breaks(struct dependency *dep, struct pkginfo *pkg,
if (fixbydeconf && !f_autodeconf) {
ohshit(_("installing %.250s would break %.250s, and\n"
" deconfiguration is not permitted (--auto-deconfigure might help)"),
- pkg->set->name, fixbydeconf->set->name);
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig),
+ pkg_name(fixbydeconf, pnaw_nonambig));
} else {
ohshit(_("installing %.250s would break existing software"),
- pkg->set->name);
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
}
}
@@ -1119,13 +1127,14 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
assert(fixbyrm->clientdata->istobe == itb_normal || fixbyrm->clientdata->istobe == itb_deconfigure);
fixbyrm->clientdata->istobe= itb_remove;
fprintf(stderr, _("dpkg: considering removing %s in favour of %s ...\n"),
- fixbyrm->set->name, pkg->set->name);
+ pkg_name(fixbyrm, pnaw_nonambig),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
if (!(fixbyrm->status == stat_installed ||
fixbyrm->status == stat_triggerspending ||
fixbyrm->status == stat_triggersawaited)) {
fprintf(stderr,
_("%s is not properly installed - ignoring any dependencies on it.\n"),
- fixbyrm->set->name);
+ pkg_name(fixbyrm, pnaw_nonambig));
pdep = NULL;
} else {
for (pdep = fixbyrm->set->depended.installed;
@@ -1155,7 +1164,8 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
varbuf_end_str(&removalwhy);
fprintf(stderr, _("dpkg"
": may have trouble removing %s, as it provides %s ...\n"),
- fixbyrm->set->name, providecheck->list->ed->name);
+ pkg_name(fixbyrm, pnaw_nonambig),
+ providecheck->list->ed->name);
if (!try_remove_can(pdep,fixbyrm,removalwhy.buf))
goto break_from_both_loops_at_once;
}
@@ -1169,10 +1179,11 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
if (!pdep && (fixbyrm->eflag & eflag_reinstreq)) {
if (fc_removereinstreq) {
fprintf(stderr, _("dpkg: package %s requires reinstallation, but will"
- " remove anyway as you requested.\n"), fixbyrm->set->name);
+ " remove anyway as you requested.\n"),
+ pkg_name(fixbyrm, pnaw_nonambig));
} else {
fprintf(stderr, _("dpkg: package %s requires reinstallation, "
- "will not remove.\n"), fixbyrm->set->name);
+ "will not remove.\n"), pkg_name(fixbyrm, pnaw_nonambig));
pdep= &flagdeppossi;
}
}
@@ -1181,7 +1192,8 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
push_conflictor(pkg, fixbyrm);
varbuf_destroy(&conflictwhy); varbuf_destroy(&removalwhy);
fprintf(stderr, _("dpkg: yes, will remove %s in favour of %s.\n"),
- fixbyrm->set->name, pkg->set->name);
+ pkg_name(fixbyrm, pnaw_nonambig),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
return;
}
/* Put it back. */
@@ -1190,9 +1202,11 @@ void check_conflict(struct dependency *dep, struct pkginfo *pkg,
}
varbuf_end_str(&conflictwhy);
fprintf(stderr, _("dpkg: regarding %s containing %s:\n%s"),
- pfilename, pkg->set->name, conflictwhy.buf);
+ pfilename, pkgbin_name(pkg, &pkg->available, pnaw_nonambig),
+ conflictwhy.buf);
if (!force_conflicts(dep->list))
- ohshit(_("conflicting packages - not installing %.250s"), pkg->set->name);
+ ohshit(_("conflicting packages - not installing %.250s"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
warning(_("ignoring conflict, may proceed anyway!"));
varbuf_destroy(&conflictwhy);
@@ -1370,11 +1384,12 @@ wanttoinstall(struct pkginfo *pkg)
if (pkg->want != want_install && pkg->want != want_hold) {
if (f_alsoselect) {
printf(_("Selecting previously unselected package %s.\n"),
- pkg->set->name);
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
pkg->want = want_install;
return true;
} else {
- printf(_("Skipping unselected package %s.\n"), pkg->set->name);
+ printf(_("Skipping unselected package %s.\n"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
return false;
}
}
@@ -1393,20 +1408,22 @@ wanttoinstall(struct pkginfo *pkg)
fprintf(stderr, _("Version %.250s of %.250s already installed, "
"skipping.\n"),
versiondescribe(&pkg->installed.version, vdew_nonambig),
- pkg->set->name);
+ pkg_name(pkg, pnaw_nonambig));
return false;
} else {
return true;
}
} else {
if (fc_downgrade) {
- warning(_("downgrading %.250s from %.250s to %.250s."), pkg->set->name,
+ warning(_("downgrading %.250s from %.250s to %.250s."),
+ pkg_name(pkg, pnaw_nonambig),
versiondescribe(&pkg->installed.version, vdew_nonambig),
versiondescribe(&pkg->available.version, vdew_nonambig));
return true;
} else {
fprintf(stderr, _("Will not downgrade %.250s from version %.250s "
- "to %.250s, skipping.\n"), pkg->set->name,
+ "to %.250s, skipping.\n"),
+ pkg_name(pkg, pnaw_nonambig),
versiondescribe(&pkg->installed.version, vdew_nonambig),
versiondescribe(&pkg->available.version, vdew_nonambig));
return false;
diff --git a/src/configure.c b/src/configure.c
index 1d7cf1de1..e285d08a5 100644
--- a/src/configure.c
+++ b/src/configure.c
@@ -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, "-");
}
}
diff --git a/src/depcon.c b/src/depcon.c
index 7f7fca41c..e615d8f20 100644
--- a/src/depcon.c
+++ b/src/depcon.c
@@ -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)
diff --git a/src/enquiry.c b/src/enquiry.c
index 3b3e1dbb0..c90689e14 100644
--- a/src/enquiry.c
+++ b/src/enquiry.c
@@ -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) {
diff --git a/src/errors.c b/src/errors.c
index 2dec00167..fc8afbe10 100644
--- a/src/errors.c
+++ b/src/errors.c
@@ -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;
}
diff --git a/src/filesdb.c b/src/filesdb.c
index ad60a02d4..252bd38fa 100644
--- a/src/filesdb.c
+++ b/src/filesdb.c
@@ -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--;
diff --git a/src/help.c b/src/help.c
index 9e0d4797c..7ae6e108a 100644
--- a/src/help.c
+++ b/src/help.c
@@ -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);
diff --git a/src/packages.c b/src/packages.c
index c0dbdaa76..89d8a66de 100644
--- a/src/packages.c
+++ b/src/packages.c
@@ -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->set->name);
+ varbuf_add_pkgbin_name(aemsgs, pkg, &pkg->installed, pnaw_nonambig);
varbuf_add_str(aemsgs, _(" depends on "));
varbufdependency(aemsgs, dep);
if (interestingwarnings) {
diff --git a/src/processarc.c b/src/processarc.c
index 1317da673..ef37fa66a 100644
--- a/src/processarc.c
+++ b/src/processarc.c
@@ -204,7 +204,7 @@ push_conflictor(struct pkginfo *pkg, struct pkginfo *pkg_fixbyrm)
{
if (cflict_index >= MAXCONFLICTORS)
ohshit(_("package %s has too many Conflicts/Replaces pairs"),
- pkg->set->name);
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
conflictor[cflict_index++] = pkg_fixbyrm;
}
@@ -298,7 +298,8 @@ pkg_infodb_update(struct pkginfo *pkg, char *cidir, char *cidirrest)
continue;
}
if (strcmp(de->d_name, LISTFILE) == 0) {
- warning(_("package %s contained list as info file"), pkg->set->name);
+ warning(_("package %s contained list as info file"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
continue;
}
@@ -341,9 +342,10 @@ static void
pkg_disappear(struct pkginfo *pkg, struct pkginfo *infavour)
{
printf(_("(Noting disappearance of %s, which has been completely replaced.)\n"),
- pkg->set->name);
+ pkg_name(pkg, pnaw_nonambig));
log_action("disappear", pkg, &pkg->installed);
- debug(dbg_general, "pkg_disappear disappearing %s", pkg->set->name);
+ debug(dbg_general, "pkg_disappear disappearing %s",
+ pkg_name(pkg, pnaw_nonambig));
trig_activate_packageprocessing(pkg);
maintainer_script_installed(pkg, POSTRMFILE,
@@ -466,7 +468,8 @@ void process_archive(const char *filename) {
pkg->files->size = psize;
if (cipaction->arg_int == act_avail) {
- printf(_("Recorded info about %s from %s.\n"), pkg->set->name, pfilename);
+ printf(_("Recorded info about %s from %s.\n"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig), pfilename);
pop_cleanup(ehflag_normaltidy);
return;
}
@@ -530,10 +533,11 @@ void process_archive(const char *filename) {
} else {
varbuf_end_str(&depprobwhy);
fprintf(stderr, _("dpkg: regarding %s containing %s, pre-dependency problem:\n%s"),
- pfilename, pkg->set->name, depprobwhy.buf);
+ pfilename, pkgbin_name(pkg, &pkg->available, pnaw_nonambig),
+ depprobwhy.buf);
if (!force_depends(dsearch->list))
ohshit(_("pre-dependency problem - not installing %.250s"),
- pkg->set->name);
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
warning(_("ignoring pre-dependency problem!"));
}
}
@@ -551,12 +555,13 @@ void process_archive(const char *filename) {
if (pkg->status != stat_notinstalled && pkg->status != stat_configfiles) {
printf(_("Preparing to replace %s %s (using %s) ...\n"),
- pkg->set->name,
+ pkg_name(pkg, pnaw_nonambig),
versiondescribe(&pkg->installed.version,vdew_nonambig),
pfilename);
log_action("upgrade", pkg, &pkg->installed);
} else {
- printf(_("Unpacking %s (from %s) ...\n"), pkg->set->name, pfilename);
+ printf(_("Unpacking %s (from %s) ...\n"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig), pfilename);
log_action("install", pkg, &pkg->available);
}
@@ -612,17 +617,18 @@ void process_archive(const char *filename) {
while ((otherpkg = filepackages_iter_next(iter))) {
debug(dbg_conffdetail,
"process_archive conffile `%s' in package %s - conff ?",
- newconff->namenode->name, otherpkg->set->name);
+ newconff->namenode->name, pkg_name(otherpkg, pnaw_nonambig));
for (searchconff = otherpkg->installed.conffiles;
searchconff && strcmp(newconff->namenode->name, searchconff->name);
searchconff = searchconff->next)
debug(dbg_conffdetail,
"process_archive conffile `%s' in package %s - conff ? not `%s'",
- newconff->namenode->name, otherpkg->set->name, searchconff->name);
+ newconff->namenode->name, pkg_name(otherpkg, pnaw_nonambig),
+ searchconff->name);
if (searchconff) {
debug(dbg_conff,
"process_archive conffile `%s' package=%s %s hash=%s",
- newconff->namenode->name, otherpkg->set->name,
+ newconff->namenode->name, pkg_name(otherpkg, pnaw_nonambig),
otherpkg == pkg ? "same" : "different!",
searchconff->hash);
if (otherpkg == pkg)
@@ -686,9 +692,11 @@ void process_archive(const char *filename) {
if (removing)
printf(_("De-configuring %s, to allow removal of %s ...\n"),
- deconpil->pkg->set->name, removing->set->name);
+ pkg_name(deconpil->pkg, pnaw_nonambig),
+ pkg_name(removing, pnaw_nonambig));
else
- printf(_("De-configuring %s ...\n"), deconpil->pkg->set->name);
+ printf(_("De-configuring %s ...\n"),
+ pkg_name(deconpil->pkg, pnaw_nonambig));
trig_activate_packageprocessing(deconpil->pkg);
deconpil->pkg->status= stat_halfconfigured;
@@ -762,7 +770,8 @@ void process_archive(const char *filename) {
"upgrade", versiondescribe(&pkg->installed.version,
vdew_nonambig),
NULL);
- printf(_("Unpacking replacement %.250s ...\n"), pkg->set->name);
+ printf(_("Unpacking replacement %.250s ...\n"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
}
/*
@@ -1160,7 +1169,7 @@ void process_archive(const char *filename) {
otherpkg->clientdata->istobe == itb_remove ||
!otherpkg->clientdata->files) continue;
debug(dbg_veryverbose, "process_archive checking disappearance %s",
- otherpkg->set->name);
+ pkg_name(otherpkg, pnaw_nonambig));
assert(otherpkg->clientdata->istobe == itb_normal ||
otherpkg->clientdata->istobe == itb_deconfigure);
for (cfile= otherpkg->clientdata->files;
@@ -1253,7 +1262,7 @@ void process_archive(const char *filename) {
iter = filepackages_iter_new(cfile->namenode);
while ((otherpkg = filepackages_iter_next(iter))) {
debug(dbg_eachfiledetail, "process_archive ... found in %s",
- otherpkg->set->name);
+ pkg_name(otherpkg, pnaw_nonambig));
/* If !fileslistvalid then it's one of the disappeared packages above
* and we don't bother with it here, clearly. */
if (otherpkg == pkg || !otherpkg->clientdata->fileslistvalid)
@@ -1269,7 +1278,8 @@ void process_archive(const char *filename) {
write_filelist_except(otherpkg, &otherpkg->installed,
otherpkg->clientdata->files, fnnf_elide_other_lists);
ensure_package_clientdata(otherpkg);
- debug(dbg_veryverbose, "process_archive overwrote from %s", otherpkg->set->name);
+ debug(dbg_veryverbose, "process_archive overwrote from %s",
+ pkg_name(otherpkg, pnaw_nonambig));
}
filepackages_iter_free(iter);
}
diff --git a/src/querycmd.c b/src/querycmd.c
index bb9552ae5..94d56284a 100644
--- a/src/querycmd.c
+++ b/src/querycmd.c
@@ -391,7 +391,9 @@ enqperpackage(const char *const *argv)
!pkg->files &&
pkg->want == want_unknown &&
!pkg_is_informative(pkg, &pkg->installed)) {
- fprintf(stderr, _("Package `%s' is not installed and no info is available.\n"), pkg->set->name);
+ fprintf(stderr,
+ _("Package `%s' is not installed and no info is available.\n"),
+ pkg_name(pkg, pnaw_nonambig));
failures++;
} else {
writerecord(stdout, _("<standard output>"), pkg, &pkg->installed);
@@ -399,7 +401,8 @@ enqperpackage(const char *const *argv)
break;
case act_printavail:
if (!pkg_is_informative(pkg, &pkg->available)) {
- fprintf(stderr, _("Package `%s' is not available.\n"), pkg->set->name);
+ fprintf(stderr, _("Package `%s' is not available.\n"),
+ pkgbin_name(pkg, &pkg->available, pnaw_nonambig));
failures++;
} else {
writerecord(stdout, _("<standard output>"), pkg, &pkg->available);
@@ -408,7 +411,8 @@ enqperpackage(const char *const *argv)
case act_listfiles:
switch (pkg->status) {
case stat_notinstalled:
- fprintf(stderr, _("Package `%s' is not installed.\n"), pkg->set->name);
+ fprintf(stderr, _("Package `%s' is not installed.\n"),
+ pkg_name(pkg, pnaw_nonambig));
failures++;
break;
default:
@@ -417,7 +421,7 @@ enqperpackage(const char *const *argv)
file= pkg->clientdata->files;
if (!file) {
printf(_("Package `%s' does not contain any files (!)\n"),
- pkg->set->name);
+ pkg_name(pkg, pnaw_nonambig));
} else {
while (file) {
namenode= file->namenode;
@@ -585,7 +589,8 @@ control_path(const char *const *argv)
pkg = pkg_db_find(pkgname);
if (pkg->status == stat_notinstalled)
- ohshit(_("Package `%s' is not installed.\n"), pkg->set->name);
+ ohshit(_("Package `%s' is not installed.\n"),
+ pkg_name(pkg, pnaw_nonambig));
if (control_file)
control_path_file(pkg, control_file);
diff --git a/src/remove.c b/src/remove.c
index 6bbb01bb4..e56b73cc0 100644
--- a/src/remove.c
+++ b/src/remove.c
@@ -57,13 +57,15 @@ static void checkforremoval(struct pkginfo *pkgtoremove,
for (possi = pkgdepcheck->depended.installed; possi; possi = possi->rev_next) {
if (possi->up->type != dep_depends && possi->up->type != dep_predepends) continue;
depender= possi->up->up;
- debug(dbg_depcon, "checking depending package `%s'", depender->set->name);
+ debug(dbg_depcon, "checking depending package `%s'",
+ pkg_name(depender, pnaw_nonambig));
if (!(depender->status == stat_installed ||
depender->status == stat_triggerspending ||
depender->status == stat_triggersawaited))
continue;
if (ignore_depends(depender)) {
- debug(dbg_depcon, "ignoring depending package '%s'", depender->set->name);
+ debug(dbg_depcon, "ignoring depending package '%s'",
+ pkg_name(depender, pnaw_nonambig));
continue;
}
if (dependtry > 1) { if (findbreakcycle(pkgtoremove)) sincenothing= 0; }
@@ -82,11 +84,12 @@ void deferred_remove(struct pkginfo *pkg) {
int rok;
struct dependency *dep;
- debug(dbg_general, "deferred_remove package %s", pkg->set->name);
+ debug(dbg_general, "deferred_remove package %s",
+ pkg_name(pkg, pnaw_nonambig));
if (pkg->status == stat_notinstalled) {
warning(_("ignoring request to remove %.250s which isn't installed."),
- pkg->set->name);
+ pkg_name(pkg, pnaw_nonambig));
pkg->clientdata->istobe= itb_normal;
return;
} else if (!f_pending &&
@@ -94,7 +97,7 @@ void deferred_remove(struct pkginfo *pkg) {
cipaction->arg_int != act_purge) {
warning(_("ignoring request to remove %.250s, only the config\n"
" files of which are on the system. Use --purge to remove them too."),
- pkg->set->name);
+ pkg_name(pkg, pnaw_nonambig));
pkg->clientdata->istobe= itb_normal;
return;
}
@@ -107,7 +110,8 @@ void deferred_remove(struct pkginfo *pkg) {
pkg->want = (cipaction->arg_int == act_purge) ? want_purge : want_deinstall;
if (!f_noact) modstatdb_note(pkg);
- debug(dbg_general, "checking dependencies for remove `%s'", pkg->set->name);
+ debug(dbg_general, "checking dependencies for remove `%s'",
+ pkg_name(pkg, pnaw_nonambig));
rok= 2;
checkforremoval(pkg, pkg->set, &rok, &raemsgs);
for (dep= pkg->installed.depends; dep; dep= dep->next) {
@@ -126,13 +130,13 @@ void deferred_remove(struct pkginfo *pkg) {
varbuf_end_str(&raemsgs);
fprintf(stderr,
_("dpkg: dependency problems prevent removal of %s:\n%s"),
- pkg->set->name, raemsgs.buf);
+ pkg_name(pkg, pnaw_nonambig), raemsgs.buf);
ohshit(_("dependency problems - not removing"));
} else if (raemsgs.used) {
varbuf_end_str(&raemsgs);
fprintf(stderr,
_("dpkg: %s: dependency problems, but removing anyway as you requested:\n%s"),
- pkg->set->name, raemsgs.buf);
+ pkg_name(pkg, pnaw_nonambig), raemsgs.buf);
}
varbuf_destroy(&raemsgs);
sincenothing= 0;
@@ -146,7 +150,7 @@ void deferred_remove(struct pkginfo *pkg) {
filesdbinit();
if (f_noact) {
- printf(_("Would remove or purge %s ...\n"), pkg->set->name);
+ printf(_("Would remove or purge %s ...\n"), pkg_name(pkg, pnaw_nonambig));
pkg->status= stat_notinstalled;
pkg->clientdata->istobe= itb_normal;
return;
@@ -154,7 +158,7 @@ void deferred_remove(struct pkginfo *pkg) {
oldconffsetflags(pkg->installed.conffiles);
- printf(_("Removing %s ...\n"), pkg->set->name);
+ printf(_("Removing %s ...\n"), pkg_name(pkg, pnaw_nonambig));
log_action("remove", pkg, &pkg->installed);
trig_activate_packageprocessing(pkg);
if (pkg->status >= stat_halfconfigured) {
@@ -274,7 +278,7 @@ removal_bulk_remove_files(struct pkginfo *pkg)
} else if (errno == EBUSY || errno == EPERM) {
warning(_("while removing %.250s, unable to remove directory '%.250s': "
"%s - directory may be a mount point?"),
- pkg->set->name, namenode->name, strerror(errno));
+ pkg_name(pkg, pnaw_nonambig), namenode->name, strerror(errno));
push_leftover(&leftover,namenode);
continue;
} else if (errno == EINVAL && strcmp(usenode->name, "/.") == 0) {
@@ -359,13 +363,13 @@ static void removal_bulk_remove_leftover_dirs(struct pkginfo *pkg) {
if (!rmdir(fnvb.buf) || errno == ENOENT || errno == ELOOP) continue;
if (errno == ENOTEMPTY || errno == EEXIST) {
warning(_("while removing %.250s, directory '%.250s' not empty so not removed."),
- pkg->set->name, namenode->name);
+ pkg_name(pkg, pnaw_nonambig), namenode->name);
push_leftover(&leftover,namenode);
continue;
} else if (errno == EBUSY || errno == EPERM) {
warning(_("while removing %.250s, unable to remove directory '%.250s': "
"%s - directory may be a mount point?"),
- pkg->set->name, namenode->name, strerror(errno));
+ pkg_name(pkg, pnaw_nonambig), namenode->name, strerror(errno));
push_leftover(&leftover,namenode);
continue;
} else if (errno == EINVAL && strcmp(usenode->name, "/.") == 0) {
@@ -406,7 +410,8 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
char *p;
const char *const *ext;
- printf(_("Purging configuration files for %s ...\n"), pkg->set->name);
+ printf(_("Purging configuration files for %s ...\n"),
+ pkg_name(pkg, pnaw_nonambig));
log_action("purge", pkg, &pkg->installed);
trig_activate_packageprocessing(pkg);
@@ -532,7 +537,7 @@ static void removal_bulk_remove_configfiles(struct pkginfo *pkg) {
void removal_bulk(struct pkginfo *pkg) {
bool foundpostrm;
- debug(dbg_general, "removal_bulk package %s", pkg->set->name);
+ debug(dbg_general, "removal_bulk package %s", pkg_name(pkg, pnaw_nonambig));
if (pkg->status == stat_halfinstalled || pkg->status == stat_unpacked) {
removal_bulk_remove_files(pkg);
diff --git a/src/trigproc.c b/src/trigproc.c
index 257a7eb8f..2ea96f174 100644
--- a/src/trigproc.c
+++ b/src/trigproc.c
@@ -96,7 +96,8 @@ trigproc_enqueue_deferred(struct pkginfo *pend)
if (pend->clientdata->trigprocdeferred)
return;
pend->clientdata->trigprocdeferred = pkg_queue_push(&deferred, pend);
- debug(dbg_triggers, "trigproc_enqueue_deferred pend=%s", pend->set->name);
+ debug(dbg_triggers, "trigproc_enqueue_deferred pend=%s",
+ pkg_name(pend, pnaw_nonambig));
}
void
@@ -133,7 +134,7 @@ void
trig_activate_packageprocessing(struct pkginfo *pkg)
{
debug(dbg_triggersdetail, "trigproc_activate_packageprocessing pkg=%s",
- pkg->set->name);
+ pkg_name(pkg, pnaw_nonambig));
trig_parse_ci(pkgadminfile(pkg, &pkg->installed, TRIGGERSCIFILE), NULL,
trig_cicb_statuschange_activate, pkg, &pkg->installed);
@@ -177,7 +178,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
const char *sep;
debug(dbg_triggers, "check_triggers_cycle pnow=%s",
- processing_now->set->name);
+ pkg_name(processing_now, pnaw_nonambig));
tcn = nfmalloc(sizeof(*tcn));
tcn->pkgs = NULL;
@@ -196,7 +197,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
pkg_db_iter_free(it);
if (!hare) {
debug(dbg_triggersdetail, "check_triggers_cycle pnow=%s first",
- processing_now->set->name);
+ pkg_name(processing_now, pnaw_nonambig));
tcn->next = NULL;
hare = tortoise = tcn;
return NULL;
@@ -216,15 +217,20 @@ check_trigger_cycle(struct pkginfo *processing_now)
for (tortoise_pkg = tortoise->pkgs;
tortoise_pkg;
tortoise_pkg = tortoise_pkg->next) {
+ const char *processing_now_name, *tortoise_name;
+
+ processing_now_name = pkg_name(processing_now, pnaw_nonambig);
+ tortoise_name = pkg_name(tortoise_pkg->pkg, pnaw_nonambig);
+
debug(dbg_triggersdetail, "check_triggers_cycle pnow=%s tortoise=%s",
- processing_now->set->name, tortoise_pkg->pkg->set->name);
+ processing_now_name, tortoise_name);
for (tortoise_trig = tortoise_pkg->then_trigs;
tortoise_trig;
tortoise_trig = tortoise_trig->next) {
debug(dbg_triggersdetail,
"check_triggers_cycle pnow=%s tortoise=%s"
- " tortoisetrig=%s", processing_now->set->name,
- tortoise_pkg->pkg->set->name,
+ " tortoisetrig=%s",
+ processing_now_name, tortoise_name,
tortoise_trig->name);
/* hare is now so we can just look up in the actual
* data. */
@@ -234,8 +240,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
debug(dbg_triggersstupid,
"check_triggers_cycle pnow=%s tortoise=%s"
" tortoisetrig=%s haretrig=%s",
- processing_now->set->name,
- tortoise_pkg->pkg->set->name,
+ processing_now_name, tortoise_name,
tortoise_trig->name, hare_trig->name);
if (!strcmp(hare_trig->name, tortoise_trig->name))
goto found_in_hare;
@@ -243,8 +248,7 @@ check_trigger_cycle(struct pkginfo *processing_now)
/* Not found in hare, yay! */
debug(dbg_triggersdetail,
"check_triggers_cycle pnow=%s tortoise=%s OK",
- processing_now->set->name,
- tortoise_pkg->pkg->set->name);
+ processing_now_name, tortoise_name);
return NULL;
found_in_hare:;
}
@@ -256,7 +260,8 @@ check_trigger_cycle(struct pkginfo *processing_now)
dpkg_get_progname());
sep = " ";
for (tcn = tortoise; tcn; tcn = tcn->next) {
- fprintf(stderr, "%s%s", sep, tcn->then_processed->set->name);
+ fprintf(stderr, "%s%s", sep,
+ pkg_name(tcn->then_processed, pnaw_nonambig));
sep = " -> ";
}
fprintf(stderr, _("\n" " packages' pending triggers which are"
@@ -264,7 +269,8 @@ check_trigger_cycle(struct pkginfo *processing_now)
for (tortoise_pkg = tortoise->pkgs;
tortoise_pkg;
tortoise_pkg = tortoise_pkg->next) {
- fprintf(stderr, " %s", tortoise_pkg->pkg->set->name);
+ fprintf(stderr, " %s",
+ pkg_name(tortoise_pkg->pkg, pnaw_nonambig));
sep = ": ";
for (tortoise_trig = tortoise_pkg->then_trigs;
tortoise_trig;
@@ -277,7 +283,8 @@ check_trigger_cycle(struct pkginfo *processing_now)
/* We give up on the _earliest_ package involved. */
giveup = tortoise->pkgs->pkg;
debug(dbg_triggers, "check_triggers_cycle pnow=%s giveup=%p",
- processing_now->set->name, giveup->set->name);
+ pkg_name(processing_now, pnaw_nonambig),
+ pkg_name(giveup, pnaw_nonambig));
assert(giveup->status == stat_triggersawaited ||
giveup->status == stat_triggerspending);
giveup->status = stat_halfconfigured;
@@ -300,7 +307,7 @@ trigproc(struct pkginfo *pkg)
struct trigpend *tp;
struct pkginfo *gaveup;
- debug(dbg_triggers, "trigproc %s", pkg->set->name);
+ debug(dbg_triggers, "trigproc %s", pkg_name(pkg, pnaw_nonambig));
if (pkg->clientdata->trigprocdeferred)
pkg->clientdata->trigprocdeferred->pkg = NULL;
@@ -314,7 +321,8 @@ trigproc(struct pkginfo *pkg)
if (gaveup == pkg)
return;
- printf(_("Processing triggers for %s ...\n"), pkg->set->name);
+ printf(_("Processing triggers for %s ...\n"),
+ pkg_name(pkg, pnaw_nonambig));
log_action("trigproc", pkg, &pkg->installed);
varbuf_reset(&namesarg);
@@ -354,10 +362,11 @@ transitional_interest_callback_ro(const char *trig, struct pkginfo *pkg,
struct pkgbin *pkgbin, enum trig_options opts)
{
struct pkginfo *pend = pkg;
+ struct pkgbin *pendbin = pkgbin;
debug(dbg_triggersdetail,
"trig_transitional_interest_callback trig=%s pend=%s",
- trig, pend->set->name);
+ trig, pkgbin_name(pend, pendbin, pnaw_nonambig));
if (pend->status >= stat_triggersawaited)
trig_note_pend(pend, nfstrsave(trig));
}
@@ -389,7 +398,8 @@ trig_transitional_activate(enum modstatdb_rw cstatus)
if (pkg->status <= stat_halfinstalled)
continue;
debug(dbg_triggersdetail, "trig_transitional_activate %s %s",
- pkg->set->name, statusinfos[pkg->status].name);
+ pkg_name(pkg, pnaw_nonambig),
+ statusinfos[pkg->status].name);
pkg->trigpend_head = NULL;
trig_parse_ci(pkgadminfile(pkg, &pkg->installed, TRIGGERSCIFILE),
cstatus >= msdbrw_write ?