|
@@ -190,45 +190,44 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
|
|
|
// raring/linux-kernel version [upradable: new-version]
|
|
// raring/linux-kernel version [upradable: new-version]
|
|
|
// description
|
|
// description
|
|
|
pkgPolicy *policy = CacheFile.GetPolicy();
|
|
pkgPolicy *policy = CacheFile.GetPolicy();
|
|
|
- out << std::setiosflags(std::ios::left)
|
|
|
|
|
- << _config->Find("APT::Color::Highlight", "")
|
|
|
|
|
- << name_str
|
|
|
|
|
- << _config->Find("APT::Color::Neutral", "")
|
|
|
|
|
- << "/" << suite
|
|
|
|
|
- << " ";
|
|
|
|
|
|
|
+ std::string VersionStr = GetVersion(CacheFile, V);
|
|
|
|
|
+ std::string CandidateVerStr = GetCandidateVersion(CacheFile, P);
|
|
|
|
|
+ std::string InstalledVerStr = GetInstalledVersion(CacheFile, P);
|
|
|
|
|
+ std::string StatusStr;
|
|
|
if(P.CurrentVer() == V && state.Upgradable()) {
|
|
if(P.CurrentVer() == V && state.Upgradable()) {
|
|
|
- out << GetVersion(CacheFile, V)
|
|
|
|
|
- << " "
|
|
|
|
|
- << "[" << _("installed,upgradable to: ")
|
|
|
|
|
- << GetCandidateVersion(CacheFile, P) << "]";
|
|
|
|
|
|
|
+ strprintf(StatusStr, _("[installed,upgradable to: %s]"),
|
|
|
|
|
+ CandidateVerStr.c_str());
|
|
|
} else if (P.CurrentVer() == V) {
|
|
} else if (P.CurrentVer() == V) {
|
|
|
- out << GetVersion(CacheFile, V)
|
|
|
|
|
- << " ";
|
|
|
|
|
if(!V.Downloadable())
|
|
if(!V.Downloadable())
|
|
|
- out << _("[installed,local]");
|
|
|
|
|
|
|
+ StatusStr = _("[installed,local]");
|
|
|
else
|
|
else
|
|
|
if(V.Automatic() && state.Garbage)
|
|
if(V.Automatic() && state.Garbage)
|
|
|
- out << _("[installed,auto-removable]");
|
|
|
|
|
|
|
+ StatusStr = _("[installed,auto-removable]");
|
|
|
else if (state.Flags & pkgCache::Flag::Auto)
|
|
else if (state.Flags & pkgCache::Flag::Auto)
|
|
|
- out << _("[installed,automatic]");
|
|
|
|
|
|
|
+ StatusStr = _("[installed,automatic]");
|
|
|
else
|
|
else
|
|
|
- out << _("[installed]");
|
|
|
|
|
|
|
+ StatusStr = _("[installed]");
|
|
|
} else if (P.CurrentVer() &&
|
|
} else if (P.CurrentVer() &&
|
|
|
policy->GetCandidateVer(P) == V &&
|
|
policy->GetCandidateVer(P) == V &&
|
|
|
state.Upgradable()) {
|
|
state.Upgradable()) {
|
|
|
- out << GetVersion(CacheFile, V)
|
|
|
|
|
- << " "
|
|
|
|
|
- << _("[upgradable from: ")
|
|
|
|
|
- << GetInstalledVersion(CacheFile, P) << "]";
|
|
|
|
|
|
|
+ strprintf(StatusStr, _("[upgradable from: %s]"),
|
|
|
|
|
+ InstalledVerStr.c_str());
|
|
|
} else {
|
|
} else {
|
|
|
if (V.ParentPkg()->CurrentState == pkgCache::State::ConfigFiles)
|
|
if (V.ParentPkg()->CurrentState == pkgCache::State::ConfigFiles)
|
|
|
- out << GetVersion(CacheFile, V)
|
|
|
|
|
- << " "
|
|
|
|
|
- << _("[residual-config]");
|
|
|
|
|
|
|
+ StatusStr = _("[residual-config]");
|
|
|
else
|
|
else
|
|
|
- out << GetVersion(CacheFile, V);
|
|
|
|
|
|
|
+ StatusStr = "";
|
|
|
}
|
|
}
|
|
|
- out << " " << GetArchitecture(CacheFile, P);
|
|
|
|
|
|
|
+ out << std::setiosflags(std::ios::left)
|
|
|
|
|
+ << _config->Find("APT::Color::Highlight", "")
|
|
|
|
|
+ << name_str
|
|
|
|
|
+ << _config->Find("APT::Color::Neutral", "")
|
|
|
|
|
+ << "/" << suite
|
|
|
|
|
+ << " "
|
|
|
|
|
+ << VersionStr << " "
|
|
|
|
|
+ << GetArchitecture(CacheFile, P);
|
|
|
|
|
+ if (StatusStr != "")
|
|
|
|
|
+ out << " " << StatusStr;
|
|
|
if (include_summary)
|
|
if (include_summary)
|
|
|
{
|
|
{
|
|
|
out << std::endl
|
|
out << std::endl
|