summaryrefslogtreecommitdiff
path: root/apt-private
diff options
context:
space:
mode:
authorMichael Vogt <mvo@debian.org>2014-01-18 08:51:53 +0100
committerMichael Vogt <mvo@debian.org>2014-01-18 08:51:53 +0100
commit47d7761243a02368bb60b7227bd05a19ca4660d1 (patch)
treec298a2054c22aae934e25dd22a023efe76649b89 /apt-private
parentea62d40da6b402ff8d4d346971b98e24f096e521 (diff)
parent8a59cc322ac57c6662949e957611ed718a5f5119 (diff)
Merge remote-tracking branch 'mvo/debian/sid' into debian/experimental-no-abi-break
Diffstat (limited to 'apt-private')
-rw-r--r--apt-private/private-cacheset.cc9
-rw-r--r--apt-private/private-cmndline.cc6
-rw-r--r--apt-private/private-list.cc12
-rw-r--r--apt-private/private-output.cc8
-rw-r--r--apt-private/private-show.cc5
-rw-r--r--apt-private/private-sources.cc5
6 files changed, 35 insertions, 10 deletions
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc
index 6fb224010..a7dc0e800 100644
--- a/apt-private/private-cacheset.cc
+++ b/apt-private/private-cacheset.cc
@@ -52,6 +52,15 @@ bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile,
output_set.insert(policy->GetCandidateVer(P));
}
}
+ else if (_config->FindB("APT::Cmd::Manual-Installed") == true)
+ {
+ if (P.CurrentVer() &&
+ ((*DepCache)[P].Flags & pkgCache::Flag::Auto) == false)
+ {
+ pkgPolicy *policy = CacheFile.GetPolicy();
+ output_set.insert(policy->GetCandidateVer(P));
+ }
+ }
else
{
pkgPolicy *policy = CacheFile.GetPolicy();
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc
index 28309af07..cbb40d42e 100644
--- a/apt-private/private-cmndline.cc
+++ b/apt-private/private-cmndline.cc
@@ -226,9 +226,15 @@ 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(0,"manual-installed","APT::Cmd::Manual-Installed",0);
addArg('v', "verbose", "APT::Cmd::List-Include-Summary", 0);
addArg('a', "all-versions", "APT::Cmd::All-Versions", 0);
}
+ else if (CmdMatches("upgrade"))
+ {
+ // FIXME: find a better term
+ addArg(0,"dist","APT::Cmd::Dist-Upgrade", CommandLine::Boolean);
+ }
else if (addArgumentsAPTGet(Args, Cmd) || addArgumentsAPTCache(Args, Cmd))
{
// we have no (supported) command-name overlaps so far, so we call
diff --git a/apt-private/private-list.cc b/apt-private/private-list.cc
index a02ebf02d..fbb66d204 100644
--- a/apt-private/private-list.cc
+++ b/apt-private/private-list.cc
@@ -101,11 +101,15 @@ private:
/*}}}*/
void ListAllVersions(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
pkgCache::PkgIterator P,
- std::ostream &outs)
+ std::ostream &outs,
+ bool include_summary=true)
{
for (pkgCache::VerIterator Ver = P.VersionList();
Ver.end() == false; Ver++)
- ListSingleVersion(CacheFile, records, Ver, outs);
+ {
+ ListSingleVersion(CacheFile, records, Ver, outs, include_summary);
+ outs << "\n";
+ }
}
/*}}}*/
// list - list package based on criteria /*{{{*/
@@ -136,7 +140,7 @@ bool List(CommandLine &Cmd)
PackageNameMatcher matcher(patterns);
LocalitySortedVersionSet bag;
- OpTextProgress progress;
+ OpTextProgress progress(*_config);
progress.OverallProgress(0,
Cache->Head().PackageCount,
Cache->Head().PackageCount,
@@ -147,7 +151,7 @@ bool List(CommandLine &Cmd)
std::stringstream outs;
if(_config->FindB("APT::Cmd::All-Versions", false) == true)
{
- ListAllVersions(CacheFile, records, V.ParentPkg(), outs);
+ ListAllVersions(CacheFile, records, V.ParentPkg(), outs, includeSummary);
output_map.insert(std::make_pair<std::string, std::string>(
V.ParentPkg().Name(), outs.str()));
} else {
diff --git a/apt-private/private-output.cc b/apt-private/private-output.cc
index 91d13f31b..a8bbad9e5 100644
--- a/apt-private/private-output.cc
+++ b/apt-private/private-output.cc
@@ -114,11 +114,13 @@ std::string GetVersion(pkgCacheFile &CacheFile, pkgCache::VerIterator V)/*{{{*/
pkgCache::PkgIterator P = V.ParentPkg();
if (V == P.CurrentVer())
{
+ std::string inst_str = DeNull(V.VerStr());
+#if 0 // FIXME: do we want this or something like this?
pkgDepCache *DepCache = CacheFile.GetDepCache();
pkgDepCache::StateCache &state = (*DepCache)[P];
- std::string inst_str = DeNull(V.VerStr());
if (state.Upgradable())
return "**"+inst_str;
+#endif
return inst_str;
}
@@ -224,11 +226,11 @@ void ListSingleVersion(pkgCacheFile &CacheFile, pkgRecords &records, /*{{{*/
else
out << GetVersion(CacheFile, V);
}
- out << " " << GetArchitecture(CacheFile, P) << " ";
+ out << " " << GetArchitecture(CacheFile, P);
if (include_summary)
{
out << std::endl
- << " " << GetShortDescription(CacheFile, records, P)
+ << " " << GetShortDescription(CacheFile, records, P)
<< std::endl;
}
}
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index ddc75dbeb..0aa42ecce 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -74,13 +74,12 @@ bool DisplayRecord(pkgCacheFile &CacheFile, pkgCache::VerIterator V,
// write the description
pkgRecords Recs(*Cache);
+ // FIXME: show (optionally) all available translations(?)
pkgCache::DescIterator Desc = V.TranslatedDescription();
if (Desc.end() == false)
{
pkgRecords::Parser &P = Recs.Lookup(Desc.FileList());
- if (strcmp(Desc.LanguageCode(),"") != 0)
- out << "Description-lang: " << Desc.LanguageCode() << std::endl;
- out << "Description" << P.LongDesc();
+ out << "Description: " << P.LongDesc();
}
// write a final newline (after the description)
diff --git a/apt-private/private-sources.cc b/apt-private/private-sources.cc
index 65706e785..41cf6b313 100644
--- a/apt-private/private-sources.cc
+++ b/apt-private/private-sources.cc
@@ -32,6 +32,10 @@ bool EditSources(CommandLine &CmdL)
if (FileExists(sourceslist))
before.FromFile(sourceslist);
+ int lockfd = GetLock(sourceslist);
+ if (lockfd < 0)
+ return false;
+
do {
EditFileInSensibleEditor(sourceslist);
_error->PushToStack();
@@ -46,6 +50,7 @@ bool EditSources(CommandLine &CmdL)
}
_error->RevertToStack();
} while (res == false);
+ close(lockfd);
if (FileExists(sourceslist) && !before.VerifyFile(sourceslist)) {
strprintf(