summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2013-11-28 19:45:58 +0100
committerMichael Vogt <mvo@debian.org>2013-11-28 19:45:58 +0100
commit83ef59c23699ed3cd3dc9d6d907a0d0359ab2fee (patch)
tree7862d1a16c3a445da31c53c1565c79704b8462d0 /apt-private
parentc872ac503156caff9d0e33306c4121dd667a6567 (diff)
parente1dc051a11c2860abebf626df0470a5feb03677a (diff)
Merge remote-tracking branch 'mvo/feature/short-list' into debian/sid
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-cmndline.cc1
-rw-r--r--apt-private/private-list.cc4
-rw-r--r--apt-private/private-output.cc12
-rw-r--r--apt-private/private-output.h3
4 files changed, 14 insertions, 6 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 718a7ce6a..f4348c979 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -227,6 +227,7 @@ bool addArgumentsAPT(std::vector<CommandLine::Args> &Args, char const * const Cm
addArg(0,"installed","APT::Cmd::Installed",0);
addArg(0,"upgradable","APT::Cmd::Upgradable",0);
addArg('a', "all-versions", "APT::Cmd::AllVersions", 0);
+ addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0);
}
else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd))
{
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index 8c61fcae8..08851eb7e 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -132,6 +132,8 @@ bool List(CommandLine &Cmd)
std::map<std::string, std::string> output_map;
std::map<std::string, std::string>::const_iterator K;
+ bool includeSummary = _config->FindB("APT::Cmd::List-Include-Summary");
+
PackageNameMatcher matcher(patterns);
LocalitySortedVersionSet bag;
OpTextProgress progress;
@@ -149,7 +151,7 @@ bool List(CommandLine &Cmd)
output_map.insert(std::make_pair<std::string, std::string>(
V.ParentPkg().Name(), outs.str()));
} else {
- ListSingleVersion(CacheFile, records, V, outs);
+ ListSingleVersion(CacheFile, records, V, outs, includeSummary);
output_map.insert(std::make_pair<std::string, std::string>(
V.ParentPkg().Name(), outs.str()));
}
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 6fadf7274..91d13f31b 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -158,7 +158,8 @@ std::string GetShortDescription(pkgCacheFile &CacheFile, pkgRecords &records, pk
}
/*}}}*/
void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
- pkgCache::VerIterator V, std::ostream &out)
+ pkgCache::VerIterator V, std::ostream &out,
+ bool include_summary)
{
pkgCache::PkgIterator P = V.ParentPkg();
@@ -224,9 +225,12 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
out << GetVersion(CacheFile, V);
}
out << " " << GetArchitecture(CacheFile, P) << " ";
- out << std::endl
- << " " << GetShortDescription(CacheFile, records, P)
- << std::endl;
+ if (include_summary)
+ {
+ out << std::endl
+ << " " << GetShortDescription(CacheFile, records, P)
+ << std::endl;
+ }
}
}
/*}}}*/
diff --git a/apt-private/private-output.h b/apt-private/private-output.h
index 9283e39ab..c3c76bb92 100644
--- a/apt-private/private-output.h
+++ b/apt-private/private-output.h
@@ -24,7 +24,8 @@ extern unsigned int ScreenWidth;
bool InitOutput();
void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records,
- pkgCache::VerIterator V, std::ostream &out);
+ pkgCache::VerIterator V, std::ostream &out,
+ bool include_summary=true);