+ std::string state;
+ auto const dpkgName = [&](pkgCache::VerIterator const &V) {
+ pkgCache::PkgIterator P = V.ParentPkg();
+ if (strcmp(V.Arch(), "none") == 0)
+ ioprintf(std::clog, "echo '%s %s' | ", P.Name(), state.c_str());
+ else if (dpkgMultiArch == false)
+ ioprintf(std::clog, "echo '%s %s' | ", P.FullName(true).c_str(), state.c_str());
+ else
+ ioprintf(std::clog, "echo '%s:%s %s' | ", P.Name(), V.Arch(), state.c_str());
+ std::copy(Args.begin(), Args.end(), std::ostream_iterator<std::string>(std::clog, " "));
+ std::clog << std::endl;
+ };
+ for (auto const &V: d->unhold)
+ {
+ if (V.ParentPkg()->CurrentVer != 0)
+ state = "install";
+ else
+ state = "deinstall";
+ dpkgName(V);
+ }
+ if (d->purge.empty() == false)
+ {
+ state = "purge";
+ std::for_each(d->purge.begin(), d->purge.end(), dpkgName);
+ }
+ if (d->deinstall.empty() == false)
+ {
+ state = "deinstall";
+ std::for_each(d->deinstall.begin(), d->deinstall.end(), dpkgName);
+ }
+ if (d->hold.empty() == false)
+ {
+ state = "hold";
+ std::for_each(d->hold.begin(), d->hold.end(), dpkgName);
+ }
+ if (d->install.empty() == false)
+ {
+ state = "install";
+ std::for_each(d->install.begin(), d->install.end(), dpkgName);
+ }