summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apt-inst/dirstream.cc1
-rw-r--r--apt-inst/extract.cc2
-rw-r--r--apt-pkg/acquire-item.cc83
-rw-r--r--apt-pkg/acquire-item.h30
-rw-r--r--apt-pkg/acquire.cc51
-rw-r--r--apt-pkg/acquire.h7
-rw-r--r--apt-pkg/algorithms.cc16
-rw-r--r--apt-pkg/algorithms.h10
-rw-r--r--apt-pkg/cachefilter.cc144
-rw-r--r--apt-pkg/cachefilter.h117
-rw-r--r--apt-pkg/cacheiterators.h10
-rw-r--r--apt-pkg/cacheset.cc374
-rw-r--r--apt-pkg/cacheset.h567
-rw-r--r--apt-pkg/cdrom.cc10
-rw-r--r--apt-pkg/contrib/cmndline.cc19
-rw-r--r--apt-pkg/contrib/fileutl.cc6
-rw-r--r--apt-pkg/contrib/gpgv.cc63
-rw-r--r--apt-pkg/deb/debindexfile.cc62
-rw-r--r--apt-pkg/deb/deblistparser.cc96
-rw-r--r--apt-pkg/deb/deblistparser.h1
-rw-r--r--apt-pkg/deb/dpkgpm.cc7
-rw-r--r--apt-pkg/edsp.cc6
-rw-r--r--apt-pkg/edsp/edspindexfile.cc2
-rw-r--r--apt-pkg/install-progress.cc2
-rw-r--r--apt-pkg/install-progress.h5
-rw-r--r--apt-pkg/metaindex.h2
-rw-r--r--apt-pkg/packagemanager.cc2
-rw-r--r--apt-pkg/packagemanager.h4
-rw-r--r--apt-pkg/pkgcache.cc25
-rw-r--r--apt-pkg/pkgcache.h43
-rw-r--r--apt-pkg/pkgcachegen.cc98
-rw-r--r--apt-pkg/pkgcachegen.h20
-rw-r--r--apt-pkg/sourcelist.cc8
-rw-r--r--apt-pkg/sourcelist.h4
-rw-r--r--apt-pkg/tagfile.h4
-rw-r--r--apt-pkg/upgrade.cc113
-rw-r--r--apt-pkg/upgrade.h14
-rw-r--r--apt-private/acqprogress.cc4
-rw-r--r--apt-private/private-cachefile.cc4
-rw-r--r--apt-private/private-cacheset.cc8
-rw-r--r--apt-private/private-cacheset.h25
-rw-r--r--apt-private/private-install.cc19
-rw-r--r--apt-private/private-show.cc8
-rw-r--r--apt-private/private-update.cc9
-rw-r--r--apt-private/private-upgrade.cc4
-rw-r--r--cmdline/apt-cache.cc79
-rw-r--r--cmdline/apt-get.cc103
-rw-r--r--cmdline/apt-helper.cc3
-rw-r--r--cmdline/apt-internal-solver.cc4
-rw-r--r--cmdline/apt-key.in400
-rwxr-xr-x[-rw-r--r--]debian/apt.postinst13
-rwxr-xr-xdebian/apt.postrm (renamed from debian/postrm)0
-rw-r--r--debian/control4
-rwxr-xr-xdebian/postinst39
-rw-r--r--debian/tests/control4
-rw-r--r--doc/Doxyfile.in4
-rw-r--r--ftparchive/cachedb.cc6
-rw-r--r--ftparchive/cachedb.h4
-rw-r--r--ftparchive/contents.cc10
-rw-r--r--ftparchive/sources.h2
-rw-r--r--methods/copy.cc12
-rw-r--r--methods/ftp.cc5
-rw-r--r--methods/gpgv.cc10
-rw-r--r--methods/https.h5
-rw-r--r--methods/server.cc6
-rw-r--r--po/ChangeLog1077
-rw-r--r--po/apt-all.pot4
-rw-r--r--po/ar.po8
-rw-r--r--po/ast.po12
-rw-r--r--po/bg.po14
-rw-r--r--po/bs.po8
-rw-r--r--po/ca.po14
-rw-r--r--po/cs.po12
-rw-r--r--po/cy.po8
-rw-r--r--po/da.po12
-rw-r--r--po/de.po12
-rw-r--r--po/dz.po10
-rw-r--r--po/el.po12
-rw-r--r--po/es.po12
-rw-r--r--po/eu.po13
-rw-r--r--po/fi.po13
-rw-r--r--po/fr.po14
-rw-r--r--po/gl.po14
-rw-r--r--po/he.po6
-rw-r--r--po/hu.po12
-rw-r--r--po/it.po12
-rw-r--r--po/ja.po58
-rw-r--r--po/km.po12
-rw-r--r--po/ko.po12
-rw-r--r--po/ku.po10
-rw-r--r--po/lt.po10
-rw-r--r--po/mr.po12
-rw-r--r--po/nb.po12
-rw-r--r--po/ne.po13
-rw-r--r--po/nl.po12
-rw-r--r--po/nn.po8
-rw-r--r--po/pl.po12
-rw-r--r--po/pt.po12
-rw-r--r--po/pt_BR.po13
-rw-r--r--po/ro.po13
-rw-r--r--po/ru.po12
-rw-r--r--po/sk.po12
-rw-r--r--po/sl.po12
-rw-r--r--po/sv.po12
-rw-r--r--po/th.po12
-rw-r--r--po/tl.po13
-rw-r--r--po/tr.po12
-rw-r--r--po/uk.po12
-rw-r--r--po/vi.po12
-rw-r--r--po/zh_CN.po12
-rw-r--r--po/zh_TW.po13
-rw-r--r--test/integration/framework71
-rwxr-xr-xtest/integration/test-allow-scores-for-all-dependency-types6
-rwxr-xr-xtest/integration/test-apt-cdrom2
-rwxr-xr-xtest/integration/test-apt-get-changelog6
-rwxr-xr-xtest/integration/test-apt-get-clean34
-rwxr-xr-xtest/integration/test-apt-get-download27
-rwxr-xr-xtest/integration/test-apt-get-upgrade3
-rwxr-xr-xtest/integration/test-apt-helper14
-rwxr-xr-xtest/integration/test-apt-key229
-rwxr-xr-xtest/integration/test-apt-key-net-update9
-rwxr-xr-xtest/integration/test-bug-507998-dist-upgrade-recommends1
-rwxr-xr-xtest/integration/test-bug-591882-conkeror2
-rwxr-xr-xtest/integration/test-bug-595691-empty-and-broken-archive-files35
-rwxr-xr-xtest/integration/test-bug-605394-versioned-or-groups1
-rwxr-xr-xtest/integration/test-bug-612099-multiarch-conflicts2
-rwxr-xr-xtest/integration/test-bug-64141-install-dependencies-for-on-hold2
-rwxr-xr-xtest/integration/test-bug-657695-resolver-breaks-on-virtuals1
-rwxr-xr-xtest/integration/test-bug-675449-essential-are-protected1
-rwxr-xr-xtest/integration/test-bug-680041-apt-mark-holds-correctly4
-rwxr-xr-xtest/integration/test-bug-686346-package-missing-architecture1
-rwxr-xr-xtest/integration/test-bug-733028-gpg-resource-limit27
-rwxr-xr-xtest/integration/test-bug-735967-lib32-to-i386-unavailable2
-rwxr-xr-xtest/integration/test-bug-740843-versioned-up-down-breaks2
-rwxr-xr-xtest/integration/test-bug-758153-versioned-provides-support1
-rwxr-xr-xtest/integration/test-compressed-indexes196
-rwxr-xr-xtest/integration/test-conflicts-loop1
-rwxr-xr-xtest/integration/test-pin-non-existent-package3
-rwxr-xr-xtest/integration/test-prevent-markinstall-multiarch-same-versionscrew1
-rwxr-xr-xtest/integration/test-provides-gone-with-upgrade1
-rwxr-xr-xtest/integration/test-resolve-by-keep-new-recommends1
-rwxr-xr-xtest/integration/test-ubuntu-bug-1304403-obsolete-priority-standard2
-rwxr-xr-xtest/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering1
-rwxr-xr-xtest/integration/test-very-tight-loop-configure-with-unpacking-new-packages2
-rwxr-xr-xtest/integration/test-xorg-break-providers2
-rw-r--r--test/libapt/commandline_test.cc68
-rw-r--r--test/libapt/makefile4
147 files changed, 2623 insertions, 2606 deletions
diff --git a/apt-inst/dirstream.cc b/apt-inst/dirstream.cc
index 39ebb3bb4..888020bfb 100644
--- a/apt-inst/dirstream.cc
+++ b/apt-inst/dirstream.cc
@@ -76,7 +76,6 @@ bool pkgDirStream::DoItem(Item &Itm,int &Fd)
if(mkdir(Itm.Name,Itm.Mode) < 0)
return false;
return true;
- break;
}
case Item::FIFO:
break;
diff --git a/apt-inst/extract.cc b/apt-inst/extract.cc
index b60784450..026182c18 100644
--- a/apt-inst/extract.cc
+++ b/apt-inst/extract.cc
@@ -404,7 +404,7 @@ bool pkgExtract::HandleOverwrites(pkgFLCache::NodeIterator Nde,
// Now see if this package matches one in a replace depends
pkgCache::DepIterator Dep = Ver.DependsList();
bool Ok = false;
- for (; Dep.end() == false; Dep++)
+ for (; Dep.end() == false; ++Dep)
{
if (Dep->Type != pkgCache::Dep::Replaces)
continue;
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc
index b8317b13d..923a153a7 100644
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@ -64,6 +64,10 @@ static void printHashSumComparision(std::string const &URI, HashStringList const
/*}}}*/
// Acquire::Item::Item - Constructor /*{{{*/
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
pkgAcquire::Item::Item(pkgAcquire *Owner,
HashStringList const &ExpectedHashes,
pkgAcqMetaBase *TransactionManager)
@@ -76,6 +80,9 @@ pkgAcquire::Item::Item(pkgAcquire *Owner,
if(TransactionManager != NULL)
TransactionManager->Add(this);
}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
/*}}}*/
// Acquire::Item::~Item - Destructor /*{{{*/
// ---------------------------------------------------------------------
@@ -723,7 +730,15 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size, HashStringLi
Local = true;
Desc.URI = "rred:" + FinalFile;
QueueURI(Desc);
+ ActiveSubprocess = "rred";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
Mode = "rred";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
return;
}
@@ -846,7 +861,15 @@ void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,HashStri
Local = true;
Desc.URI = "rred:" + FinalFile;
QueueURI(Desc);
+ ActiveSubprocess = "rred";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
Mode = "rred";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
return;
}
// success in download/apply all diffs, clean up
@@ -967,6 +990,7 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc,
else
{
Desc.URI = URI + '.' + comprExt;
+ DestFile = DestFile + '.' + comprExt;
if(Target)
MetaKey = string(Target->MetaKey) + '.' + comprExt;
}
@@ -1069,8 +1093,8 @@ std::string pkgAcqIndex::GetFinalFilename() const
std::string const compExt = CompressionExtension.substr(0, CompressionExtension.find(' '));
std::string FinalFile = _config->FindDir("Dir::State::lists");
FinalFile += URItoFileName(RealURI);
- if (_config->FindB("Acquire::GzipIndexes",false) && compExt == "gz")
- FinalFile += ".gz";
+ if (_config->FindB("Acquire::GzipIndexes",false) == true)
+ FinalFile += '.' + compExt;
return FinalFile;
}
/*}}}*/
@@ -1080,8 +1104,8 @@ std::string pkgAcqIndex::GetFinalFilename() const
void pkgAcqIndex::ReverifyAfterIMS()
{
std::string const compExt = CompressionExtension.substr(0, CompressionExtension.find(' '));
- if (_config->FindB("Acquire::GzipIndexes",false) && compExt == "gz")
- DestFile += ".gz";
+ if (_config->FindB("Acquire::GzipIndexes",false) == true)
+ DestFile += compExt;
// copy FinalFile into partial/ so that we check the hash again
string FinalFile = GetFinalFilename();
@@ -1179,7 +1203,15 @@ void pkgAcqIndex::Done(string Message, unsigned long long Size,
DestFile += ".decomp";
Desc.URI = "copy:" + FileName;
QueueURI(Desc);
+ ActiveSubprocess = "copy";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
Mode = "copy";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
return;
}
@@ -1206,15 +1238,25 @@ void pkgAcqIndex::Done(string Message, unsigned long long Size,
{
Erase = false;
ReverifyAfterIMS();
+#if 0 // ???
+ // set destfile to the final destfile
+ if(_config->FindB("Acquire::GzipIndexes",false) == false)
+ {
+ DestFile = _config->FindDir("Dir::State::lists") + "partial/";
+ DestFile += URItoFileName(RealURI);
+ }
+
+ ReverifyAfterIMS(FileName);
+#endif
return;
}
string decompProg;
// If we enable compressed indexes, queue for hash verification
- if (_config->FindB("Acquire::GzipIndexes",false) && compExt == "gz")
+ if (_config->FindB("Acquire::GzipIndexes",false))
{
DestFile = _config->FindDir("Dir::State::lists");
- DestFile += URItoFileName(RealURI) + ".gz";
+ DestFile += URItoFileName(RealURI) + '.' + compExt;
Decompression = true;
Desc.URI = "copy:" + FileName;
@@ -1238,8 +1280,15 @@ void pkgAcqIndex::Done(string Message, unsigned long long Size,
Desc.URI = decompProg + ":" + FileName;
QueueURI(Desc);
- // FIXME: this points to a c++ string that goes out of scope
- Mode = decompProg.c_str();
+ ActiveSubprocess = decompProg;
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ Mode = ActiveSubprocess.c_str();
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
}
/*}}}*/
// AcqIndexTrans::pkgAcqIndexTrans - Constructor /*{{{*/
@@ -1676,7 +1725,15 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long long Size,HashStringList
AuthPass = true;
Desc.URI = "gpgv:" + SigFile;
QueueURI(Desc);
- Mode = "gpgv";
+ ActiveSubprocess = "gpgv";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ Mode = "gpgv";
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
return;
}
}
@@ -1785,8 +1842,12 @@ void pkgAcqMetaIndex::AuthDone(string Message) /*{{{*/
URItoFileName((*Target)->URI);
unlink(index.c_str());
// and also old gzipindexes
- index += ".gz";
- unlink(index.c_str());
+ std::vector<std::string> types = APT::Configuration::getCompressionTypes();
+ for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t)
+ {
+ index += '.' + (*t);
+ unlink(index.c_str());
+ }
}
}
#endif
diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h
index cc156cf17..e6a22ce7b 100644
--- a/apt-pkg/acquire-item.h
+++ b/apt-pkg/acquire-item.h
@@ -136,7 +136,12 @@ class pkgAcquire::Item : public WeakPointable
/** \brief If not \b NULL, contains the name of a subprocess that
* is operating on this object (for instance, "gzip" or "gpgv").
*/
- const char *Mode;
+ APT_DEPRECATED const char *Mode;
+
+ /** \brief contains the name of the subprocess that is operating on this object
+ * (for instance, "gzip", "rred" or "gpgv"). This is obsoleting #Mode from above
+ * as it can manage the lifetime of included string properly. */
+ std::string ActiveSubprocess;
/** \brief A client-supplied unique identifier.
*
@@ -254,12 +259,12 @@ class pkgAcquire::Item : public WeakPointable
*
* \return a URI that should be used to describe what is being fetched.
*/
- virtual std::string DescURI() const = 0;
+ virtual std::string DescURI() = 0;
/** \brief Short item description.
*
* \return a brief description of the object being fetched.
*/
- virtual std::string ShortDesc() const {return DescURI();}
+ virtual std::string ShortDesc() {return DescURI();}
/** \brief Invoked by the worker when the download is completely done. */
virtual void Finished() {};
@@ -418,7 +423,7 @@ class pkgAcqMetaSig : public pkgAcqMetaBase
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
virtual std::string Custom600Headers() const;
- virtual std::string DescURI() const {return RealURI; };
+ virtual std::string DescURI() {return RealURI; };
/** \brief Create a new pkgAcqMetaSig. */
pkgAcqMetaSig(pkgAcquire *Owner,
@@ -531,7 +536,7 @@ class pkgAcqMetaIndex : public pkgAcqMetaBase
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
virtual std::string Custom600Headers() const;
- virtual std::string DescURI() const {return RealURI; };
+ virtual std::string DescURI() {return RealURI; };
virtual void Finished();
/** \brief Create a new pkgAcqMetaIndex. */
@@ -649,7 +654,7 @@ class pkgAcqDiffIndex : public pkgAcqBaseIndex
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
- virtual std::string DescURI() const {return RealURI + "Index";};
+ virtual std::string DescURI() {return RealURI + "Index";};
virtual std::string Custom600Headers() const;
/** \brief Parse the Index file for a set of Packages diffs.
@@ -745,7 +750,7 @@ class pkgAcqIndexMergeDiffs : public pkgAcqBaseIndex
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
- virtual std::string DescURI() const {return RealURI + "Index";};
+ virtual std::string DescURI() {return RealURI + "Index";};
/** \brief Create an index merge-diff item.
*
@@ -873,7 +878,7 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
- virtual std::string DescURI() const {return RealURI + "IndexDiffs";};
+ virtual std::string DescURI() {return RealURI + "IndexDiffs";};
/** \brief Create an index diff item.
*
@@ -960,7 +965,7 @@ class pkgAcqIndex : public pkgAcqBaseIndex
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
virtual std::string Custom600Headers() const;
- virtual std::string DescURI() const {return Desc.URI;};
+ virtual std::string DescURI() {return Desc.URI;};
/** \brief Create a pkgAcqIndex.
*
@@ -1064,7 +1069,6 @@ class OptionalIndexTarget : public IndexTarget
}
};
/*}}}*/
-
/** \brief An item that is responsible for fetching a package file. {{{
*
* If the package file already exists in the cache, nothing will be
@@ -1116,8 +1120,8 @@ class pkgAcqArchive : public pkgAcquire::Item
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
- virtual std::string DescURI() const {return Desc.URI;};
- virtual std::string ShortDesc() const {return Desc.ShortDesc;};
+ virtual std::string DescURI() {return Desc.URI;};
+ virtual std::string ShortDesc() {return Desc.ShortDesc;};
virtual void Finished();
virtual bool IsTrusted() const;
@@ -1168,7 +1172,7 @@ class pkgAcqFile : public pkgAcquire::Item
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &CalcHashes,
pkgAcquire::MethodConfig *Cnf);
- virtual std::string DescURI() const {return Desc.URI;};
+ virtual std::string DescURI() {return Desc.URI;};
virtual std::string Custom600Headers() const;
/** \brief Create a new pkgAcqFile object.
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 9060d492b..ec565fcfa 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -74,23 +74,27 @@ pkgAcquire::pkgAcquire(pkgAcquireStatus *Progress) : LockFD(-1), Queues(0), Wor
// ---------------------------------------------------------------------
/* Do everything needed to be a complete Acquire object and report the
success (or failure) back so the user knows that something is wrong… */
-bool pkgAcquire::Setup(pkgAcquireStatus *Progress, string const &Lock)
+bool pkgAcquire::Setup(pkgAcquireStatus *Progress, string const &Lock,
+ bool const createDirectories)
{
Log = Progress;
// check for existence and possibly create auxiliary directories
- string const listDir = _config->FindDir("Dir::State::lists");
- string const partialListDir = listDir + "partial/";
- string const archivesDir = _config->FindDir("Dir::Cache::Archives");
- string const partialArchivesDir = archivesDir + "partial/";
-
- if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::State"), partialListDir) == false &&
- CreateAPTDirectoryIfNeeded(listDir, partialListDir) == false)
- return _error->Errno("Acquire", _("List directory %spartial is missing."), listDir.c_str());
-
- if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::Cache"), partialArchivesDir) == false &&
- CreateAPTDirectoryIfNeeded(archivesDir, partialArchivesDir) == false)
- return _error->Errno("Acquire", _("Archives directory %spartial is missing."), archivesDir.c_str());
+ if (createDirectories == true)
+ {
+ string const listDir = _config->FindDir("Dir::State::lists");
+ string const partialListDir = listDir + "partial/";
+ string const archivesDir = _config->FindDir("Dir::Cache::Archives");
+ string const partialArchivesDir = archivesDir + "partial/";
+
+ if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::State"), partialListDir) == false &&
+ CreateAPTDirectoryIfNeeded(listDir, partialListDir) == false)
+ return _error->Errno("Acquire", _("List directory %spartial is missing."), listDir.c_str());
+
+ if (CreateAPTDirectoryIfNeeded(_config->FindDir("Dir::Cache"), partialArchivesDir) == false &&
+ CreateAPTDirectoryIfNeeded(archivesDir, partialArchivesDir) == false)
+ return _error->Errno("Acquire", _("Archives directory %spartial is missing."), archivesDir.c_str());
+ }
if (Lock.empty() == true || _config->FindB("Debug::NoLocking", false) == true)
return true;
@@ -582,27 +586,18 @@ pkgAcquire::UriIterator pkgAcquire::UriEnd()
// Acquire::MethodConfig::MethodConfig - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgAcquire::MethodConfig::MethodConfig()
+pkgAcquire::MethodConfig::MethodConfig() : d(NULL), Next(0), SingleInstance(false),
+ Pipeline(false), SendConfig(false), LocalOnly(false), NeedsCleanup(false),
+ Removable(false)
{
- SingleInstance = false;
- Pipeline = false;
- SendConfig = false;
- LocalOnly = false;
- Removable = false;
- Next = 0;
}
/*}}}*/
// Queue::Queue - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : Name(Name),
- Owner(Owner)
+pkgAcquire::Queue::Queue(string Name,pkgAcquire *Owner) : d(NULL), Next(0),
+ Name(Name), Items(0), Workers(0), Owner(Owner), PipeDepth(0), MaxPipeDepth(1)
{
- Items = 0;
- Next = 0;
- Workers = 0;
- MaxPipeDepth = 1;
- PipeDepth = 0;
}
/*}}}*/
// Queue::~Queue - Destructor /*{{{*/
@@ -806,7 +801,7 @@ void pkgAcquire::Queue::Bump()
// AcquireStatus::pkgAcquireStatus - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Update(true), MorePulses(false)
+pkgAcquireStatus::pkgAcquireStatus() : d(NULL), Percent(0), Update(true), MorePulses(false)
{
Start();
}
diff --git a/apt-pkg/acquire.h b/apt-pkg/acquire.h
index 0113021b2..7bceb4323 100644
--- a/apt-pkg/acquire.h
+++ b/apt-pkg/acquire.h
@@ -352,8 +352,11 @@ class pkgAcquire
* \param Lock defines a lock file that should be acquired to ensure
* only one Acquire class is in action at the time or an empty string
* if no lock file should be used.
+ * \param createDirectories can be used to disable the creation of directories,
+ * e.g. if the fetcher is used with different directories later on
*/
- bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "");
+ bool Setup(pkgAcquireStatus *Progress = NULL, std::string const &Lock = "",
+ bool const createDirectories = true);
void SetLog(pkgAcquireStatus *Progress) { Log = Progress; }
@@ -585,7 +588,7 @@ class pkgAcquire::UriIterator
*
* \param Q The queue over which this UriIterator should iterate.
*/
- UriIterator(pkgAcquire::Queue *Q) : CurQ(Q), CurItem(0)
+ UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0)
{
while (CurItem == 0 && CurQ != 0)
{
diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc
index 608ec7fce..71b5ac2c1 100644
--- a/apt-pkg/algorithms.cc
+++ b/apt-pkg/algorithms.cc
@@ -640,13 +640,11 @@ bool pkgProblemResolver::DoUpgrade(pkgCache::PkgIterator Pkg)
// ProblemResolver::Resolve - calls a resolver to fix the situation /*{{{*/
// ---------------------------------------------------------------------
/* */
-bool pkgProblemResolver::Resolve(bool BrokenFix)
+bool pkgProblemResolver::Resolve(bool BrokenFix, OpProgress * const Progress)
{
std::string const solver = _config->Find("APT::Solver", "internal");
- if (solver != "internal") {
- OpTextProgress Prog(*_config);
- return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false, &Prog);
- }
+ if (solver != "internal")
+ return EDSP::ResolveExternal(solver.c_str(), Cache, false, false, false, Progress);
return ResolveInternal(BrokenFix);
}
/*}}}*/
@@ -1140,13 +1138,11 @@ bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I)
/* This is the work horse of the soft upgrade routine. It is very gental
in that it does not install or remove any packages. It is assumed that the
system was non-broken previously. */
-bool pkgProblemResolver::ResolveByKeep()
+bool pkgProblemResolver::ResolveByKeep(OpProgress * const Progress)
{
std::string const solver = _config->Find("APT::Solver", "internal");
- if (solver != "internal") {
- OpTextProgress Prog(*_config);
- return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog);
- }
+ if (solver != "internal")
+ return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, Progress);
return ResolveByKeepInternal();
}
/*}}}*/
diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h
index f35bd9a13..4d3bfa81f 100644
--- a/apt-pkg/algorithms.h
+++ b/apt-pkg/algorithms.h
@@ -136,12 +136,12 @@ class pkgProblemResolver /*{{{*/
inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected; Cache.MarkProtected(Pkg);};
inline void Remove(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= ToRemove;};
inline void Clear(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] &= ~(Protected | ToRemove);};
-
- // Try to intelligently resolve problems by installing and removing packages
- bool Resolve(bool BrokenFix = false);
-
+
+ // Try to intelligently resolve problems by installing and removing packages
+ bool Resolve(bool BrokenFix = false, OpProgress * const Progress = NULL);
+
// Try to resolve problems only by using keep
- bool ResolveByKeep();
+ bool ResolveByKeep(OpProgress * const Progress = NULL);
APT_DEPRECATED void InstallProtect();
diff --git a/apt-pkg/cachefilter.cc b/apt-pkg/cachefilter.cc
index e388f2450..4362f43e3 100644
--- a/apt-pkg/cachefilter.cc
+++ b/apt-pkg/cachefilter.cc
@@ -6,6 +6,7 @@
// Include Files /*{{{*/
#include <config.h>
+#include <apt-pkg/cachefile.h>
#include <apt-pkg/cachefilter.h>
#include <apt-pkg/error.h>
#include <apt-pkg/pkgcache.h>
@@ -22,7 +23,11 @@
/*}}}*/
namespace APT {
namespace CacheFilter {
-PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) : d(NULL) {/*{{{*/
+APT_CONST Matcher::~Matcher() {}
+APT_CONST PackageMatcher::~PackageMatcher() {}
+
+// Name matches RegEx /*{{{*/
+PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) {
pattern = new regex_t;
int const Res = regcomp(pattern, Pattern.c_str(), REG_EXTENDED | REG_ICASE | REG_NOSUB);
if (Res == 0)
@@ -34,41 +39,36 @@ PackageNameMatchesRegEx::PackageNameMatchesRegEx(std::string const &Pattern) : d
regerror(Res, pattern, Error, sizeof(Error));
_error->Error(_("Regex compilation error - %s"), Error);
}
- /*}}}*/
-bool PackageNameMatchesRegEx::operator() (pkgCache::PkgIterator const &Pkg) {/*{{{*/
+bool PackageNameMatchesRegEx::operator() (pkgCache::PkgIterator const &Pkg) {
if (unlikely(pattern == NULL))
return false;
else
return regexec(pattern, Pkg.Name(), 0, 0, 0) == 0;
}
- /*}}}*/
-bool PackageNameMatchesRegEx::operator() (pkgCache::GrpIterator const &Grp) {/*{{{*/
+bool PackageNameMatchesRegEx::operator() (pkgCache::GrpIterator const &Grp) {
if (unlikely(pattern == NULL))
return false;
else
return regexec(pattern, Grp.Name(), 0, 0, 0) == 0;
}
- /*}}}*/
-PackageNameMatchesRegEx::~PackageNameMatchesRegEx() { /*{{{*/
+PackageNameMatchesRegEx::~PackageNameMatchesRegEx() {
if (pattern == NULL)
return;
regfree(pattern);
delete pattern;
}
/*}}}*/
-
-// Fnmatch support /*{{{*/
-//----------------------------------------------------------------------
-bool PackageNameMatchesFnmatch::operator() (pkgCache::PkgIterator const &Pkg) {/*{{{*/
+// Name matches Fnmatch /*{{{*/
+PackageNameMatchesFnmatch::PackageNameMatchesFnmatch(std::string const &Pattern) :
+ Pattern(Pattern) {}
+bool PackageNameMatchesFnmatch::operator() (pkgCache::PkgIterator const &Pkg) {
return fnmatch(Pattern.c_str(), Pkg.Name(), FNM_CASEFOLD) == 0;
}
- /*}}}*/
-bool PackageNameMatchesFnmatch::operator() (pkgCache::GrpIterator const &Grp) {/*{{{*/
+bool PackageNameMatchesFnmatch::operator() (pkgCache::GrpIterator const &Grp) {
return fnmatch(Pattern.c_str(), Grp.Name(), FNM_CASEFOLD) == 0;
}
/*}}}*/
-
-// CompleteArch to <kernel>-<cpu> tuple /*{{{*/
+// Architecture matches <kernel>-<cpu> specification /*{{{*/
//----------------------------------------------------------------------
/* The complete architecture, consisting of <kernel>-<cpu>. */
static std::string CompleteArch(std::string const &arch) {
@@ -82,12 +82,10 @@ static std::string CompleteArch(std::string const &arch) {
else if (arch == "any") return "*-*";
else return "linux-" + arch;
}
- /*}}}*/
-PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern) :/*{{{*/
- literal(pattern), complete(CompleteArch(pattern)), isPattern(isPattern), d(NULL) {
+PackageArchitectureMatchesSpecification::PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern) :
+ literal(pattern), complete(CompleteArch(pattern)), isPattern(isPattern) {
}
- /*}}}*/
-bool PackageArchitectureMatchesSpecification::operator() (char const * const &arch) {/*{{{*/
+bool PackageArchitectureMatchesSpecification::operator() (char const * const &arch) {
if (strcmp(literal.c_str(), arch) == 0 ||
strcmp(complete.c_str(), arch) == 0)
return true;
@@ -96,16 +94,112 @@ bool PackageArchitectureMatchesSpecification::operator() (char const * const &ar
return fnmatch(complete.c_str(), pkgarch.c_str(), 0) == 0;
return fnmatch(pkgarch.c_str(), complete.c_str(), 0) == 0;
}
- /*}}}*/
-bool PackageArchitectureMatchesSpecification::operator() (pkgCache::PkgIterator const &Pkg) {/*{{{*/
+bool PackageArchitectureMatchesSpecification::operator() (pkgCache::PkgIterator const &Pkg) {
return (*this)(Pkg.Arch());
}
+PackageArchitectureMatchesSpecification::~PackageArchitectureMatchesSpecification() {
+}
/*}}}*/
-bool PackageArchitectureMatchesSpecification::operator() (pkgCache::VerIterator const &Ver) {/*{{{*/
- return (*this)(Ver.ParentPkg());
+// Package is new install /*{{{*/
+PackageIsNewInstall::PackageIsNewInstall(pkgCacheFile * const Cache) : Cache(Cache) {}
+APT_PURE bool PackageIsNewInstall::operator() (pkgCache::PkgIterator const &Pkg) {
+ return (*Cache)[Pkg].NewInstall();
}
+PackageIsNewInstall::~PackageIsNewInstall() {}
/*}}}*/
-PackageArchitectureMatchesSpecification::~PackageArchitectureMatchesSpecification() { /*{{{*/
+// Generica like True, False, NOT, AND, OR /*{{{*/
+APT_CONST bool TrueMatcher::operator() (pkgCache::PkgIterator const &) { return true; }
+APT_CONST bool TrueMatcher::operator() (pkgCache::GrpIterator const &) { return true; }
+APT_CONST bool TrueMatcher::operator() (pkgCache::VerIterator const &) { return true; }
+
+APT_CONST bool FalseMatcher::operator() (pkgCache::PkgIterator const &) { return false; }
+APT_CONST bool FalseMatcher::operator() (pkgCache::GrpIterator const &) { return false; }
+APT_CONST bool FalseMatcher::operator() (pkgCache::VerIterator const &) { return false; }
+
+NOTMatcher::NOTMatcher(Matcher * const matcher) : matcher(matcher) {}
+bool NOTMatcher::operator() (pkgCache::PkgIterator const &Pkg) { return ! (*matcher)(Pkg); }
+bool NOTMatcher::operator() (pkgCache::GrpIterator const &Grp) { return ! (*matcher)(Grp); }
+bool NOTMatcher::operator() (pkgCache::VerIterator const &Ver) { return ! (*matcher)(Ver); }
+NOTMatcher::~NOTMatcher() { delete matcher; }
+
+ANDMatcher::ANDMatcher() {}
+ANDMatcher::ANDMatcher(Matcher * const matcher1) {
+ AND(matcher1);
+}
+ANDMatcher::ANDMatcher(Matcher * const matcher1, Matcher * const matcher2) {
+ AND(matcher1).AND(matcher2);
+}
+ANDMatcher::ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3) {
+ AND(matcher1).AND(matcher2).AND(matcher3);
+}
+ANDMatcher::ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4) {
+ AND(matcher1).AND(matcher2).AND(matcher3).AND(matcher4);
+}
+ANDMatcher::ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5) {
+ AND(matcher1).AND(matcher2).AND(matcher3).AND(matcher4).AND(matcher5);
+}
+ANDMatcher& ANDMatcher::AND(Matcher * const matcher) { matchers.push_back(matcher); return *this; }
+bool ANDMatcher::operator() (pkgCache::PkgIterator const &Pkg) {
+ for (std::vector<Matcher *>::const_iterator M = matchers.begin(); M != matchers.end(); ++M)
+ if ((**M)(Pkg) == false)
+ return false;
+ return true;
+}
+bool ANDMatcher::operator() (pkgCache::GrpIterator const &Grp) {
+ for (std::vector<Matcher *>::const_iterator M = matchers.begin(); M != matchers.end(); ++M)
+ if ((**M)(Grp) == false)
+ return false;
+ return true;
+}
+bool ANDMatcher::operator() (pkgCache::VerIterator const &Ver) {
+ for (std::vector<Matcher *>::const_iterator M = matchers.begin(); M != matchers.end(); ++M)
+ if ((**M)(Ver) == false)
+ return false;
+ return true;
+}
+ANDMatcher::~ANDMatcher() {
+ for (std::vector<Matcher *>::iterator M = matchers.begin(); M != matchers.end(); ++M)
+ delete *M;
+}
+
+ORMatcher::ORMatcher() {}
+ORMatcher::ORMatcher(Matcher * const matcher1) {
+ OR(matcher1);
+}
+ORMatcher::ORMatcher(Matcher * const matcher1, Matcher * const matcher2) {
+ OR(matcher1).OR(matcher2);
+}
+ORMatcher::ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3) {
+ OR(matcher1).OR(matcher2).OR(matcher3);
+}
+ORMatcher::ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4) {
+ OR(matcher1).OR(matcher2).OR(matcher3).OR(matcher4);
+}
+ORMatcher::ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5) {
+ OR(matcher1).OR(matcher2).OR(matcher3).OR(matcher4).OR(matcher5);
+}
+ORMatcher& ORMatcher::OR(Matcher * const matcher) { matchers.push_back(matcher); return *this; }
+bool ORMatcher::operator() (pkgCache::PkgIterator const &Pkg) {
+ for (std::vector<Matcher *>::const_iterator M = matchers.begin(); M != matchers.end(); ++M)
+ if ((**M)(Pkg) == true)
+ return true;
+ return false;
+}
+bool ORMatcher::operator() (pkgCache::GrpIterator const &Grp) {
+ for (std::vector<Matcher *>::const_iterator M = matchers.begin(); M != matchers.end(); ++M)
+ if ((**M)(Grp) == true)
+ return true;
+ return false;
+}
+bool ORMatcher::operator() (pkgCache::VerIterator const &Ver) {
+ for (std::vector<Matcher *>::const_iterator M = matchers.begin(); M != matchers.end(); ++M)
+ if ((**M)(Ver) == true)
+ return true;
+ return false;
+}
+ORMatcher::~ORMatcher() {
+ for (std::vector<Matcher *>::iterator M = matchers.begin(); M != matchers.end(); ++M)
+ delete *M;
}
/*}}}*/
diff --git a/apt-pkg/cachefilter.h b/apt-pkg/cachefilter.h
index d9b957c67..b4697b773 100644
--- a/apt-pkg/cachefilter.h
+++ b/apt-pkg/cachefilter.h
@@ -10,28 +10,90 @@
#include <apt-pkg/cacheiterators.h>
#include <string>
+#include <vector>
#include <regex.h>
+
+class pkgCacheFile;
/*}}}*/
namespace APT {
namespace CacheFilter {
-class PackageMatcher {
- public:
- virtual bool operator() (pkgCache::PkgIterator const &/*Pkg*/) {
- return false; };
- virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) {
- return false; };
- virtual bool operator() (pkgCache::VerIterator const &/*Ver*/) {
- return false; };
-
- virtual ~PackageMatcher() {};
+class Matcher {
+public:
+ virtual bool operator() (pkgCache::PkgIterator const &/*Pkg*/) = 0;
+ virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) = 0;
+ virtual bool operator() (pkgCache::VerIterator const &/*Ver*/) = 0;
+ virtual ~Matcher();
};
-// PackageNameMatchesRegEx /*{{{*/
-class PackageNameMatchesRegEx : public PackageMatcher {
- /** \brief dpointer placeholder (for later in case we need it) */
- void *d;
+class PackageMatcher : public Matcher {
+public:
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg) = 0;
+ virtual bool operator() (pkgCache::VerIterator const &Ver) { return (*this)(Ver.ParentPkg()); }
+ virtual bool operator() (pkgCache::GrpIterator const &/*Grp*/) { return false; }
+ virtual ~PackageMatcher();
+};
+
+// Generica like True, False, NOT, AND, OR /*{{{*/
+class TrueMatcher : public Matcher {
+public:
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ virtual bool operator() (pkgCache::GrpIterator const &Grp);
+ virtual bool operator() (pkgCache::VerIterator const &Ver);
+};
+
+class FalseMatcher : public Matcher {
+public:
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ virtual bool operator() (pkgCache::GrpIterator const &Grp);
+ virtual bool operator() (pkgCache::VerIterator const &Ver);
+};
+
+class NOTMatcher : public Matcher {
+ Matcher * const matcher;
+public:
+ NOTMatcher(Matcher * const matcher);
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ virtual bool operator() (pkgCache::GrpIterator const &Grp);
+ virtual bool operator() (pkgCache::VerIterator const &Ver);
+ virtual ~NOTMatcher();
+};
+
+class ANDMatcher : public Matcher {
+ std::vector<Matcher *> matchers;
+public:
+ // 5 ought to be enough for everybody… c++11 variadic templates would be nice
+ ANDMatcher();
+ ANDMatcher(Matcher * const matcher1);
+ ANDMatcher(Matcher * const matcher1, Matcher * const matcher2);
+ ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
+ ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
+ ANDMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5);
+ ANDMatcher& AND(Matcher * const matcher);
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ virtual bool operator() (pkgCache::GrpIterator const &Grp);
+ virtual bool operator() (pkgCache::VerIterator const &Ver);
+ virtual ~ANDMatcher();
+};
+class ORMatcher : public Matcher {
+ std::vector<Matcher *> matchers;
+public:
+ // 5 ought to be enough for everybody… c++11 variadic templates would be nice
+ ORMatcher();
+ ORMatcher(Matcher * const matcher1);
+ ORMatcher(Matcher * const matcher1, Matcher * const matcher2);
+ ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3);
+ ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4);
+ ORMatcher(Matcher * const matcher1, Matcher * const matcher2, Matcher * const matcher3, Matcher * const matcher4, Matcher * const matcher5);
+ ORMatcher& OR(Matcher * const matcher);
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ virtual bool operator() (pkgCache::GrpIterator const &Grp);
+ virtual bool operator() (pkgCache::VerIterator const &Ver);
+ virtual ~ORMatcher();
+};
+ /*}}}*/
+class PackageNameMatchesRegEx : public PackageMatcher { /*{{{*/
regex_t* pattern;
public:
PackageNameMatchesRegEx(std::string const &Pattern);
@@ -40,20 +102,16 @@ public:
virtual ~PackageNameMatchesRegEx();
};
/*}}}*/
-// PackageNameMatchesFnmatch /*{{{*/
- class PackageNameMatchesFnmatch : public PackageMatcher{
- /** \brief dpointer placeholder (for later in case we need it) */
- void *d;
- const std::string Pattern;
+class PackageNameMatchesFnmatch : public PackageMatcher { /*{{{*/
+ const std::string Pattern;
public:
- PackageNameMatchesFnmatch(std::string const &Pattern)
- : Pattern(Pattern) {};
- virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ PackageNameMatchesFnmatch(std::string const &Pattern);
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
virtual bool operator() (pkgCache::GrpIterator const &Grp);
virtual ~PackageNameMatchesFnmatch() {};
};
/*}}}*/
-// PackageArchitectureMatchesSpecification /*{{{*/
+class PackageArchitectureMatchesSpecification : public PackageMatcher { /*{{{*/
/** \class PackageArchitectureMatchesSpecification
\brief matching against architecture specification strings
@@ -62,12 +120,9 @@ public:
debian-policy §11.1 "Architecture specification strings".
Examples: i386, mipsel, linux-any, any-amd64, any */
-class PackageArchitectureMatchesSpecification : public PackageMatcher {
std::string literal;
std::string complete;
bool isPattern;
- /** \brief dpointer placeholder (for later in case we need it) */
- void *d;
public:
/** \brief matching against architecture specification strings
*
@@ -79,10 +134,18 @@ public:
PackageArchitectureMatchesSpecification(std::string const &pattern, bool const isPattern = true);
bool operator() (char const * const &arch);
virtual bool operator() (pkgCache::PkgIterator const &Pkg);
- virtual bool operator() (pkgCache::VerIterator const &Ver);
virtual ~PackageArchitectureMatchesSpecification();
};
/*}}}*/
+class PackageIsNewInstall : public PackageMatcher { /*{{{*/
+ pkgCacheFile * const Cache;
+public:
+ PackageIsNewInstall(pkgCacheFile * const Cache);
+ virtual bool operator() (pkgCache::PkgIterator const &Pkg);
+ virtual ~PackageIsNewInstall();
+};
+ /*}}}*/
+
}
}
#endif
diff --git a/apt-pkg/cacheiterators.h b/apt-pkg/cacheiterators.h
index f2aae7272..b0c02d4a2 100644
--- a/apt-pkg/cacheiterators.h
+++ b/apt-pkg/cacheiterators.h
@@ -159,7 +159,7 @@ class pkgCache::PkgIterator: public Iterator<Package, PkgIterator> {
enum OkState {NeedsNothing,NeedsUnpack,NeedsConfigure};
// Accessors
- inline const char *Name() const {return S->Name == 0?0:Owner->StrP + S->Name;}
+ inline const char *Name() const { return Group().Name(); }
// Versions have sections - and packages can have different versions with different sections
// so this interface is broken by design. It used to return the section of the "first parsed
// package stanza", but as this can potentially be anything it now returns the section of the
@@ -215,6 +215,12 @@ class pkgCache::VerIterator : public Iterator<Version, VerIterator> {
// Accessors
inline const char *VerStr() const {return S->VerStr == 0?0:Owner->StrP + S->VerStr;}
inline const char *Section() const {return S->Section == 0?0:Owner->StrP + S->Section;}
+ /** \brief source package name this version comes from
+ Always contains the name, even if it is the same as the binary name */
+ inline const char *SourcePkgName() const {return Owner->StrP + S->SourcePkgName;}
+ /** \brief source version this version comes from
+ Always contains the version string, even if it is the same as the binary version */
+ inline const char *SourceVerStr() const {return Owner->StrP + S->SourceVerStr;}
inline const char *Arch() const {
if ((S->MultiArch & pkgCache::Version::All) == pkgCache::Version::All)
return "all";
@@ -336,7 +342,7 @@ class pkgCache::PrvIterator : public Iterator<Provides, PrvIterator> {
inline void operator ++() {operator ++(0);}
// Accessors
- inline const char *Name() const {return Owner->StrP + Owner->PkgP[S->ParentPkg].Name;}
+ inline const char *Name() const {return ParentPkg().Name();}
inline const char *ProvideVersion() const {return S->ProvideVersion == 0?0:Owner->StrP + S->ProvideVersion;}
inline PkgIterator ParentPkg() const {return PkgIterator(*Owner,Owner->PkgP + S->ParentPkg);}
inline VerIterator OwnerVer() const {return VerIterator(*Owner,Owner->VerP + S->Version);}
diff --git a/apt-pkg/cacheset.cc b/apt-pkg/cacheset.cc
index d95a32aff..76a7e717e 100644
--- a/apt-pkg/cacheset.cc
+++ b/apt-pkg/cacheset.cc
@@ -37,8 +37,23 @@
#include <apti18n.h>
/*}}}*/
namespace APT {
-// FromTask - Return all packages in the cache from a specific task /*{{{*/
-bool PackageContainerInterface::FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+
+// PackageFrom - selecting the appropriate method for package selection /*{{{*/
+bool CacheSetHelper::PackageFrom(enum PkgSelector const select, PackageContainerInterface * const pci,
+ pkgCacheFile &Cache, std::string const &pattern) {
+ switch (select) {
+ case UNKNOWN: return false;
+ case REGEX: return PackageFromRegEx(pci, Cache, pattern);
+ case TASK: return PackageFromTask(pci, Cache, pattern);
+ case FNMATCH: return PackageFromFnmatch(pci, Cache, pattern);
+ case PACKAGENAME: return PackageFromPackageName(pci, Cache, pattern);
+ case STRING: return PackageFromString(pci, Cache, pattern);
+ }
+ return false;
+}
+ /*}}}*/
+// PackageFromTask - Return all packages in the cache from a specific task /*{{{*/
+bool CacheSetHelper::PackageFromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) {
size_t const archfound = pattern.find_last_of(':');
std::string arch = "native";
if (archfound != std::string::npos) {
@@ -55,7 +70,7 @@ bool PackageContainerInterface::FromTask(PackageContainerInterface * const pci,
bool const wasEmpty = pci->empty();
if (wasEmpty == true)
- pci->setConstructor(TASK);
+ pci->setConstructor(CacheSetHelper::TASK);
// get the records
pkgRecords Recs(Cache);
@@ -91,32 +106,32 @@ bool PackageContainerInterface::FromTask(PackageContainerInterface * const pci,
continue;
pci->insert(Pkg);
- helper.showTaskSelection(Pkg, pattern);
+ showPackageSelection(Pkg, CacheSetHelper::TASK, pattern);
found = true;
}
regfree(&Pattern);
if (found == false) {
- helper.canNotFindTask(pci, Cache, pattern);
- pci->setConstructor(UNKNOWN);
+ canNotFindPackage(CacheSetHelper::TASK, pci, Cache, pattern);
+ pci->setConstructor(CacheSetHelper::UNKNOWN);
return false;
}
- if (wasEmpty == false && pci->getConstructor() != UNKNOWN)
- pci->setConstructor(UNKNOWN);
+ if (wasEmpty == false && pci->getConstructor() != CacheSetHelper::UNKNOWN)
+ pci->setConstructor(CacheSetHelper::UNKNOWN);
return true;
}
/*}}}*/
-// FromRegEx - Return all packages in the cache matching a pattern /*{{{*/
-bool PackageContainerInterface::FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+// PackageFromRegEx - Return all packages in the cache matching a pattern /*{{{*/
+bool CacheSetHelper::PackageFromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern) {
static const char * const isregex = ".?+*|[^$";
if (pattern.find_first_of(isregex) == std::string::npos)
return false;
bool const wasEmpty = pci->empty();
if (wasEmpty == true)
- pci->setConstructor(REGEX);
+ pci->setConstructor(CacheSetHelper::REGEX);
size_t archfound = pattern.find_last_of(':');
std::string arch = "native";
@@ -150,28 +165,25 @@ bool PackageContainerInterface::FromRegEx(PackageContainerInterface * const pci,
}
pci->insert(Pkg);
- helper.showRegExSelection(Pkg, pattern);
+ showPackageSelection(Pkg, CacheSetHelper::REGEX, pattern);
found = true;
}
if (found == false) {
- helper.canNotFindRegEx(pci, Cache, pattern);
- pci->setConstructor(UNKNOWN);
+ canNotFindPackage(CacheSetHelper::REGEX, pci, Cache, pattern);
+ pci->setConstructor(CacheSetHelper::UNKNOWN);
return false;
}
- if (wasEmpty == false && pci->getConstructor() != UNKNOWN)
- pci->setConstructor(UNKNOWN);
+ if (wasEmpty == false && pci->getConstructor() != CacheSetHelper::UNKNOWN)
+ pci->setConstructor(CacheSetHelper::UNKNOWN);
return true;
}
/*}}}*/
-// FromFnmatch - Returns the package defined by this fnmatch /*{{{*/
-bool
-PackageContainerInterface::FromFnmatch(PackageContainerInterface * const pci,
- pkgCacheFile &Cache,
- std::string pattern,
- CacheSetHelper &helper)
+// PackageFromFnmatch - Returns the package defined by this fnmatch /*{{{*/
+bool CacheSetHelper::PackageFromFnmatch(PackageContainerInterface * const pci,
+ pkgCacheFile &Cache, std::string pattern)
{
static const char * const isfnmatch = ".?*[]!";
if (pattern.find_first_of(isfnmatch) == std::string::npos)
@@ -179,7 +191,7 @@ PackageContainerInterface::FromFnmatch(PackageContainerInterface * const pci,
bool const wasEmpty = pci->empty();
if (wasEmpty == true)
- pci->setConstructor(FNMATCH);
+ pci->setConstructor(CacheSetHelper::FNMATCH);
size_t archfound = pattern.find_last_of(':');
std::string arch = "native";
@@ -213,33 +225,25 @@ PackageContainerInterface::FromFnmatch(PackageContainerInterface * const pci,
}
pci->insert(Pkg);
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
- helper.showFnmatchSelection(Pkg, pattern);
-#else
- helper.showRegExSelection(Pkg, pattern);
-#endif
+ showPackageSelection(Pkg, CacheSetHelper::FNMATCH, pattern);
found = true;
}
if (found == false) {
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
- helper.canNotFindFnmatch(pci, Cache, pattern);
-#else
- helper.canNotFindRegEx(pci, Cache, pattern);
-#endif
- pci->setConstructor(UNKNOWN);
+ canNotFindPackage(CacheSetHelper::FNMATCH, pci, Cache, pattern);
+ pci->setConstructor(CacheSetHelper::UNKNOWN);
return false;
}
- if (wasEmpty == false && pci->getConstructor() != UNKNOWN)
- pci->setConstructor(UNKNOWN);
+ if (wasEmpty == false && pci->getConstructor() != CacheSetHelper::UNKNOWN)
+ pci->setConstructor(CacheSetHelper::UNKNOWN);
return true;
}
/*}}}*/
-// FromName - Returns the package defined by this string /*{{{*/
-pkgCache::PkgIterator PackageContainerInterface::FromName(pkgCacheFile &Cache,
- std::string const &str, CacheSetHelper &helper) {
+// PackageFromName - Returns the package defined by this string /*{{{*/
+pkgCache::PkgIterator CacheSetHelper::PackageFromName(pkgCacheFile &Cache,
+ std::string const &str) {
std::string pkg = str;
size_t archfound = pkg.find_last_of(':');
std::string arch;
@@ -260,13 +264,13 @@ pkgCache::PkgIterator PackageContainerInterface::FromName(pkgCacheFile &Cache,
Pkg = Cache.GetPkgCache()->FindPkg(pkg, arch);
if (Pkg.end() == true)
- return helper.canNotFindPkgName(Cache, str);
+ return canNotFindPkgName(Cache, str);
return Pkg;
}
/*}}}*/
-// FromGroup - Returns the package defined by this string /*{{{*/
-bool PackageContainerInterface::FromGroup(PackageContainerInterface * const pci, pkgCacheFile &Cache,
- std::string pkg, CacheSetHelper &helper) {
+// PackageFromPackageName - Returns the package defined by this string /*{{{*/
+bool CacheSetHelper::PackageFromPackageName(PackageContainerInterface * const pci, pkgCacheFile &Cache,
+ std::string pkg) {
if (unlikely(Cache.GetPkgCache() == 0))
return false;
@@ -306,7 +310,7 @@ bool PackageContainerInterface::FromGroup(PackageContainerInterface * const pci,
}
}
- pkgCache::PkgIterator Pkg = helper.canNotFindPkgName(Cache, pkg);
+ pkgCache::PkgIterator Pkg = canNotFindPkgName(Cache, pkg);
if (Pkg.end() == true)
return false;
@@ -314,20 +318,18 @@ bool PackageContainerInterface::FromGroup(PackageContainerInterface * const pci,
return true;
}
/*}}}*/
-// FromString - Return all packages matching a specific string /*{{{*/
-bool PackageContainerInterface::FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str, CacheSetHelper &helper) {
+// PackageFromString - Return all packages matching a specific string /*{{{*/
+bool CacheSetHelper::PackageFromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str) {
bool found = true;
_error->PushToStack();
- if (FromGroup(pci, Cache, str, helper) == false &&
- FromTask(pci, Cache, str, helper) == false &&
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
- // FIXME: hm, hm, regexp/fnmatch incompatible?
- FromFnmatch(pci, Cache, str, helper) == false &&
-#endif
- FromRegEx(pci, Cache, str, helper) == false)
+ if (PackageFrom(CacheSetHelper::PACKAGENAME, pci, Cache, str) == false &&
+ PackageFrom(CacheSetHelper::TASK, pci, Cache, str) == false &&
+ // FIXME: hm, hm, regexp/fnmatch incompatible?
+ PackageFrom(CacheSetHelper::FNMATCH, pci, Cache, str) == false &&
+ PackageFrom(CacheSetHelper::REGEX, pci, Cache, str) == false)
{
- helper.canNotFindPackage(pci, Cache, str);
+ canNotFindPackage(CacheSetHelper::PACKAGENAME, pci, Cache, str);
found = false;
}
@@ -338,51 +340,50 @@ bool PackageContainerInterface::FromString(PackageContainerInterface * const pci
return found;
}
/*}}}*/
-// FromCommandLine - Return all packages specified on commandline /*{{{*/
-bool PackageContainerInterface::FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) {
+// PackageFromCommandLine - Return all packages specified on commandline /*{{{*/
+bool CacheSetHelper::PackageFromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline) {
bool found = false;
for (const char **I = cmdline; *I != 0; ++I)
- found |= PackageContainerInterface::FromString(pci, Cache, *I, helper);
+ found |= PackageFrom(CacheSetHelper::PACKAGENAME, pci, Cache, *I);
return found;
}
/*}}}*/
// FromModifierCommandLine - helper doing the work for PKG:GroupedFromCommandLine /*{{{*/
-bool PackageContainerInterface::FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
+bool CacheSetHelper::PackageFromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
pkgCacheFile &Cache, const char * cmdline,
- std::list<Modifier> const &mods, CacheSetHelper &helper) {
+ std::list<PkgModifier> const &mods) {
std::string str = cmdline;
unsigned short fallback = modID;
bool modifierPresent = false;
- for (std::list<Modifier>::const_iterator mod = mods.begin();
+ for (std::list<PkgModifier>::const_iterator mod = mods.begin();
mod != mods.end(); ++mod) {
size_t const alength = strlen(mod->Alias);
switch(mod->Pos) {
- case Modifier::POSTFIX:
+ case PkgModifier::POSTFIX:
if (str.compare(str.length() - alength, alength,
mod->Alias, 0, alength) != 0)
continue;
str.erase(str.length() - alength);
modID = mod->ID;
break;
- case Modifier::PREFIX:
+ case PkgModifier::PREFIX:
continue;
- case Modifier::NONE:
+ case PkgModifier::NONE:
continue;
}
modifierPresent = true;
break;
}
if (modifierPresent == true) {
- bool const errors = helper.showErrors(false);
- pkgCache::PkgIterator Pkg = FromName(Cache, cmdline, helper);
- helper.showErrors(errors);
- if (Pkg.end() == false) {
- pci->insert(Pkg);
+ bool const errors = showErrors(false);
+ bool const found = PackageFrom(PACKAGENAME, pci, Cache, cmdline);
+ showErrors(errors);
+ if (found == true) {
modID = fallback;
return true;
}
}
- return FromString(pci, Cache, str, helper);
+ return PackageFrom(CacheSetHelper::PACKAGENAME, pci, Cache, str);
}
/*}}}*/
// FromModifierCommandLine - helper doing the work for VER:GroupedFromCommandLine /*{{{*/
@@ -391,7 +392,7 @@ bool VersionContainerInterface::FromModifierCommandLine(unsigned short &modID,
pkgCacheFile &Cache, const char * cmdline,
std::list<Modifier> const &mods,
CacheSetHelper &helper) {
- Version select = NEWEST;
+ CacheSetHelper::VerSelector select = CacheSetHelper::NEWEST;
std::string str = cmdline;
if (unlikely(str.empty() == true))
return false;
@@ -434,7 +435,8 @@ bool VersionContainerInterface::FromModifierCommandLine(unsigned short &modID,
// FromCommandLine - Return all versions specified on commandline /*{{{*/
bool VersionContainerInterface::FromCommandLine(VersionContainerInterface * const vci,
pkgCacheFile &Cache, const char **cmdline,
- Version const &fallback, CacheSetHelper &helper) {
+ CacheSetHelper::VerSelector const fallback,
+ CacheSetHelper &helper) {
bool found = false;
for (const char **I = cmdline; *I != 0; ++I)
found |= VersionContainerInterface::FromString(vci, Cache, *I, fallback, helper);
@@ -444,16 +446,16 @@ bool VersionContainerInterface::FromCommandLine(VersionContainerInterface * cons
// FromString - Returns all versions spedcified by a string /*{{{*/
bool VersionContainerInterface::FromString(VersionContainerInterface * const vci,
pkgCacheFile &Cache, std::string pkg,
- Version const &fallback, CacheSetHelper &helper,
+ CacheSetHelper::VerSelector const fallback,
+ CacheSetHelper &helper,
bool const onlyFromName) {
- PackageSet pkgset;
- if(FileExists(pkg))
- {
- PackageContainerInterface::FromString(&pkgset, Cache, pkg, helper);
- if(pkgset.size() == 0)
- return false;
- return VersionContainerInterface::FromPackage(vci, Cache, pkgset.begin(), fallback, helper);
- }
+ PackageSet pkgset;
+ if(FileExists(pkg)) {
+ helper.PackageFrom(CacheSetHelper::STRING, &pkgset, Cache, pkg);
+ if(pkgset.empty() == true)
+ return false;
+ return VersionContainerInterface::FromPackage(vci, Cache, pkgset.begin(), fallback, helper);
+ }
std::string ver;
bool verIsRel = false;
@@ -464,13 +466,13 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci
pkg.erase(vertag);
}
if (onlyFromName == false)
- PackageContainerInterface::FromString(&pkgset, Cache, pkg, helper);
+ helper.PackageFrom(CacheSetHelper::STRING, &pkgset, Cache, pkg);
else {
- pkgset.insert(PackageContainerInterface::FromName(Cache, pkg, helper));
+ helper.PackageFrom(CacheSetHelper::PACKAGENAME, &pkgset, Cache, pkg);
}
bool errors = true;
- if (pkgset.getConstructor() != PackageSet::UNKNOWN)
+ if (pkgset.getConstructor() != CacheSetHelper::UNKNOWN)
errors = helper.showErrors(false);
bool found = false;
@@ -489,7 +491,7 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci
if (P->VersionList != 0)
V = P.VersionList();
else
- V = helper.canNotFindNewestVer(Cache, P);
+ V = helper.canNotGetVersion(CacheSetHelper::NEWEST, Cache, P);
} else {
pkgVersionMatch Match(ver, (verIsRel == true ? pkgVersionMatch::Release :
pkgVersionMatch::Version));
@@ -506,11 +508,14 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci
}
if (V.end() == true)
continue;
- helper.showSelectedVersion(P, V, ver, verIsRel);
+ if (verIsRel == true)
+ helper.showVersionSelection(P, V, CacheSetHelper::RELEASE, ver);
+ else
+ helper.showVersionSelection(P, V, CacheSetHelper::VERSIONNUMBER, ver);
vci->insert(V);
found = true;
}
- if (pkgset.getConstructor() != PackageSet::UNKNOWN)
+ if (pkgset.getConstructor() != CacheSetHelper::UNKNOWN)
helper.showErrors(errors);
return found;
}
@@ -519,30 +524,30 @@ bool VersionContainerInterface::FromString(VersionContainerInterface * const vci
bool VersionContainerInterface::FromPackage(VersionContainerInterface * const vci,
pkgCacheFile &Cache,
pkgCache::PkgIterator const &P,
- Version const &fallback,
+ CacheSetHelper::VerSelector const fallback,
CacheSetHelper &helper) {
pkgCache::VerIterator V;
bool showErrors;
bool found = false;
switch(fallback) {
- case ALL:
+ case CacheSetHelper::ALL:
if (P->VersionList != 0)
for (V = P.VersionList(); V.end() != true; ++V)
found |= vci->insert(V);
else
- helper.canNotFindAllVer(vci, Cache, P);
+ helper.canNotFindVersion(CacheSetHelper::ALL, vci, Cache, P);
break;
- case CANDANDINST:
+ case CacheSetHelper::CANDANDINST:
found |= vci->insert(getInstalledVer(Cache, P, helper));
found |= vci->insert(getCandidateVer(Cache, P, helper));
break;
- case CANDIDATE:
+ case CacheSetHelper::CANDIDATE:
found |= vci->insert(getCandidateVer(Cache, P, helper));
break;
- case INSTALLED:
+ case CacheSetHelper::INSTALLED:
found |= vci->insert(getInstalledVer(Cache, P, helper));
break;
- case CANDINST:
+ case CacheSetHelper::CANDINST:
showErrors = helper.showErrors(false);
V = getCandidateVer(Cache, P, helper);
if (V.end() == true)
@@ -551,9 +556,9 @@ bool VersionContainerInterface::FromPackage(VersionContainerInterface * const vc
if (V.end() == false)
found |= vci->insert(V);
else
- helper.canNotFindInstCandVer(vci, Cache, P);
+ helper.canNotFindVersion(CacheSetHelper::CANDINST, vci, Cache, P);
break;
- case INSTCAND:
+ case CacheSetHelper::INSTCAND:
showErrors = helper.showErrors(false);
V = getInstalledVer(Cache, P, helper);
if (V.end() == true)
@@ -562,14 +567,18 @@ bool VersionContainerInterface::FromPackage(VersionContainerInterface * const vc
if (V.end() == false)
found |= vci->insert(V);
else
- helper.canNotFindInstCandVer(vci, Cache, P);
+ helper.canNotFindVersion(CacheSetHelper::INSTCAND, vci, Cache, P);
break;
- case NEWEST:
+ case CacheSetHelper::NEWEST:
if (P->VersionList != 0)
found |= vci->insert(P.VersionList());
else
- helper.canNotFindNewestVer(Cache, P);
+ helper.canNotFindVersion(CacheSetHelper::NEWEST, vci, Cache, P);
break;
+ case CacheSetHelper::RELEASE:
+ case CacheSetHelper::VERSIONNUMBER:
+ // both make no sense here, so always false
+ return false;
}
return found;
}
@@ -586,7 +595,7 @@ pkgCache::VerIterator VersionContainerInterface::getCandidateVer(pkgCacheFile &C
Cand = Cache[Pkg].CandidateVerIter(Cache);
}
if (Cand.end() == true)
- return helper.canNotFindCandidateVer(Cache, Pkg);
+ return helper.canNotGetVersion(CacheSetHelper::CANDIDATE, Cache, Pkg);
return Cand;
}
/*}}}*/
@@ -594,19 +603,31 @@ pkgCache::VerIterator VersionContainerInterface::getCandidateVer(pkgCacheFile &C
pkgCache::VerIterator VersionContainerInterface::getInstalledVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg, CacheSetHelper &helper) {
if (Pkg->CurrentVer == 0)
- return helper.canNotFindInstalledVer(Cache, Pkg);
+ return helper.canNotGetVersion(CacheSetHelper::INSTALLED, Cache, Pkg);
return Pkg.CurrentVer();
}
/*}}}*/
-// canNotFindPkgName - handle the case no package has this name /*{{{*/
-pkgCache::PkgIterator CacheSetHelper::canNotFindPkgName(pkgCacheFile &Cache,
- std::string const &str) {
- if (ShowError == true)
- _error->Insert(ErrorType, _("Unable to locate package %s"), str.c_str());
- return pkgCache::PkgIterator(Cache, 0);
+// canNotFindPackage - with the given selector and pattern /*{{{*/
+void CacheSetHelper::canNotFindPackage(enum PkgSelector const select,
+ PackageContainerInterface * const pci, pkgCacheFile &Cache,
+ std::string const &pattern) {
+ switch (select) {
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ case REGEX: canNotFindRegEx(pci, Cache, pattern); break;
+ case TASK: canNotFindTask(pci, Cache, pattern); break;
+ case FNMATCH: canNotFindFnmatch(pci, Cache, pattern); break;
+ case PACKAGENAME: canNotFindPackage(pci, Cache, pattern); break;
+ case STRING: canNotFindPackage(pci, Cache, pattern); break;
+ case UNKNOWN: break;
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
+ }
}
- /*}}}*/
// canNotFindTask - handle the case no package is found for a task /*{{{*/
void CacheSetHelper::canNotFindTask(PackageContainerInterface * const /*pci*/, pkgCacheFile &/*Cache*/, std::string pattern) {
if (ShowError == true)
@@ -618,17 +639,50 @@ void CacheSetHelper::canNotFindRegEx(PackageContainerInterface * const /*pci*/,
if (ShowError == true)
_error->Insert(ErrorType, _("Couldn't find any package by regex '%s'"), pattern.c_str());
}
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
+ /*}}}*/
// canNotFindFnmatch - handle the case no package is found by a fnmatch /*{{{*/
void CacheSetHelper::canNotFindFnmatch(PackageContainerInterface * const /*pci*/, pkgCacheFile &/*Cache*/, std::string pattern) {
if (ShowError == true)
_error->Insert(ErrorType, _("Couldn't find any package by glob '%s'"), pattern.c_str());
}
-#endif /*}}}*/
+ /*}}}*/
// canNotFindPackage - handle the case no package is found from a string/*{{{*/
APT_CONST void CacheSetHelper::canNotFindPackage(PackageContainerInterface * const /*pci*/, pkgCacheFile &/*Cache*/, std::string const &/*str*/) {
}
/*}}}*/
+ /*}}}*/
+// canNotFindPkgName - handle the case no package has this name /*{{{*/
+pkgCache::PkgIterator CacheSetHelper::canNotFindPkgName(pkgCacheFile &Cache,
+ std::string const &str) {
+ if (ShowError == true)
+ _error->Insert(ErrorType, _("Unable to locate package %s"), str.c_str());
+ return pkgCache::PkgIterator(Cache, 0);
+}
+ /*}}}*/
+// canNotFindVersion - for package by selector /*{{{*/
+void CacheSetHelper::canNotFindVersion(enum VerSelector const select, VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg)
+{
+ switch (select) {
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ case ALL: canNotFindAllVer(vci, Cache, Pkg); break;
+ case INSTCAND: canNotFindInstCandVer(vci, Cache, Pkg); break;
+ case CANDINST: canNotFindCandInstVer(vci, Cache, Pkg); break;
+ case NEWEST: canNotFindNewestVer(Cache, Pkg); break;
+ case CANDIDATE: canNotFindCandidateVer(Cache, Pkg); break;
+ case INSTALLED: canNotFindInstalledVer(Cache, Pkg); break;
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
+ case CANDANDINST: canNotGetCandInstVer(Cache, Pkg); break;
+ case RELEASE:
+ case VERSIONNUMBER:
+ // invalid in this branch
+ break;
+ }
+}
// canNotFindAllVer /*{{{*/
void CacheSetHelper::canNotFindAllVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &/*Cache*/,
pkgCache::PkgIterator const &Pkg) {
@@ -637,19 +691,42 @@ void CacheSetHelper::canNotFindAllVer(VersionContainerInterface * const /*vci*/,
}
/*}}}*/
// canNotFindInstCandVer /*{{{*/
-void CacheSetHelper::canNotFindInstCandVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &/*Cache*/,
+void CacheSetHelper::canNotFindInstCandVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg) {
- if (ShowError == true)
- _error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str());
+ canNotGetInstCandVer(Cache, Pkg);
}
/*}}}*/
// canNotFindInstCandVer /*{{{*/
-void CacheSetHelper::canNotFindCandInstVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &/*Cache*/,
+void CacheSetHelper::canNotFindCandInstVer(VersionContainerInterface * const /*vci*/, pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg) {
- if (ShowError == true)
- _error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str());
+ canNotGetCandInstVer(Cache, Pkg);
}
/*}}}*/
+ /*}}}*/
+// canNotGetVersion - for package by selector /*{{{*/
+pkgCache::VerIterator CacheSetHelper::canNotGetVersion(enum VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
+ switch (select) {
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ case NEWEST: return canNotFindNewestVer(Cache, Pkg);
+ case CANDIDATE: return canNotFindCandidateVer(Cache, Pkg);
+ case INSTALLED: return canNotFindInstalledVer(Cache, Pkg);
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
+ case CANDINST: return canNotGetCandInstVer(Cache, Pkg);
+ case INSTCAND: return canNotGetInstCandVer(Cache, Pkg);
+ case ALL:
+ case CANDANDINST:
+ case RELEASE:
+ case VERSIONNUMBER:
+ // invalid in this branch
+ return pkgCache::VerIterator(Cache, 0);
+ }
+ return pkgCache::VerIterator(Cache, 0);
+}
// canNotFindNewestVer /*{{{*/
pkgCache::VerIterator CacheSetHelper::canNotFindNewestVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg) {
@@ -674,6 +751,42 @@ pkgCache::VerIterator CacheSetHelper::canNotFindInstalledVer(pkgCacheFile &Cache
return pkgCache::VerIterator(Cache, 0);
}
/*}}}*/
+// canNotFindInstCandVer /*{{{*/
+pkgCache::VerIterator CacheSetHelper::canNotGetInstCandVer(pkgCacheFile &Cache,
+ pkgCache::PkgIterator const &Pkg) {
+ if (ShowError == true)
+ _error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str());
+ return pkgCache::VerIterator(Cache, 0);
+}
+ /*}}}*/
+// canNotFindInstCandVer /*{{{*/
+pkgCache::VerIterator CacheSetHelper::canNotGetCandInstVer(pkgCacheFile &Cache,
+ pkgCache::PkgIterator const &Pkg) {
+ if (ShowError == true)
+ _error->Insert(ErrorType, _("Can't select installed nor candidate version from package '%s' as it has neither of them"), Pkg.FullName(true).c_str());
+ return pkgCache::VerIterator(Cache, 0);
+}
+ /*}}}*/
+ /*}}}*/
+// showPackageSelection - by selector and given pattern /*{{{*/
+APT_CONST void CacheSetHelper::showPackageSelection(pkgCache::PkgIterator const &pkg, enum PkgSelector const select,
+ std::string const &pattern) {
+ switch (select) {
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ case REGEX: showRegExSelection(pkg, pattern); break;
+ case TASK: showTaskSelection(pkg, pattern); break;
+ case FNMATCH: showFnmatchSelection(pkg, pattern); break;
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
+ case PACKAGENAME: /* no suprises here */ break;
+ case STRING: /* handled by the special cases */ break;
+ case UNKNOWN: break;
+ }
+}
// showTaskSelection /*{{{*/
APT_CONST void CacheSetHelper::showTaskSelection(pkgCache::PkgIterator const &/*pkg*/,
std::string const &/*pattern*/) {
@@ -684,14 +797,41 @@ APT_CONST void CacheSetHelper::showRegExSelection(pkgCache::PkgIterator const &/
std::string const &/*pattern*/) {
}
/*}}}*/
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
// showFnmatchSelection /*{{{*/
APT_CONST void CacheSetHelper::showFnmatchSelection(pkgCache::PkgIterator const &/*pkg*/,
std::string const &/*pattern*/) {
}
/*}}}*/
+ /*}}}*/
+// showVersionSelection /*{{{*/
+APT_CONST void CacheSetHelper::showVersionSelection(pkgCache::PkgIterator const &Pkg,
+ pkgCache::VerIterator const &Ver, enum VerSelector const select, std::string const &pattern) {
+ switch (select) {
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ case RELEASE:
+ showSelectedVersion(Pkg, Ver, pattern, true);
+ break;
+ case VERSIONNUMBER:
+ showSelectedVersion(Pkg, Ver, pattern, false);
+ break;
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
-// showSelectedVersion /*{{{*/
+ case NEWEST:
+ case CANDIDATE:
+ case INSTALLED:
+ case CANDINST:
+ case INSTCAND:
+ case ALL:
+ case CANDANDINST:
+ // not really suprises, but in fact: just not implemented
+ break;
+ }
+}
APT_CONST void CacheSetHelper::showSelectedVersion(pkgCache::PkgIterator const &/*Pkg*/,
pkgCache::VerIterator const /*Ver*/,
std::string const &/*ver*/,
diff --git a/apt-pkg/cacheset.h b/apt-pkg/cacheset.h
index 36f41c34d..892ad2dfc 100644
--- a/apt-pkg/cacheset.h
+++ b/apt-pkg/cacheset.h
@@ -13,8 +13,10 @@
#include <map>
#include <set>
#include <list>
+#include <vector>
#include <string>
#include <iterator>
+#include <algorithm>
#include <stddef.h>
@@ -51,36 +53,127 @@ public: /*{{{*/
ShowError(ShowError), ErrorType(ErrorType) {}
virtual ~CacheSetHelper() {}
- virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
- virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
- virtual void showFnmatchSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
-#endif
- virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
- std::string const &ver, bool const verIsRel);
+ enum PkgSelector { UNKNOWN, REGEX, TASK, FNMATCH, PACKAGENAME, STRING };
- virtual void canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
- virtual void canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR >= 13)
- virtual void canNotFindFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
-#endif
- virtual void canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str);
+ virtual bool PackageFrom(enum PkgSelector const select, PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern);
+
+ virtual bool PackageFromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline);
+
+ struct PkgModifier {
+ enum Position { NONE, PREFIX, POSTFIX };
+ unsigned short ID;
+ const char * const Alias;
+ Position Pos;
+ PkgModifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}
+ };
+ virtual bool PackageFromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
+ pkgCacheFile &Cache, const char * cmdline,
+ std::list<PkgModifier> const &mods);
+
+ // use PackageFrom(PACKAGENAME, …) instead
+ APT_DEPRECATED pkgCache::PkgIterator PackageFromName(pkgCacheFile &Cache, std::string const &pattern);
+
+ /** \brief be notified about the package being selected via pattern
+ *
+ * Main use is probably to show a message to the user what happened
+ *
+ * \param pkg is the package which was selected
+ * \param select is the selection method which choose the package
+ * \param pattern is the string used by the selection method to pick the package
+ */
+ virtual void showPackageSelection(pkgCache::PkgIterator const &pkg, PkgSelector const select, std::string const &pattern);
+ // use the method above instead, react only on the type you need and let the base handle the rest if need be
+ // this allows use to add new selection methods without breaking the ABI constantly with new virtual methods
+ APT_DEPRECATED virtual void showTaskSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
+ APT_DEPRECATED virtual void showRegExSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
+ APT_DEPRECATED virtual void showFnmatchSelection(pkgCache::PkgIterator const &pkg, std::string const &pattern);
+
+ /** \brief be notified if a package can't be found via pattern
+ *
+ * Can be used to show a message as well as to try something else to make it match
+ *
+ * \param select is the method tried for selection
+ * \param pci is the container the package should be inserted in
+ * \param Cache is the package universe available
+ * \param pattern is the string not matching anything
+ */
+ virtual void canNotFindPackage(enum PkgSelector const select, PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern);
+ // same as above for showPackageSelection
+ APT_DEPRECATED virtual void canNotFindTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ APT_DEPRECATED virtual void canNotFindRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ APT_DEPRECATED virtual void canNotFindFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ APT_DEPRECATED virtual void canNotFindPackage(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &str);
+
+ /** \brief specifies which version(s) we want to refer to */
+ enum VerSelector {
+ /** by release string */
+ RELEASE,
+ /** by version number string */
+ VERSIONNUMBER,
+ /** All versions */
+ ALL,
+ /** Candidate and installed version */
+ CANDANDINST,
+ /** Candidate version */
+ CANDIDATE,
+ /** Installed version */
+ INSTALLED,
+ /** Candidate or if non installed version */
+ CANDINST,
+ /** Installed or if non candidate version */
+ INSTCAND,
+ /** Newest version */
+ NEWEST
+ };
+
+ /** \brief be notified about the version being selected via pattern
+ *
+ * Main use is probably to show a message to the user what happened
+ * Note that at the moment this method is only called for RELEASE
+ * and VERSION selections, not for the others.
+ *
+ * \param Pkg is the package which was selected for
+ * \param Ver is the version selected
+ * \param select is the selection method which choose the version
+ * \param pattern is the string used by the selection method to pick the version
+ */
+ virtual void showVersionSelection(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const &Ver,
+ enum VerSelector const select, std::string const &pattern);
+ // renamed to have a similar interface to showPackageSelection
+ APT_DEPRECATED virtual void showSelectedVersion(pkgCache::PkgIterator const &Pkg, pkgCache::VerIterator const Ver,
+ std::string const &ver, bool const verIsRel);
- virtual void canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
- virtual void canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ /** \brief be notified if a version can't be found for a package
+ *
+ * Main use is probably to show a message to the user what happened
+ *
+ * \param select is the method tried for selection
+ * \param vci is the container the version should be inserted in
+ * \param Cache is the package universe available
+ * \param Pkg is the package we wanted a version from
+ */
+ virtual void canNotFindVersion(enum VerSelector const select, VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
+ // same as above for showPackageSelection
+ APT_DEPRECATED virtual void canNotFindAllVer(VersionContainerInterface * const vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
+ APT_DEPRECATED virtual void canNotFindInstCandVer(VersionContainerInterface * const vci, pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- virtual void canNotFindCandInstVer(VersionContainerInterface * const vci,
+ APT_DEPRECATED virtual void canNotFindCandInstVer(VersionContainerInterface * const vci,
pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str);
- virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache,
+ // the difference between canNotFind and canNotGet is that the later is more low-level
+ // and called from other places: In this case looking into the code is the only real answer…
+ virtual pkgCache::VerIterator canNotGetVersion(enum VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg);
+ // same as above for showPackageSelection
+ APT_DEPRECATED virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache,
+ APT_DEPRECATED virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
- virtual pkgCache::VerIterator canNotFindInstalledVer(pkgCacheFile &Cache,
+ APT_DEPRECATED virtual pkgCache::VerIterator canNotFindInstalledVer(pkgCacheFile &Cache,
pkgCache::PkgIterator const &Pkg);
+ virtual pkgCache::PkgIterator canNotFindPkgName(pkgCacheFile &Cache, std::string const &str);
+
bool showErrors() const { return ShowError; }
bool showErrors(bool const newValue) { if (ShowError == newValue) return ShowError; else return ((ShowError = newValue) == false); }
GlobalError::MsgType errorType() const { return ErrorType; }
@@ -98,7 +191,19 @@ public: /*{{{*/
protected:
bool ShowError;
GlobalError::MsgType ErrorType;
+
+ pkgCache::VerIterator canNotGetInstCandVer(pkgCacheFile &Cache,
+ pkgCache::PkgIterator const &Pkg);
+ pkgCache::VerIterator canNotGetCandInstVer(pkgCacheFile &Cache,
+ pkgCache::PkgIterator const &Pkg);
+
+ bool PackageFromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ bool PackageFromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ bool PackageFromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ bool PackageFromPackageName(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern);
+ bool PackageFromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern);
}; /*}}}*/
+
class PackageContainerInterface { /*{{{*/
/** \class PackageContainerInterface
@@ -151,29 +256,56 @@ public:
virtual bool empty() const = 0;
virtual void clear() = 0;
- enum Constructor { UNKNOWN, REGEX, TASK, FNMATCH };
- virtual void setConstructor(Constructor const &con) = 0;
- virtual Constructor getConstructor() const = 0;
+ // FIXME: This is a bloody hack removed soon. Use CacheSetHelper::PkgSelector !
+ enum APT_DEPRECATED Constructor { UNKNOWN = CacheSetHelper::UNKNOWN,
+ REGEX = CacheSetHelper::REGEX,
+ TASK = CacheSetHelper::TASK,
+ FNMATCH = CacheSetHelper::FNMATCH };
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ void setConstructor(Constructor const by) { ConstructedBy = (CacheSetHelper::PkgSelector)by; }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
- static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper);
- static bool FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper);
- static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper);
- static bool FromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper);
- static bool FromGroup(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper);
- static bool FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper);
- static bool FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper);
+ void setConstructor(CacheSetHelper::PkgSelector const by) { ConstructedBy = by; }
+ CacheSetHelper::PkgSelector getConstructor() const { return ConstructedBy; }
+ PackageContainerInterface() : ConstructedBy(CacheSetHelper::UNKNOWN) {}
+ PackageContainerInterface(CacheSetHelper::PkgSelector const by) : ConstructedBy(by) {}
+
+ APT_DEPRECATED static bool FromTask(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ return helper.PackageFrom(CacheSetHelper::TASK, pci, Cache, pattern); }
+ APT_DEPRECATED static bool FromRegEx(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ return helper.PackageFrom(CacheSetHelper::REGEX, pci, Cache, pattern); }
+ APT_DEPRECATED static bool FromFnmatch(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ return helper.PackageFrom(CacheSetHelper::FNMATCH, pci, Cache, pattern); }
+ APT_DEPRECATED static bool FromGroup(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
+ return helper.PackageFrom(CacheSetHelper::PACKAGENAME, pci, Cache, pattern); }
+ APT_DEPRECATED static bool FromString(PackageContainerInterface * const pci, pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ return helper.PackageFrom(CacheSetHelper::STRING, pci, Cache, pattern); }
+ APT_DEPRECATED static bool FromCommandLine(PackageContainerInterface * const pci, pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) {
+ return helper.PackageFromCommandLine(pci, Cache, cmdline); }
+
+ APT_DEPRECATED typedef CacheSetHelper::PkgModifier Modifier;
- struct Modifier {
- enum Position { NONE, PREFIX, POSTFIX };
- unsigned short ID;
- const char * const Alias;
- Position Pos;
- Modifier (unsigned short const &id, const char * const alias, Position const &pos) : ID(id), Alias(alias), Pos(pos) {}
- };
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ return helper.PackageFromName(Cache, pattern); }
+ APT_DEPRECATED static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
+ pkgCacheFile &Cache, const char * cmdline,
+ std::list<Modifier> const &mods, CacheSetHelper &helper) {
+ return helper.PackageFromModifierCommandLine(modID, pci, Cache, cmdline, mods); }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
- static bool FromModifierCommandLine(unsigned short &modID, PackageContainerInterface * const pci,
- pkgCacheFile &Cache, const char * cmdline,
- std::list<Modifier> const &mods, CacheSetHelper &helper);
+private:
+ CacheSetHelper::PkgSelector ConstructedBy;
};
/*}}}*/
template<class Container> class PackageContainer : public PackageContainerInterface {/*{{{*/
@@ -237,11 +369,28 @@ public: /*{{{*/
iterator end() { return iterator(_cont.end()); }
const_iterator find(pkgCache::PkgIterator const &P) const { return const_iterator(_cont.find(P)); }
- void setConstructor(Constructor const &by) { ConstructedBy = by; }
- Constructor getConstructor() const { return ConstructedBy; }
+ PackageContainer() : PackageContainerInterface() {}
+ PackageContainer(CacheSetHelper::PkgSelector const &by) : PackageContainerInterface(by) {}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED PackageContainer(Constructor const &by) : PackageContainerInterface((CacheSetHelper::PkgSelector)by) {}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
+
+ /** \brief sort all included versions with given comparer
+
+ Some containers are sorted by default, some are not and can't be,
+ but a few like std::vector can be sorted if need be, so this can be
+ specialized in later on. The default is that this will fail though.
+ Specifically, already sorted containers like std::set will return
+ false as well as there is no easy way to check that the given comparer
+ would sort in the same way the set is currently sorted
- PackageContainer() : ConstructedBy(UNKNOWN) {}
- PackageContainer(Constructor const &by) : ConstructedBy(by) {}
+ \return \b true if the set was sorted, \b false if not. */
+ template<class Compare> bool sort(Compare /*Comp*/) { return false; }
/** \brief returns all packages in the cache who belong to the given task
@@ -252,8 +401,8 @@ public: /*{{{*/
\param pattern name of the task
\param helper responsible for error and message handling */
static PackageContainer FromTask(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
- PackageContainer cont(TASK);
- PackageContainerInterface::FromTask(&cont, Cache, pattern, helper);
+ PackageContainer cont(CacheSetHelper::TASK);
+ helper.PackageFrom(CacheSetHelper::TASK, &cont, Cache, pattern);
return cont;
}
static PackageContainer FromTask(pkgCacheFile &Cache, std::string const &pattern) {
@@ -269,9 +418,9 @@ public: /*{{{*/
\param Cache the packages are in
\param pattern regular expression for package names
\param helper responsible for error and message handling */
- static PackageContainer FromRegEx(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
- PackageContainer cont(REGEX);
- PackageContainerInterface::FromRegEx(&cont, Cache, pattern, helper);
+ static PackageContainer FromRegEx(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ PackageContainer cont(CacheSetHelper::REGEX);
+ helper.PackageFrom(CacheSetHelper::REGEX, &cont, Cache, pattern);
return cont;
}
@@ -280,9 +429,9 @@ public: /*{{{*/
return FromRegEx(Cache, pattern, helper);
}
- static PackageContainer FromFnmatch(pkgCacheFile &Cache, std::string pattern, CacheSetHelper &helper) {
- PackageContainer cont(FNMATCH);
- PackageContainerInterface::FromFnmatch(&cont, Cache, pattern, helper);
+ static PackageContainer FromFnmatch(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ PackageContainer cont(CacheSetHelper::FNMATCH);
+ helper.PackageFrom(CacheSetHelper::FNMATCH, &cont, Cache, pattern);
return cont;
}
static PackageContainer FromFnMatch(pkgCacheFile &Cache, std::string const &pattern) {
@@ -290,18 +439,25 @@ public: /*{{{*/
return FromFnmatch(Cache, pattern, helper);
}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
/** \brief returns a package specified by a string
\param Cache the package is in
\param pattern String the package name should be extracted from
\param helper responsible for error and message handling */
- static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
- return PackageContainerInterface::FromName(Cache, pattern, helper);
+ APT_DEPRECATED static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
+ return helper.PackageFromName(Cache, pattern);
}
- static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern) {
+ APT_DEPRECATED static pkgCache::PkgIterator FromName(pkgCacheFile &Cache, std::string const &pattern) {
CacheSetHelper helper;
- return PackageContainerInterface::FromName(Cache, pattern, helper);
+ return FromName(Cache, pattern, helper);
}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
/** \brief returns all packages specified by a string
@@ -310,7 +466,7 @@ public: /*{{{*/
\param helper responsible for error and message handling */
static PackageContainer FromString(pkgCacheFile &Cache, std::string const &pattern, CacheSetHelper &helper) {
PackageContainer cont;
- PackageContainerInterface::FromString(&cont, Cache, pattern, helper);
+ helper.PackageFrom(CacheSetHelper::PACKAGENAME, &cont, Cache, pattern);
return cont;
}
static PackageContainer FromString(pkgCacheFile &Cache, std::string const &pattern) {
@@ -327,7 +483,7 @@ public: /*{{{*/
\param helper responsible for error and message handling */
static PackageContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline, CacheSetHelper &helper) {
PackageContainer cont;
- PackageContainerInterface::FromCommandLine(&cont, Cache, cmdline, helper);
+ helper.PackageFromCommandLine(&cont, Cache, cmdline);
return cont;
}
static PackageContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline) {
@@ -349,14 +505,14 @@ public: /*{{{*/
static std::map<unsigned short, PackageContainer> GroupedFromCommandLine(
pkgCacheFile &Cache,
const char **cmdline,
- std::list<Modifier> const &mods,
+ std::list<CacheSetHelper::PkgModifier> const &mods,
unsigned short const &fallback,
CacheSetHelper &helper) {
std::map<unsigned short, PackageContainer> pkgsets;
for (const char **I = cmdline; *I != 0; ++I) {
unsigned short modID = fallback;
PackageContainer pkgset;
- PackageContainerInterface::FromModifierCommandLine(modID, &pkgset, Cache, *I, mods, helper);
+ helper.PackageFromModifierCommandLine(modID, &pkgset, Cache, *I, mods);
pkgsets[modID].insert(pkgset);
}
return pkgsets;
@@ -364,22 +520,23 @@ public: /*{{{*/
static std::map<unsigned short, PackageContainer> GroupedFromCommandLine(
pkgCacheFile &Cache,
const char **cmdline,
- std::list<Modifier> const &mods,
+ std::list<CacheSetHelper::PkgModifier> const &mods,
unsigned short const &fallback) {
CacheSetHelper helper;
return GroupedFromCommandLine(Cache, cmdline,
mods, fallback, helper);
}
/*}}}*/
-private: /*{{{*/
- Constructor ConstructedBy;
- /*}}}*/
}; /*}}}*/
-
+// specialisations for push_back containers: std::list & std::vector /*{{{*/
template<> template<class Cont> void PackageContainer<std::list<pkgCache::PkgIterator> >::insert(PackageContainer<Cont> const &pkgcont) {
for (typename PackageContainer<Cont>::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p)
_cont.push_back(*p);
}
+template<> template<class Cont> void PackageContainer<std::vector<pkgCache::PkgIterator> >::insert(PackageContainer<Cont> const &pkgcont) {
+ for (typename PackageContainer<Cont>::const_iterator p = pkgcont.begin(); p != pkgcont.end(); ++p)
+ _cont.push_back(*p);
+}
// these two are 'inline' as otherwise the linker has problems with seeing these untemplated
// specializations again and again - but we need to see them, so that library users can use them
template<> inline bool PackageContainer<std::list<pkgCache::PkgIterator> >::insert(pkgCache::PkgIterator const &P) {
@@ -388,12 +545,65 @@ template<> inline bool PackageContainer<std::list<pkgCache::PkgIterator> >::inse
_cont.push_back(P);
return true;
}
+template<> inline bool PackageContainer<std::vector<pkgCache::PkgIterator> >::insert(pkgCache::PkgIterator const &P) {
+ if (P.end() == true)
+ return false;
+ _cont.push_back(P);
+ return true;
+}
template<> inline void PackageContainer<std::list<pkgCache::PkgIterator> >::insert(const_iterator begin, const_iterator end) {
for (const_iterator p = begin; p != end; ++p)
_cont.push_back(*p);
}
+template<> inline void PackageContainer<std::vector<pkgCache::PkgIterator> >::insert(const_iterator begin, const_iterator end) {
+ for (const_iterator p = begin; p != end; ++p)
+ _cont.push_back(*p);
+}
+ /*}}}*/
+
+template<> template<class Compare> inline bool PackageContainer<std::vector<pkgCache::PkgIterator> >::sort(Compare Comp) {
+ std::sort(_cont.begin(), _cont.end(), Comp);
+ return true;
+}
+
+// class PackageUniverse - pkgCache as PackageContainerInterface /*{{{*/
+/** \class PackageUniverse
+
+ Wraps around our usual pkgCache, so that it can be stuffed into methods
+ expecting a PackageContainer.
+
+ The wrapping is read-only in practice modeled by making erase and co
+ private methods. */
+class PackageUniverse : public PackageContainerInterface {
+ pkgCache * const _cont;
+public:
+ typedef pkgCache::PkgIterator iterator;
+ typedef pkgCache::PkgIterator const_iterator;
+
+ bool empty() const { return false; }
+ size_t size() const { return _cont->Head().PackageCount; }
+
+ const_iterator begin() const { return _cont->PkgBegin(); }
+ const_iterator end() const { return _cont->PkgEnd(); }
+ iterator begin() { return _cont->PkgBegin(); }
+ iterator end() { return _cont->PkgEnd(); }
+
+ PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
+
+private:
+ bool insert(pkgCache::PkgIterator const &) { return true; }
+ template<class Cont> void insert(PackageContainer<Cont> const &) { }
+ void insert(const_iterator, const_iterator) { }
+
+ void clear() { }
+ iterator& erase(iterator &iter) { return iter; }
+ size_t erase(const pkgCache::PkgIterator) { return 0; }
+ void erase(iterator, iterator) { }
+};
+ /*}}}*/
typedef PackageContainer<std::set<pkgCache::PkgIterator> > PackageSet;
typedef PackageContainer<std::list<pkgCache::PkgIterator> > PackageList;
+typedef PackageContainer<std::vector<pkgCache::PkgIterator> > PackageVector;
class VersionContainerInterface { /*{{{*/
/** \class APT::VersionContainerInterface
@@ -435,45 +645,83 @@ public:
virtual void clear() = 0;
/** \brief specifies which version(s) will be returned if non is given */
- enum Version {
- /** All versions */
- ALL,
- /** Candidate and installed version */
- CANDANDINST,
- /** Candidate version */
- CANDIDATE,
- /** Installed version */
- INSTALLED,
- /** Candidate or if non installed version */
- CANDINST,
- /** Installed or if non candidate version */
- INSTCAND,
- /** Newest version */
- NEWEST
+ enum APT_DEPRECATED Version {
+ ALL = CacheSetHelper::ALL,
+ CANDANDINST = CacheSetHelper::CANDANDINST,
+ CANDIDATE = CacheSetHelper::CANDIDATE,
+ INSTALLED = CacheSetHelper::INSTALLED,
+ CANDINST = CacheSetHelper::CANDINST,
+ INSTCAND = CacheSetHelper::INSTCAND,
+ NEWEST = CacheSetHelper::NEWEST
};
struct Modifier {
- enum Position { NONE, PREFIX, POSTFIX };
- unsigned short ID;
+ unsigned short const ID;
const char * const Alias;
- Position Pos;
- Version SelectVersion;
+ enum Position { NONE, PREFIX, POSTFIX } const Pos;
+ enum CacheSetHelper::VerSelector const SelectVersion;
Modifier (unsigned short const &id, const char * const alias, Position const &pos,
- Version const &select) : ID(id), Alias(alias), Pos(pos),
+ enum CacheSetHelper::VerSelector const select) : ID(id), Alias(alias), Pos(pos),
SelectVersion(select) {}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED Modifier(unsigned short const &id, const char * const alias, Position const &pos,
+ Version const &select) : ID(id), Alias(alias), Pos(pos),
+ SelectVersion((CacheSetHelper::VerSelector)select) {}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
};
static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache,
- const char **cmdline, Version const &fallback,
+ const char **cmdline, CacheSetHelper::VerSelector const fallback,
CacheSetHelper &helper);
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED static bool FromCommandLine(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ const char **cmdline, Version const &fallback,
+ CacheSetHelper &helper) {
+ return FromCommandLine(vci, Cache, cmdline, (CacheSetHelper::VerSelector)fallback, helper);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
static bool FromString(VersionContainerInterface * const vci, pkgCacheFile &Cache,
- std::string pkg, Version const &fallback, CacheSetHelper &helper,
+ std::string pkg, CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper,
bool const onlyFromName = false);
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED static bool FromString(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ std::string pkg, Version const &fallback, CacheSetHelper &helper,
+ bool const onlyFromName = false) {
+ return FromString(vci, Cache, pkg, (CacheSetHelper::VerSelector)fallback, helper, onlyFromName);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
static bool FromPackage(VersionContainerInterface * const vci, pkgCacheFile &Cache,
- pkgCache::PkgIterator const &P, Version const &fallback,
+ pkgCache::PkgIterator const &P, CacheSetHelper::VerSelector const fallback,
CacheSetHelper &helper);
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED static bool FromPackage(VersionContainerInterface * const vci, pkgCacheFile &Cache,
+ pkgCache::PkgIterator const &P, Version const &fallback,
+ CacheSetHelper &helper) {
+ return FromPackage(vci, Cache, P, (CacheSetHelper::VerSelector)fallback, helper);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
static bool FromModifierCommandLine(unsigned short &modID,
VersionContainerInterface * const vci,
@@ -485,8 +733,22 @@ public:
static bool FromDependency(VersionContainerInterface * const vci,
pkgCacheFile &Cache,
pkgCache::DepIterator const &D,
- Version const &selector,
+ CacheSetHelper::VerSelector const selector,
CacheSetHelper &helper);
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ APT_DEPRECATED static bool FromDependency(VersionContainerInterface * const vci,
+ pkgCacheFile &Cache,
+ pkgCache::DepIterator const &D,
+ Version const &selector,
+ CacheSetHelper &helper) {
+ return FromDependency(vci, Cache, D, (CacheSetHelper::VerSelector)selector, helper);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
protected: /*{{{*/
@@ -568,6 +830,18 @@ public: /*{{{*/
iterator end() { return iterator(_cont.end()); }
const_iterator find(pkgCache::VerIterator const &V) const { return const_iterator(_cont.find(V)); }
+ /** \brief sort all included versions with given comparer
+
+ Some containers are sorted by default, some are not and can't be,
+ but a few like std::vector can be sorted if need be, so this can be
+ specialized in later on. The default is that this will fail though.
+ Specifically, already sorted containers like std::set will return
+ false as well as there is no easy way to check that the given comparer
+ would sort in the same way the set is currently sorted
+
+ \return \b true if the set was sorted, \b false if not. */
+ template<class Compare> bool sort(Compare /*Comp*/) { return false; }
+
/** \brief returns all versions specified on the commandline
Get all versions from the commandline, uses given default version if
@@ -577,35 +851,64 @@ public: /*{{{*/
\param fallback version specification
\param helper responsible for error and message handling */
static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline,
- Version const &fallback, CacheSetHelper &helper) {
+ CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper) {
VersionContainer vercon;
VersionContainerInterface::FromCommandLine(&vercon, Cache, cmdline, fallback, helper);
return vercon;
}
static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline,
- Version const &fallback) {
+ CacheSetHelper::VerSelector const fallback) {
CacheSetHelper helper;
return FromCommandLine(Cache, cmdline, fallback, helper);
}
static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline) {
- return FromCommandLine(Cache, cmdline, CANDINST);
+ return FromCommandLine(Cache, cmdline, CacheSetHelper::CANDINST);
}
-
static VersionContainer FromString(pkgCacheFile &Cache, std::string const &pkg,
- Version const &fallback, CacheSetHelper &helper,
+ CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper,
bool const /*onlyFromName = false*/) {
VersionContainer vercon;
VersionContainerInterface::FromString(&vercon, Cache, pkg, fallback, helper);
return vercon;
}
static VersionContainer FromString(pkgCacheFile &Cache, std::string pkg,
- Version const &fallback) {
+ CacheSetHelper::VerSelector const fallback) {
CacheSetHelper helper;
return FromString(Cache, pkg, fallback, helper);
}
static VersionContainer FromString(pkgCacheFile &Cache, std::string pkg) {
- return FromString(Cache, pkg, CANDINST);
+ return FromString(Cache, pkg, CacheSetHelper::CANDINST);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline,
+ Version const &fallback, CacheSetHelper &helper) {
+ VersionContainer vercon;
+ VersionContainerInterface::FromCommandLine(&vercon, Cache, cmdline, (CacheSetHelper::VerSelector)fallback, helper);
+ return vercon;
+ }
+ static VersionContainer FromCommandLine(pkgCacheFile &Cache, const char **cmdline,
+ Version const &fallback) {
+ CacheSetHelper helper;
+ return FromCommandLine(Cache, cmdline, (CacheSetHelper::VerSelector)fallback, helper);
+ }
+ static VersionContainer FromString(pkgCacheFile &Cache, std::string const &pkg,
+ Version const &fallback, CacheSetHelper &helper,
+ bool const /*onlyFromName = false*/) {
+ VersionContainer vercon;
+ VersionContainerInterface::FromString(&vercon, Cache, pkg, (CacheSetHelper::VerSelector)fallback, helper);
+ return vercon;
+ }
+ static VersionContainer FromString(pkgCacheFile &Cache, std::string pkg,
+ Version const &fallback) {
+ CacheSetHelper helper;
+ return FromString(Cache, pkg, (CacheSetHelper::VerSelector)fallback, helper);
}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
/** \brief returns all versions specified for the package
@@ -614,18 +917,36 @@ public: /*{{{*/
\param fallback the version(s) you want to get
\param helper the helper used for display and error handling */
static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P,
- Version const &fallback, CacheSetHelper &helper) {
+ CacheSetHelper::VerSelector const fallback, CacheSetHelper &helper) {
VersionContainer vercon;
VersionContainerInterface::FromPackage(&vercon, Cache, P, fallback, helper);
return vercon;
}
static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P,
- Version const &fallback) {
+ CacheSetHelper::VerSelector const fallback) {
CacheSetHelper helper;
return FromPackage(Cache, P, fallback, helper);
}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P,
+ Version const &fallback, CacheSetHelper &helper) {
+ VersionContainer vercon;
+ VersionContainerInterface::FromPackage(&vercon, Cache, P, (CacheSetHelper::VerSelector)fallback, helper);
+ return vercon;
+ }
+ static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P,
+ Version const &fallback) {
+ CacheSetHelper helper;
+ return FromPackage(Cache, P, (CacheSetHelper::VerSelector)fallback, helper);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
static VersionContainer FromPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &P) {
- return FromPackage(Cache, P, CANDIDATE);
+ return FromPackage(Cache, P, CacheSetHelper::CANDIDATE);
}
static std::map<unsigned short, VersionContainer> GroupedFromCommandLine(
@@ -654,26 +975,48 @@ public: /*{{{*/
}
static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D,
- Version const &selector, CacheSetHelper &helper) {
+ CacheSetHelper::VerSelector const selector, CacheSetHelper &helper) {
VersionContainer vercon;
VersionContainerInterface::FromDependency(&vercon, Cache, D, selector, helper);
return vercon;
}
static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D,
- Version const &selector) {
+ CacheSetHelper::VerSelector const selector) {
CacheSetHelper helper;
return FromPackage(Cache, D, selector, helper);
}
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D,
+ Version const &selector, CacheSetHelper &helper) {
+ VersionContainer vercon;
+ VersionContainerInterface::FromDependency(&vercon, Cache, D, (CacheSetHelper::VerSelector)selector, helper);
+ return vercon;
+ }
+ static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D,
+ Version const &selector) {
+ CacheSetHelper helper;
+ return FromPackage(Cache, D, (CacheSetHelper::VerSelector)selector, helper);
+ }
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
static VersionContainer FromDependency(pkgCacheFile &Cache, pkgCache::DepIterator const &D) {
- return FromPackage(Cache, D, CANDIDATE);
+ return FromPackage(Cache, D, CacheSetHelper::CANDIDATE);
}
/*}}}*/
}; /*}}}*/
-
+// specialisations for push_back containers: std::list & std::vector /*{{{*/
template<> template<class Cont> void VersionContainer<std::list<pkgCache::VerIterator> >::insert(VersionContainer<Cont> const &vercont) {
for (typename VersionContainer<Cont>::const_iterator v = vercont.begin(); v != vercont.end(); ++v)
_cont.push_back(*v);
}
+template<> template<class Cont> void VersionContainer<std::vector<pkgCache::VerIterator> >::insert(VersionContainer<Cont> const &vercont) {
+ for (typename VersionContainer<Cont>::const_iterator v = vercont.begin(); v != vercont.end(); ++v)
+ _cont.push_back(*v);
+}
// these two are 'inline' as otherwise the linker has problems with seeing these untemplated
// specializations again and again - but we need to see them, so that library users can use them
template<> inline bool VersionContainer<std::list<pkgCache::VerIterator> >::insert(pkgCache::VerIterator const &V) {
@@ -682,11 +1025,29 @@ template<> inline bool VersionContainer<std::list<pkgCache::VerIterator> >::inse
_cont.push_back(V);
return true;
}
+template<> inline bool VersionContainer<std::vector<pkgCache::VerIterator> >::insert(pkgCache::VerIterator const &V) {
+ if (V.end() == true)
+ return false;
+ _cont.push_back(V);
+ return true;
+}
template<> inline void VersionContainer<std::list<pkgCache::VerIterator> >::insert(const_iterator begin, const_iterator end) {
for (const_iterator v = begin; v != end; ++v)
_cont.push_back(*v);
}
+template<> inline void VersionContainer<std::vector<pkgCache::VerIterator> >::insert(const_iterator begin, const_iterator end) {
+ for (const_iterator v = begin; v != end; ++v)
+ _cont.push_back(*v);
+}
+ /*}}}*/
+
+template<> template<class Compare> inline bool VersionContainer<std::vector<pkgCache::VerIterator> >::sort(Compare Comp) {
+ std::sort(_cont.begin(), _cont.end(), Comp);
+ return true;
+}
+
typedef VersionContainer<std::set<pkgCache::VerIterator> > VersionSet;
typedef VersionContainer<std::list<pkgCache::VerIterator> > VersionList;
+typedef VersionContainer<std::vector<pkgCache::VerIterator> > VersionVector;
}
#endif
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc
index a5ad6a9ff..b97f7b036 100644
--- a/apt-pkg/cdrom.cc
+++ b/apt-pkg/cdrom.cc
@@ -913,10 +913,14 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/
return true;
}
/*}}}*/
-pkgUdevCdromDevices::pkgUdevCdromDevices() /*{{{*/
- : libudev_handle(NULL)
+pkgUdevCdromDevices::pkgUdevCdromDevices() /*{{{*/
+: libudev_handle(NULL), udev_new(NULL), udev_enumerate_add_match_property(NULL),
+ udev_enumerate_scan_devices(NULL), udev_enumerate_get_list_entry(NULL),
+ udev_device_new_from_syspath(NULL), udev_enumerate_get_udev(NULL),
+ udev_list_entry_get_name(NULL), udev_device_get_devnode(NULL),
+ udev_enumerate_new(NULL), udev_list_entry_get_next(NULL),
+ udev_device_get_property_value(NULL), udev_enumerate_add_match_sysattr(NULL)
{
-
}
/*}}}*/
diff --git a/apt-pkg/contrib/cmndline.cc b/apt-pkg/contrib/cmndline.cc
index 3799c822d..93c1f4664 100644
--- a/apt-pkg/contrib/cmndline.cc
+++ b/apt-pkg/contrib/cmndline.cc
@@ -47,23 +47,26 @@ CommandLine::~CommandLine()
char const * CommandLine::GetCommand(Dispatch const * const Map,
unsigned int const argc, char const * const * const argv)
{
- // if there is a -- on the line there must be the word we search for around it
- // as -- marks the end of the options, just not sure if the command can be
- // considered an option or not, so accept both
+ // if there is a -- on the line there must be the word we search for either
+ // before it (as -- marks the end of the options) or right after it (as we can't
+ // decide if the command is actually an option, given that in theory, you could
+ // have parameters named like commands)
for (size_t i = 1; i < argc; ++i)
{
if (strcmp(argv[i], "--") != 0)
continue;
- ++i;
- if (i < argc)
+ // check if command is before --
+ for (size_t k = 1; k < i; ++k)
for (size_t j = 0; Map[j].Match != NULL; ++j)
- if (strcmp(argv[i], Map[j].Match) == 0)
+ if (strcmp(argv[k], Map[j].Match) == 0)
return Map[j].Match;
- i -= 2;
- if (i != 0)
+ // see if the next token after -- is the command
+ ++i;
+ if (i < argc)
for (size_t j = 0; Map[j].Match != NULL; ++j)
if (strcmp(argv[i], Map[j].Match) == 0)
return Map[j].Match;
+ // we found a --, but not a command
return NULL;
}
// no --, so search for the first word matching a command
diff --git a/apt-pkg/contrib/fileutl.cc b/apt-pkg/contrib/fileutl.cc
index e81f32a52..df409fa36 100644
--- a/apt-pkg/contrib/fileutl.cc
+++ b/apt-pkg/contrib/fileutl.cc
@@ -896,7 +896,7 @@ class FileFdPrivate { /*{{{*/
bool eof;
bool compressing;
- LZMAFILE() : file(NULL), eof(false), compressing(false) {}
+ LZMAFILE() : file(NULL), eof(false), compressing(false) { buffer[0] = '\0'; }
~LZMAFILE() {
if (compressing == true)
{
@@ -2126,10 +2126,8 @@ bool Popen(const char* Args[], FileFd &Fd, pid_t &Child, FileFd::OpenMode Mode)
int Pipe[2] = {-1, -1};
if(pipe(Pipe) != 0)
- {
return _error->Errno("pipe", _("Failed to create subprocess IPC"));
- return NULL;
- }
+
std::set<int> keep_fds;
keep_fds.insert(Pipe[0]);
keep_fds.insert(Pipe[1]);
diff --git a/apt-pkg/contrib/gpgv.cc b/apt-pkg/contrib/gpgv.cc
index f24dd9640..9d798cca9 100644
--- a/apt-pkg/contrib/gpgv.cc
+++ b/apt-pkg/contrib/gpgv.cc
@@ -32,50 +32,30 @@ static char * GenerateTemporaryFileTemplate(const char *basename) /*{{{*/
/*}}}*/
// ExecGPGV - returns the command needed for verify /*{{{*/
// ---------------------------------------------------------------------
-/* Generating the commandline for calling gpgv is somehow complicated as
+/* Generating the commandline for calling gpg is somehow complicated as
we need to add multiple keyrings and user supplied options.
- Also, as gpgv has no options to enforce a certain reduced style of
+ Also, as gpg has no options to enforce a certain reduced style of
clear-signed files (=the complete content of the file is signed and
the content isn't encoded) we do a divide and conquer approach here
- and split up the clear-signed file in message and signature for gpgv
+ and split up the clear-signed file in message and signature for gpg.
+ And as a cherry on the cake, we use our apt-key wrapper to do part
+ of the lifting in regards to merging keyrings. Fun for the whole family.
*/
void ExecGPGV(std::string const &File, std::string const &FileGPG,
int const &statusfd, int fd[2])
{
#define EINTERNAL 111
- std::string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv");
- // FIXME: remove support for deprecated APT::GPGV setting
- std::string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted"));
- std::string const trustedPath = _config->FindDir("Dir::Etc::TrustedParts");
+ std::string const aptkey = _config->FindFile("Dir::Bin::apt-key", "/usr/bin/apt-key");
bool const Debug = _config->FindB("Debug::Acquire::gpgv", false);
- if (Debug == true)
- {
- std::clog << "gpgv path: " << gpgvpath << std::endl;
- std::clog << "Keyring file: " << trustedFile << std::endl;
- std::clog << "Keyring path: " << trustedPath << std::endl;
- }
-
- std::vector<std::string> keyrings;
- if (DirectoryExists(trustedPath))
- keyrings = GetListOfFilesInDir(trustedPath, "gpg", false, true);
- if (RealFileExists(trustedFile) == true)
- keyrings.push_back(trustedFile);
-
std::vector<const char *> Args;
- Args.reserve(30);
-
- if (keyrings.empty() == true)
- {
- // TRANSLATOR: %s is the trusted keyring parts directory
- ioprintf(std::cerr, _("No keyring installed in %s."),
- _config->FindDir("Dir::Etc::TrustedParts").c_str());
- exit(EINTERNAL);
- }
+ Args.reserve(10);
- Args.push_back(gpgvpath.c_str());
- Args.push_back("--ignore-time-conflict");
+ Args.push_back(aptkey.c_str());
+ Args.push_back("--quiet");
+ Args.push_back("--readonly");
+ Args.push_back("verify");
char statusfdstr[10];
if (statusfd != -1)
@@ -85,13 +65,6 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
Args.push_back(statusfdstr);
}
- for (std::vector<std::string>::const_iterator K = keyrings.begin();
- K != keyrings.end(); ++K)
- {
- Args.push_back("--keyring");
- Args.push_back(K->c_str());
- }
-
Configuration::Item const *Opts;
Opts = _config->Tree("Acquire::gpgv::Options");
if (Opts != 0)
@@ -160,7 +133,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
if (Debug == true)
{
- std::clog << "Preparing to exec: " << gpgvpath;
+ std::clog << "Preparing to exec: ";
for (std::vector<const char *>::const_iterator a = Args.begin(); *a != NULL; ++a)
std::clog << " " << *a;
std::clog << std::endl;
@@ -168,7 +141,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
if (statusfd != -1)
{
- int const nullfd = open("/dev/null", O_RDONLY);
+ int const nullfd = open("/dev/null", O_WRONLY);
close(fd[0]);
// Redirect output to /dev/null; we read from the status fd
if (statusfd != STDOUT_FILENO)
@@ -185,7 +158,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
if (releaseSignature == DETACHED)
{
- execvp(gpgvpath.c_str(), (char **) &Args[0]);
+ execvp(Args[0], (char **) &Args[0]);
ioprintf(std::cerr, "Couldn't execute %s to check %s", Args[0], File.c_str());
exit(EINTERNAL);
}
@@ -205,7 +178,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
{
if (statusfd != -1)
dup2(fd[1], statusfd);
- execvp(gpgvpath.c_str(), (char **) &Args[0]);
+ execvp(Args[0], (char **) &Args[0]);
ioprintf(std::cerr, "Couldn't execute %s to check %s", Args[0], File.c_str());
UNLINK_EXIT(EINTERNAL);
}
@@ -216,7 +189,7 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
{
if (errno == EINTR)
continue;
- ioprintf(std::cerr, _("Waited for %s but it wasn't there"), "gpgv");
+ ioprintf(std::cerr, _("Waited for %s but it wasn't there"), "apt-key");
UNLINK_EXIT(EINTERNAL);
}
#undef UNLINK_EXIT
@@ -229,14 +202,14 @@ void ExecGPGV(std::string const &File, std::string const &FileGPG,
// check if it exit'ed normally …
if (WIFEXITED(Status) == false)
{
- ioprintf(std::cerr, _("Sub-process %s exited unexpectedly"), "gpgv");
+ ioprintf(std::cerr, _("Sub-process %s exited unexpectedly"), "apt-key");
exit(EINTERNAL);
}
// … and with a good exit code
if (WEXITSTATUS(Status) != 0)
{
- ioprintf(std::cerr, _("Sub-process %s returned an error code (%u)"), "gpgv", WEXITSTATUS(Status));
+ ioprintf(std::cerr, _("Sub-process %s returned an error code (%u)"), "apt-key", WEXITSTATUS(Status));
exit(WEXITSTATUS(Status));
}
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index feda8d0d8..f90731dd2 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -81,14 +81,18 @@ pkgSrcRecords::Parser *debSourcesIndex::CreateSrcParser() const
{
string SourcesURI = _config->FindDir("Dir::State::lists") +
URItoFileName(IndexURI("Sources"));
- string SourcesURIgzip = SourcesURI + ".gz";
- if (!FileExists(SourcesURI) && !FileExists(SourcesURIgzip))
- return NULL;
- else if (!FileExists(SourcesURI) && FileExists(SourcesURIgzip))
- SourcesURI = SourcesURIgzip;
-
- return new debSrcRecordParser(SourcesURI,this);
+ std::vector<std::string> types = APT::Configuration::getCompressionTypes();
+ for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t)
+ {
+ string p;
+ p = SourcesURI + '.' + *t;
+ if (FileExists(p))
+ return new debSrcRecordParser(p, this);
+ }
+ if (FileExists(SourcesURI))
+ return new debSrcRecordParser(SourcesURI, this);
+ return NULL;
}
/*}}}*/
// SourcesIndex::Describe - Give a descriptive path to the index /*{{{*/
@@ -130,11 +134,15 @@ string debSourcesIndex::Info(const char *Type) const
inline string debSourcesIndex::IndexFile(const char *Type) const
{
string s = URItoFileName(IndexURI(Type));
- string sgzip = s + ".gz";
- if (!FileExists(s) && FileExists(sgzip))
- return sgzip;
- else
- return s;
+
+ std::vector<std::string> types = APT::Configuration::getCompressionTypes();
+ for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t)
+ {
+ string p = s + '.' + *t;
+ if (FileExists(p))
+ return p;
+ }
+ return s;
}
string debSourcesIndex::IndexURI(const char *Type) const
@@ -260,11 +268,15 @@ string debPackagesIndex::Info(const char *Type) const
inline string debPackagesIndex::IndexFile(const char *Type) const
{
string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
- string sgzip = s + ".gz";
- if (!FileExists(s) && FileExists(sgzip))
- return sgzip;
- else
- return s;
+
+ std::vector<std::string> types = APT::Configuration::getCompressionTypes();
+ for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t)
+ {
+ string p = s + '.' + *t;
+ if (FileExists(p))
+ return p;
+ }
+ return s;
}
string debPackagesIndex::IndexURI(const char *Type) const
{
@@ -412,11 +424,15 @@ debTranslationsIndex::debTranslationsIndex(string URI,string Dist,string Section
inline string debTranslationsIndex::IndexFile(const char *Type) const
{
string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
- string sgzip = s + ".gz";
- if (!FileExists(s) && FileExists(sgzip))
- return sgzip;
- else
- return s;
+
+ std::vector<std::string> types = APT::Configuration::getCompressionTypes();
+ for (std::vector<std::string>::const_iterator t = types.begin(); t != types.end(); ++t)
+ {
+ string p = s + '.' + *t;
+ if (FileExists(p))
+ return p;
+ }
+ return s;
}
string debTranslationsIndex::IndexURI(const char *Type) const
{
@@ -619,7 +635,7 @@ bool debStatusIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
pkgCache::PkgFileIterator CFile = Gen.GetCurFile();
CFile->Size = Pkg.FileSize();
CFile->mtime = Pkg.ModificationTime();
- map_stringitem_t const storage = Gen.WriteUniqString("now");
+ map_stringitem_t const storage = Gen.StoreString(pkgCacheGenerator::MIXED, "now");
CFile->Archive = storage;
if (Gen.MergeList(Parser) == false)
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index 3e0d3a791..103b126de 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -58,18 +58,6 @@ debListParser::debListParser(FileFd *File, string const &Arch) : Tags(File),
MultiArchEnabled = Architectures.size() > 1;
}
/*}}}*/
-// ListParser::UniqFindTagWrite - Find the tag and write a unq string /*{{{*/
-// ---------------------------------------------------------------------
-/* */
-map_stringitem_t debListParser::UniqFindTagWrite(const char *Tag)
-{
- const char *Start;
- const char *Stop;
- if (Section.Find(Tag,Start,Stop) == false)
- return 0;
- return WriteUniqString(Start,Stop - Start);
-}
- /*}}}*/
// ListParser::Package - Return the package name /*{{{*/
// ---------------------------------------------------------------------
/* This is to return the name of the package this section describes */
@@ -144,9 +132,67 @@ unsigned char debListParser::ParseMultiArch(bool const showErrors) /*{{{*/
/* */
bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
{
+ const char *Start;
+ const char *Stop;
+
// Parse the section
- unsigned long const idxSection = UniqFindTagWrite("Section");
- Ver->Section = idxSection;
+ if (Section.Find("Section",Start,Stop) == true)
+ {
+ map_stringitem_t const idx = StoreString(pkgCacheGenerator::SECTION, Start, Stop - Start);
+ Ver->Section = idx;
+ }
+ // Parse the source package name
+ pkgCache::GrpIterator const G = Ver.ParentPkg().Group();
+ Ver->SourcePkgName = G->Name;
+ Ver->SourceVerStr = Ver->VerStr;
+ if (Section.Find("Source",Start,Stop) == true)
+ {
+ const char * const Space = (const char * const) memchr(Start, ' ', Stop - Start);
+ pkgCache::VerIterator V;
+
+ if (Space != NULL)
+ {
+ Stop = Space;
+ const char * const Open = (const char * const) memchr(Space, '(', Stop - Space);
+ if (likely(Open != NULL))
+ {
+ const char * const Close = (const char * const) memchr(Open, ')', Stop - Open);
+ if (likely(Close != NULL))
+ {
+ std::string const version(Open + 1, (Close - Open) - 1);
+ if (version != Ver.VerStr())
+ {
+ map_stringitem_t const idx = StoreString(pkgCacheGenerator::VERSION, version);
+ Ver->SourceVerStr = idx;
+ }
+ }
+ }
+ }
+
+ std::string const pkgname(Start, Stop - Start);
+ if (pkgname != G.Name())
+ {
+ for (pkgCache::PkgIterator P = G.PackageList(); P.end() == false; P = G.NextPkg(P))
+ {
+ for (V = P.VersionList(); V.end() == false; ++V)
+ {
+ if (pkgname == V.SourcePkgName())
+ {
+ Ver->SourcePkgName = V->SourcePkgName;
+ break;
+ }
+ }
+ if (V.end() == false)
+ break;
+ }
+ if (V.end() == true)
+ {
+ map_stringitem_t const idx = StoreString(pkgCacheGenerator::PKGNAME, pkgname);
+ Ver->SourcePkgName = idx;
+ }
+ }
+ }
+
Ver->MultiArch = ParseMultiArch(true);
// Archive Size
Ver->Size = Section.FindULL("Size");
@@ -155,10 +201,8 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
Ver->InstalledSize *= 1024;
// Priority
- const char *Start;
- const char *Stop;
if (Section.Find("Priority",Start,Stop) == true)
- {
+ {
if (GrabWord(string(Start,Stop-Start),PrioList,Ver->Priority) == false)
Ver->Priority = pkgCache::State::Extra;
}
@@ -891,7 +935,7 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
{
// apt-secure does no longer download individual (per-section) Release
// file. to provide Component pinning we use the section name now
- map_stringitem_t const storage = WriteUniqString(component);
+ map_stringitem_t const storage = StoreString(pkgCacheGenerator::MIXED, component);
FileI->Component = storage;
pkgTagFile TagFile(&File, File.Size());
@@ -900,19 +944,19 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
return false;
std::string data;
- #define APT_INRELEASE(TAG, STORE) \
+ #define APT_INRELEASE(TYPE, TAG, STORE) \
data = Section.FindS(TAG); \
if (data.empty() == false) \
{ \
- map_stringitem_t const storage = WriteUniqString(data); \
+ map_stringitem_t const storage = StoreString(pkgCacheGenerator::TYPE, data); \
STORE = storage; \
}
- APT_INRELEASE("Suite", FileI->Archive)
- APT_INRELEASE("Component", FileI->Component)
- APT_INRELEASE("Version", FileI->Version)
- APT_INRELEASE("Origin", FileI->Origin)
- APT_INRELEASE("Codename", FileI->Codename)
- APT_INRELEASE("Label", FileI->Label)
+ APT_INRELEASE(MIXED, "Suite", FileI->Archive)
+ APT_INRELEASE(MIXED, "Component", FileI->Component)
+ APT_INRELEASE(VERSION, "Version", FileI->Version)
+ APT_INRELEASE(MIXED, "Origin", FileI->Origin)
+ APT_INRELEASE(MIXED, "Codename", FileI->Codename)
+ APT_INRELEASE(MIXED, "Label", FileI->Label)
#undef APT_INRELEASE
Section.FindFlag("NotAutomatic", FileI->Flags, pkgCache::Flag::NotAutomatic);
Section.FindFlag("ButAutomaticUpgrades", FileI->Flags, pkgCache::Flag::ButAutomaticUpgrades);
diff --git a/apt-pkg/deb/deblistparser.h b/apt-pkg/deb/deblistparser.h
index f5ac47e1e..b55e57d41 100644
--- a/apt-pkg/deb/deblistparser.h
+++ b/apt-pkg/deb/deblistparser.h
@@ -49,7 +49,6 @@ class debListParser : public pkgCacheGenerator::ListParser
std::vector<std::string> Architectures;
bool MultiArchEnabled;
- map_stringitem_t UniqFindTagWrite(const char *Tag);
virtual bool ParseStatus(pkgCache::PkgIterator &Pkg,pkgCache::VerIterator &Ver);
bool ParseDepends(pkgCache::VerIterator &Ver,const char *Tag,
unsigned int Type);
diff --git a/apt-pkg/deb/dpkgpm.cc b/apt-pkg/deb/dpkgpm.cc
index a5c05d5ea..95fae9a28 100644
--- a/apt-pkg/deb/dpkgpm.cc
+++ b/apt-pkg/deb/dpkgpm.cc
@@ -1754,11 +1754,6 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
if (Ver.end() == true)
return;
pkgver = Ver.VerStr() == NULL ? "unknown" : Ver.VerStr();
- pkgRecords Recs(Cache);
- pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList());
- srcpkgname = Parse.SourcePkg();
- if(srcpkgname.empty())
- srcpkgname = pkgname;
// if the file exists already, we check:
// - if it was reported already (touched by apport).
@@ -1809,7 +1804,7 @@ void pkgDPkgPM::WriteApportReport(const char *pkgpath, const char *errormsg)
time_t now = time(NULL);
fprintf(report, "Date: %s" , ctime(&now));
fprintf(report, "Package: %s %s\n", pkgname.c_str(), pkgver.c_str());
- fprintf(report, "SourcePackage: %s\n", srcpkgname.c_str());
+ fprintf(report, "SourcePackage: %s\n", Ver.SourcePkgName());
fprintf(report, "ErrorMessage:\n %s\n", errormsg);
// ensure that the log is flushed
diff --git a/apt-pkg/edsp.cc b/apt-pkg/edsp.cc
index 0d0418e06..2ba914b16 100644
--- a/apt-pkg/edsp.cc
+++ b/apt-pkg/edsp.cc
@@ -95,12 +95,8 @@ bool EDSP::WriteLimitedScenario(pkgDepCache &Cache, FILE* output,
void EDSP::WriteScenarioVersion(pkgDepCache &Cache, FILE* output, pkgCache::PkgIterator const &Pkg,
pkgCache::VerIterator const &Ver)
{
- pkgRecords Recs(Cache);
- pkgRecords::Parser &rec = Recs.Lookup(Ver.FileList());
- string srcpkg = rec.SourcePkg().empty() ? Pkg.Name() : rec.SourcePkg();
-
fprintf(output, "Package: %s\n", Pkg.Name());
- fprintf(output, "Source: %s\n", srcpkg.c_str());
+ fprintf(output, "Source: %s\n", Ver.SourcePkgName());
fprintf(output, "Architecture: %s\n", Ver.Arch());
fprintf(output, "Version: %s\n", Ver.VerStr());
if (Pkg.CurrentVer() == Ver)
diff --git a/apt-pkg/edsp/edspindexfile.cc b/apt-pkg/edsp/edspindexfile.cc
index e013dd44c..c38f24567 100644
--- a/apt-pkg/edsp/edspindexfile.cc
+++ b/apt-pkg/edsp/edspindexfile.cc
@@ -56,7 +56,7 @@ bool edspIndex::Merge(pkgCacheGenerator &Gen,OpProgress *Prog) const
pkgCache::PkgFileIterator CFile = Gen.GetCurFile();
CFile->Size = Pkg.FileSize();
CFile->mtime = Pkg.ModificationTime();
- map_stringitem_t const storage = Gen.WriteUniqString("edsp::scenario");
+ map_stringitem_t const storage = Gen.StoreString(pkgCacheGenerator::MIXED, "edsp::scenario");
CFile->Archive = storage;
if (Gen.MergeList(Parser) == false)
diff --git a/apt-pkg/install-progress.cc b/apt-pkg/install-progress.cc
index cf6c85912..0d180d59b 100644
--- a/apt-pkg/install-progress.cc
+++ b/apt-pkg/install-progress.cc
@@ -21,6 +21,8 @@
namespace APT {
namespace Progress {
+PackageManager::PackageManager() : d(NULL), percentage(0.0), last_reported_progress(-1) {};
+PackageManager::~PackageManager() {};
/* Return a APT::Progress::PackageManager based on the global
* apt configuration (i.e. APT::Status-Fd and APT::Status-deb822-Fd)
diff --git a/apt-pkg/install-progress.h b/apt-pkg/install-progress.h
index 5d1a20e9b..912700e8d 100644
--- a/apt-pkg/install-progress.h
+++ b/apt-pkg/install-progress.h
@@ -26,9 +26,8 @@ namespace Progress {
int last_reported_progress;
public:
- PackageManager()
- : percentage(0.0), last_reported_progress(-1) {};
- virtual ~PackageManager() {};
+ PackageManager();
+ virtual ~PackageManager();
/* Global Start/Stop */
virtual void Start(int /*child_pty*/=-1) {};
diff --git a/apt-pkg/metaindex.h b/apt-pkg/metaindex.h
index ffabaadbf..7c4d0c1aa 100644
--- a/apt-pkg/metaindex.h
+++ b/apt-pkg/metaindex.h
@@ -53,7 +53,7 @@ class metaIndex
metaIndex(std::string const &URI, std::string const &Dist,
char const * const Type)
- : Indexes(NULL), Type(Type), URI(URI), Dist(Dist)
+ : Indexes(NULL), Type(Type), URI(URI), Dist(Dist), Trusted(false)
{
/* nothing */
}
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index e4cd1dc3b..101912f9d 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -1080,7 +1080,7 @@ pkgPackageManager::DoInstallPostFork(APT::Progress::PackageManager *progress)
return Failed;
return Res;
-};
+}
#else
pkgPackageManager::OrderResult
pkgPackageManager::DoInstallPostFork(int statusFd)
diff --git a/apt-pkg/packagemanager.h b/apt-pkg/packagemanager.h
index 4972dcd04..5bcd2045d 100644
--- a/apt-pkg/packagemanager.h
+++ b/apt-pkg/packagemanager.h
@@ -47,8 +47,8 @@ class pkgRecords;
namespace APT {
namespace Progress {
class PackageManager;
- };
-};
+ }
+}
class pkgPackageManager : protected pkgCache::Namespace
diff --git a/apt-pkg/pkgcache.cc b/apt-pkg/pkgcache.cc
index b1ed0129d..572685ba5 100644
--- a/apt-pkg/pkgcache.cc
+++ b/apt-pkg/pkgcache.cc
@@ -82,9 +82,9 @@ pkgCache::Header::Header()
MaxDescFileSize = 0;
FileList = 0;
- StringList = 0;
VerSysName = 0;
Architecture = 0;
+ Architectures = 0;
HashTableSize = _config->FindI("APT::Cache-HashTableSize", 10 * 1048);
memset(Pools,0,sizeof(Pools));
@@ -140,7 +140,6 @@ bool pkgCache::ReMap(bool const &Errorchecks)
DescP = (Description *)Map.Data();
ProvideP = (Provides *)Map.Data();
DepP = (Dependency *)Map.Data();
- StringItemP = (StringItem *)Map.Data();
StrP = (char *)Map.Data();
if (Errorchecks == false)
@@ -215,10 +214,7 @@ pkgCache::PkgIterator pkgCache::SingleArchFindPkg(const string &Name)
Package *Pkg = PkgP + HeaderP->PkgHashTable()[Hash(Name)];
for (; Pkg != PkgP; Pkg = PkgP + Pkg->Next)
{
- if (unlikely(Pkg->Name == 0))
- continue;
-
- int const cmp = strcasecmp(Name.c_str(), StrP + Pkg->Name);
+ int const cmp = strcmp(Name.c_str(), StrP + (GrpP + Pkg->Group)->Name);
if (cmp == 0)
return PkgIterator(*this, Pkg);
else if (cmp < 0)
@@ -279,10 +275,7 @@ pkgCache::GrpIterator pkgCache::FindGrp(const string &Name) {
// Look at the hash bucket for the group
Group *Grp = GrpP + HeaderP->GrpHashTable()[sHash(Name)];
for (; Grp != GrpP; Grp = GrpP + Grp->Next) {
- if (unlikely(Grp->Name == 0))
- continue;
-
- int const cmp = strcasecmp(Name.c_str(), StrP + Grp->Name);
+ int const cmp = strcmp(Name.c_str(), StrP + Grp->Name);
if (cmp == 0)
return GrpIterator(*this, Grp);
else if (cmp < 0)
@@ -359,19 +352,15 @@ pkgCache::PkgIterator pkgCache::GrpIterator::FindPkg(string Arch) const {
last one we check, so we do it now. */
if (Arch == "native" || Arch == myArch || Arch == "all") {
pkgCache::Package *Pkg = Owner->PkgP + S->LastPackage;
- if (strcasecmp(myArch, Owner->StrP + Pkg->Arch) == 0)
+ if (strcmp(myArch, Owner->StrP + Pkg->Arch) == 0)
return PkgIterator(*Owner, Pkg);
Arch = myArch;
}
- /* Iterate over the list to find the matching arch
- unfortunately this list includes "package noise"
- (= different packages with same calculated hash),
- so we need to check the name also */
+ // Iterate over the list to find the matching arch
for (pkgCache::Package *Pkg = PackageList(); Pkg != Owner->PkgP;
Pkg = Owner->PkgP + Pkg->Next) {
- if (S->Name == Pkg->Name &&
- stringcasecmp(Arch, Owner->StrP + Pkg->Arch) == 0)
+ if (stringcmp(Arch, Owner->StrP + Pkg->Arch) == 0)
return PkgIterator(*Owner, Pkg);
if ((Owner->PkgP + S->LastPackage) == Pkg)
break;
@@ -1037,7 +1026,7 @@ bool pkgCache::PrvIterator::IsMultiArchImplicit() const
{
pkgCache::PkgIterator const Owner = OwnerPkg();
pkgCache::PkgIterator const Parent = ParentPkg();
- if (strcmp(Owner.Arch(), Parent.Arch()) != 0 || Owner->Name == Parent->Name)
+ if (strcmp(Owner.Arch(), Parent.Arch()) != 0 || Owner.Group()->Name == Parent.Group()->Name)
return true;
return false;
}
diff --git a/apt-pkg/pkgcache.h b/apt-pkg/pkgcache.h
index 0ce2a2878..6a89eabd7 100644
--- a/apt-pkg/pkgcache.h
+++ b/apt-pkg/pkgcache.h
@@ -109,7 +109,6 @@ class pkgCache /*{{{*/
struct Description;
struct Provides;
struct Dependency;
- struct StringItem;
struct VerFile;
struct DescFile;
@@ -186,7 +185,6 @@ class pkgCache /*{{{*/
Description *DescP;
Provides *ProvideP;
Dependency *DepP;
- StringItem *StringItemP;
char *StrP;
virtual bool ReMap(bool const &Errorchecks = true);
@@ -290,12 +288,6 @@ struct pkgCache::Header
The PackageFile structures are singly linked lists that represent
all package files that have been merged into the cache. */
map_pointer_t FileList;
- /** \brief index of the first StringItem structure
-
- The cache contains a list of all the unique strings (StringItems).
- The parser reads this list into memory so it can match strings
- against it.*/
- map_pointer_t StringList;
/** \brief String representing the version system used */
map_pointer_t VerSysName;
/** \brief native architecture the cache was built against */
@@ -376,8 +368,11 @@ struct pkgCache::Group
*/
struct pkgCache::Package
{
- /** \brief Name of the package */
- map_stringitem_t Name;
+ /** \brief Name of the package
+ * Note that the access method Name() will remain. It is just this data member
+ * deprecated as this information is already stored and available via the
+ * associated Group – so it is wasting precious binary cache space */
+ APT_DEPRECATED map_stringitem_t Name;
/** \brief Architecture of the package */
map_stringitem_t Arch;
/** \brief Base of a singly linked list of versions
@@ -435,7 +430,7 @@ struct pkgCache::Package
struct pkgCache::PackageFile
{
/** \brief physical disk file that this PackageFile represents */
- map_pointer_t FileName; // StringItem
+ map_stringitem_t FileName;
/** \brief the release information
Please see the files document for a description of what the
@@ -515,6 +510,12 @@ struct pkgCache::Version
map_stringitem_t VerStr;
/** \brief section this version is filled in */
map_stringitem_t Section;
+ /** \brief source package name this version comes from
+ Always contains the name, even if it is the same as the binary name */
+ map_stringitem_t SourcePkgName;
+ /** \brief source version this version comes from
+ Always contains the version string, even if it is the same as the binary version */
+ map_stringitem_t SourceVerStr;
/** \brief Multi-Arch capabilities of a package version */
enum VerMultiArch { None = 0, /*!< is the default and doesn't trigger special behaviour */
@@ -603,7 +604,7 @@ struct pkgCache::Description
struct pkgCache::Dependency
{
/** \brief string of the version the dependency is applied against */
- map_stringitem_t Version; // StringItem
+ map_stringitem_t Version;
/** \brief index of the package this depends applies to
The generator will - if the package does not already exist -
@@ -653,24 +654,6 @@ struct pkgCache::Provides
map_pointer_t NextPkgProv; // Provides
};
/*}}}*/
-// StringItem structure /*{{{*/
-/** \brief used for generating single instances of strings
-
- Some things like Section Name are are useful to have as unique tags.
- It is part of a linked list based at pkgCache::Header::StringList
-
- All strings are simply inlined any place in the file that is natural
- for the writer. The client should make no assumptions about the positioning
- of strings. All StringItems should be null-terminated. */
-struct pkgCache::StringItem
-{
- /** \brief string this refers to */
- map_stringitem_t String;
- /** \brief Next link in the chain */
- map_stringitem_t NextItem;
-};
- /*}}}*/
-
inline char const * pkgCache::NativeArch()
{ return StrP + HeaderP->Architecture; }
diff --git a/apt-pkg/pkgcachegen.cc b/apt-pkg/pkgcachegen.cc
index a4d5d8783..6bb246e9f 100644
--- a/apt-pkg/pkgcachegen.cc
+++ b/apt-pkg/pkgcachegen.cc
@@ -57,8 +57,7 @@ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) :
FoundFileDeps(0)
{
CurrentFile = 0;
- memset(UniqHash,0,sizeof(UniqHash));
-
+
if (_error->PendingError() == true)
return;
@@ -82,9 +81,7 @@ pkgCacheGenerator::pkgCacheGenerator(DynamicMMap *pMap,OpProgress *Prog) :
if (unlikely(idxVerSysName == 0))
return;
Cache.HeaderP->VerSysName = idxVerSysName;
- // this pointer is set in ReMap, but we need it now for WriteUniqString
- Cache.StringItemP = (pkgCache::StringItem *)Map.Data();
- map_stringitem_t const idxArchitecture = WriteUniqString(_config->Find("APT::Architecture"));
+ map_stringitem_t const idxArchitecture = StoreString(MIXED, _config->Find("APT::Architecture"));
if (unlikely(idxArchitecture == 0))
return;
Cache.HeaderP->Architecture = idxArchitecture;
@@ -149,10 +146,6 @@ void pkgCacheGenerator::ReMap(void const * const oldMap, void const * const newM
CurrentFile += (pkgCache::PackageFile const * const) newMap - (pkgCache::PackageFile const * const) oldMap;
- for (size_t i = 0; i < _count(UniqHash); ++i)
- if (UniqHash[i] != 0)
- UniqHash[i] += (pkgCache::StringItem const * const) newMap - (pkgCache::StringItem const * const) oldMap;
-
for (std::vector<pkgCache::GrpIterator*>::const_iterator i = Dynamic<pkgCache::GrpIterator>::toReMap.begin();
i != Dynamic<pkgCache::GrpIterator>::toReMap.end(); ++i)
(*i)->ReMap(oldMap, newMap);
@@ -369,7 +362,7 @@ bool pkgCacheGenerator::MergeListVersion(ListParser &List, pkgCache::PkgIterator
/* We know the list is sorted so we use that fact in the search.
Insertion of new versions is done with correct sorting */
int Res = 1;
- for (; Ver.end() == false; LastVer = &Ver->NextVer, Ver++)
+ for (; Ver.end() == false; LastVer = &Ver->NextVer, ++Ver)
{
Res = Cache.VS->CmpVersion(Version,Ver.VerStr());
// Version is higher as current version - insert here
@@ -616,7 +609,7 @@ bool pkgCacheGenerator::NewGroup(pkgCache::GrpIterator &Grp, const string &Name)
return false;
Grp = pkgCache::GrpIterator(Cache, Cache.GrpP + Group);
- map_pointer_t const idxName = WriteStringInMap(Name);
+ map_stringitem_t const idxName = StoreString(PKGNAME, Name);
if (unlikely(idxName == 0))
return false;
Grp->Name = idxName;
@@ -660,7 +653,7 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name
// Insert it into the hash table
map_id_t const Hash = Cache.Hash(Name);
map_pointer_t *insertAt = &Cache.HeaderP->PkgHashTable()[Hash];
- while (*insertAt != 0 && strcasecmp(Name.c_str(), Cache.StrP + (Cache.PkgP + *insertAt)->Name) > 0)
+ while (*insertAt != 0 && strcasecmp(Name.c_str(), Cache.StrP + (Cache.GrpP + (Cache.PkgP + *insertAt)->Group)->Name) > 0)
insertAt = &(Cache.PkgP + *insertAt)->Next;
Pkg->Next = *insertAt;
*insertAt = Package;
@@ -675,10 +668,17 @@ bool pkgCacheGenerator::NewPackage(pkgCache::PkgIterator &Pkg,const string &Name
Grp->LastPackage = Package;
// Set the name, arch and the ID
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
Pkg->Name = Grp->Name;
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
Pkg->Group = Grp.Index();
// all is mapped to the native architecture
- map_stringitem_t const idxArch = (Arch == "all") ? Cache.HeaderP->Architecture : WriteUniqString(Arch.c_str());
+ map_stringitem_t const idxArch = (Arch == "all") ? Cache.HeaderP->Architecture : StoreString(MIXED, Arch);
if (unlikely(idxArch == 0))
return false;
Pkg->Arch = idxArch;
@@ -836,7 +836,7 @@ map_pointer_t pkgCacheGenerator::NewVersion(pkgCache::VerIterator &Ver,
}
}
// haven't found the version string, so create
- map_stringitem_t const idxVerStr = WriteStringInMap(VerStr);
+ map_stringitem_t const idxVerStr = StoreString(VERSION, VerStr);
if (unlikely(idxVerStr == 0))
return 0;
Ver->VerStr = idxVerStr;
@@ -893,7 +893,7 @@ map_pointer_t pkgCacheGenerator::NewDescription(pkgCache::DescIterator &Desc,
// Fill it in
Desc = pkgCache::DescIterator(Cache,Cache.DescP + Description);
Desc->ID = Cache.HeaderP->DescriptionCount++;
- map_stringitem_t const idxlanguage_code = WriteUniqString(Lang);
+ map_stringitem_t const idxlanguage_code = StoreString(MIXED, Lang);
if (unlikely(idxlanguage_code == 0))
return 0;
Desc->language_code = idxlanguage_code;
@@ -933,7 +933,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg,
if (index == 0)
{
void const * const oldMap = Map.Data();
- index = WriteStringInMap(Version);
+ index = StoreString(VERSION, Version);
if (unlikely(index == 0))
return false;
if (OldDepLast != 0 && oldMap != Map.Data())
@@ -1095,7 +1095,7 @@ bool pkgCacheGenerator::SelectFile(const string &File,const string &Site,
// Fill it in
map_stringitem_t const idxFileName = WriteStringInMap(File);
- map_stringitem_t const idxSite = WriteUniqString(Site);
+ map_stringitem_t const idxSite = StoreString(MIXED, Site);
if (unlikely(idxFileName == 0 || idxSite == 0))
return false;
CurrentFile->FileName = idxFileName;
@@ -1103,7 +1103,7 @@ bool pkgCacheGenerator::SelectFile(const string &File,const string &Site,
CurrentFile->NextFile = Cache.HeaderP->FileList;
CurrentFile->Flags = Flags;
CurrentFile->ID = Cache.HeaderP->PackageFileCount;
- map_stringitem_t const idxIndexType = WriteUniqString(Index.GetType()->Label);
+ map_stringitem_t const idxIndexType = StoreString(MIXED, Index.GetType()->Label);
if (unlikely(idxIndexType == 0))
return false;
CurrentFile->IndexType = idxIndexType;
@@ -1120,57 +1120,27 @@ bool pkgCacheGenerator::SelectFile(const string &File,const string &Site,
// ---------------------------------------------------------------------
/* This is used to create handles to strings. Given the same text it
always returns the same number */
-map_stringitem_t pkgCacheGenerator::WriteUniqString(const char *S,
+map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, const char *S,
unsigned int Size)
{
- /* We use a very small transient hash table here, this speeds up generation
- by a fair amount on slower machines */
- pkgCache::StringItem *&Bucket = UniqHash[(S[0]*5 + S[1]) % _count(UniqHash)];
- if (Bucket != 0 &&
- stringcmp(S,S+Size,Cache.StrP + Bucket->String) == 0)
- return Bucket->String;
-
- // Search for an insertion point
- pkgCache::StringItem *I = Cache.StringItemP + Cache.HeaderP->StringList;
- int Res = 1;
- map_stringitem_t *Last = &Cache.HeaderP->StringList;
- for (; I != Cache.StringItemP; Last = &I->NextItem,
- I = Cache.StringItemP + I->NextItem)
- {
- Res = stringcmp(S,S+Size,Cache.StrP + I->String);
- if (Res >= 0)
- break;
- }
-
- // Match
- if (Res == 0)
- {
- Bucket = I;
- return I->String;
+ std::string const key(S, Size);
+
+ std::map<std::string,map_stringitem_t> * strings;
+ switch(type) {
+ case MIXED: strings = &strMixed; break;
+ case PKGNAME: strings = &strPkgNames; break;
+ case VERSION: strings = &strVersions; break;
+ case SECTION: strings = &strSections; break;
+ default: _error->Fatal("Unknown enum type used for string storage of '%s'", key.c_str()); return 0;
}
-
- // Get a structure
- void const * const oldMap = Map.Data();
- map_pointer_t const Item = AllocateInMap(sizeof(pkgCache::StringItem));
- if (Item == 0)
- return 0;
- map_stringitem_t const idxString = WriteStringInMap(S,Size);
- if (unlikely(idxString == 0))
- return 0;
- if (oldMap != Map.Data()) {
- Last += (map_pointer_t const * const) Map.Data() - (map_pointer_t const * const) oldMap;
- I += (pkgCache::StringItem const * const) Map.Data() - (pkgCache::StringItem const * const) oldMap;
- }
- *Last = Item;
+ std::map<std::string,map_stringitem_t>::const_iterator const item = strings->find(key);
+ if (item != strings->end())
+ return item->second;
- // Fill in the structure
- pkgCache::StringItem *ItemP = Cache.StringItemP + Item;
- ItemP->NextItem = I - Cache.StringItemP;
- ItemP->String = idxString;
-
- Bucket = ItemP;
- return ItemP->String;
+ map_stringitem_t const idxString = WriteStringInMap(S,Size);
+ strings->insert(std::make_pair(key, idxString));
+ return idxString;
}
/*}}}*/
// CheckValidity - Check that a cache is up-to-date /*{{{*/
diff --git a/apt-pkg/pkgcachegen.h b/apt-pkg/pkgcachegen.h
index 42da7b12d..e1d22b88f 100644
--- a/apt-pkg/pkgcachegen.h
+++ b/apt-pkg/pkgcachegen.h
@@ -27,6 +27,7 @@
#include <vector>
#include <string>
+#include <map>
class FileFd;
class pkgSourceList;
@@ -36,13 +37,16 @@ class pkgIndexFile;
class pkgCacheGenerator /*{{{*/
{
private:
-
- pkgCache::StringItem *UniqHash[26];
APT_HIDDEN map_stringitem_t WriteStringInMap(std::string const &String) { return WriteStringInMap(String.c_str()); };
APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String);
APT_HIDDEN map_stringitem_t WriteStringInMap(const char *String, const unsigned long &Len);
APT_HIDDEN map_pointer_t AllocateInMap(const unsigned long &size);
+ std::map<std::string,map_stringitem_t> strMixed;
+ std::map<std::string,map_stringitem_t> strSections;
+ std::map<std::string,map_stringitem_t> strPkgNames;
+ std::map<std::string,map_stringitem_t> strVersions;
+
public:
class ListParser;
@@ -91,8 +95,9 @@ class pkgCacheGenerator /*{{{*/
public:
- map_stringitem_t WriteUniqString(const char *S,unsigned int const Size);
- inline map_stringitem_t WriteUniqString(const std::string &S) {return WriteUniqString(S.c_str(),S.length());};
+ enum StringType { MIXED, PKGNAME, VERSION, SECTION };
+ map_stringitem_t StoreString(enum StringType const type, const char * S, unsigned int const Size);
+ inline map_stringitem_t StoreString(enum StringType const type, const std::string &S) {return StoreString(type, S.c_str(),S.length());};
void DropProgress() {Progress = 0;};
bool SelectFile(const std::string &File,const std::string &Site,pkgIndexFile const &Index,
@@ -145,8 +150,9 @@ class pkgCacheGenerator::ListParser
protected:
- inline map_stringitem_t WriteUniqString(std::string S) {return Owner->WriteUniqString(S);};
- inline map_stringitem_t WriteUniqString(const char *S,unsigned int Size) {return Owner->WriteUniqString(S,Size);};
+ inline map_stringitem_t StoreString(pkgCacheGenerator::StringType const type, std::string const &S) {return Owner->StoreString(type, S);};
+ inline map_stringitem_t StoreString(pkgCacheGenerator::StringType const type, const char *S,unsigned int Size) {return Owner->StoreString(type, S, Size);};
+
inline map_stringitem_t WriteString(const std::string &S) {return Owner->WriteStringInMap(S);};
inline map_stringitem_t WriteString(const char *S,unsigned int Size) {return Owner->WriteStringInMap(S,Size);};
bool NewDepends(pkgCache::VerIterator &Ver,const std::string &Package, const std::string &Arch,
@@ -187,7 +193,7 @@ class pkgCacheGenerator::ListParser
virtual bool CollectFileProvides(pkgCache &/*Cache*/,
pkgCache::VerIterator &/*Ver*/) {return true;};
- ListParser() : FoundFileDeps(false) {};
+ ListParser() : Owner(NULL), OldDepLast(NULL), FoundFileDeps(false) {};
virtual ~ListParser() {};
};
/*}}}*/
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc
index e37899ec6..7170e8b5b 100644
--- a/apt-pkg/sourcelist.cc
+++ b/apt-pkg/sourcelist.cc
@@ -119,7 +119,7 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
std::vector<std::string> list_section = StringSplit(Section, " ");
for (std::vector<std::string>::const_iterator U = list_uris.begin();
- U != list_uris.end(); U++)
+ U != list_uris.end(); ++U)
{
std::string URI = (*U);
if (!FixupURI(URI))
@@ -129,10 +129,10 @@ bool pkgSourceList::Type::ParseStanza(vector<metaIndex *> &List,
}
for (std::vector<std::string>::const_iterator I = list_dist.begin();
- I != list_dist.end(); I++)
+ I != list_dist.end(); ++I)
{
for (std::vector<std::string>::const_iterator J = list_section.begin();
- J != list_section.end(); J++)
+ J != list_section.end(); ++J)
{
if (CreateItem(List, URI, (*I), (*J), Options) == false)
{
@@ -408,7 +408,7 @@ int pkgSourceList::ParseFileDeb822(string File)
string const types = Tags.FindS("Types");
std::vector<std::string> list_types = StringSplit(types, " ");
for (std::vector<std::string>::const_iterator I = list_types.begin();
- I != list_types.end(); I++)
+ I != list_types.end(); ++I)
{
Type *Parse = Type::GetType((*I).c_str());
if (Parse == 0)
diff --git a/apt-pkg/sourcelist.h b/apt-pkg/sourcelist.h
index 261dd8161..35b786e1a 100644
--- a/apt-pkg/sourcelist.h
+++ b/apt-pkg/sourcelist.h
@@ -96,13 +96,9 @@ class pkgSourceList : public pkgSource
public:
- std::vector<metaIndex *> SrcList;
-
int ParseFileDeb822(std::string File);
bool ParseFileOldStyle(std::string File);
- public:
-
bool ReadMainList();
bool Read(std::string File);
diff --git a/apt-pkg/tagfile.h b/apt-pkg/tagfile.h
index db43bfbf9..39ec94d86 100644
--- a/apt-pkg/tagfile.h
+++ b/apt-pkg/tagfile.h
@@ -43,7 +43,7 @@ class pkgTagSection
unsigned int StartValue;
unsigned int NextInBucket;
- TagData(unsigned int const StartTag) : StartTag(StartTag), NextInBucket(0) {}
+ TagData(unsigned int const StartTag) : StartTag(StartTag), EndTag(0), StartValue(0), NextInBucket(0) {}
};
std::vector<TagData> Tags;
unsigned int LookupTable[0x100];
@@ -94,7 +94,7 @@ class pkgTagSection
/** \brief amount of Tags in the current section
*
* Note: if a Tag is mentioned repeatly it will be counted multiple
- * times, but only the last occurance is available via Find methods.
+ * times, but only the last occurrence is available via Find methods.
*/
unsigned int Count() const;
bool Exists(const char* const Tag) const;
diff --git a/apt-pkg/upgrade.cc b/apt-pkg/upgrade.cc
index 29b11937b..ca670bdf5 100644
--- a/apt-pkg/upgrade.cc
+++ b/apt-pkg/upgrade.cc
@@ -24,13 +24,14 @@
The problem resolver is used to resolve the problems.
*/
-bool pkgDistUpgrade(pkgDepCache &Cache)
+bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
{
std::string const solver = _config->Find("APT::Solver", "internal");
- if (solver != "internal") {
- OpTextProgress Prog(*_config);
- return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false, &Prog);
- }
+ if (solver != "internal")
+ return EDSP::ResolveExternal(solver.c_str(), Cache, false, true, false, Progress);
+
+ if (Progress != NULL)
+ Progress->OverallProgress(0, 100, 1, _("Calculating upgrade"));
pkgDepCache::ActionGroup group(Cache);
@@ -41,12 +42,18 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
if (I->CurrentVer != 0)
Cache.MarkInstall(I, false, 0, false);
+ if (Progress != NULL)
+ Progress->Progress(10);
+
/* Auto upgrade all installed packages, this provides the basis
for the installation */
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (I->CurrentVer != 0)
Cache.MarkInstall(I, true, 0, false);
+ if (Progress != NULL)
+ Progress->Progress(50);
+
/* Now, install each essential package which is not installed
(and not provided by another package in the same name group) */
std::string essential = _config->Find("pkgCacheGen::Essential", "all");
@@ -77,15 +84,24 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if ((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential)
Cache.MarkInstall(I, true, 0, false);
-
+
+ if (Progress != NULL)
+ Progress->Progress(55);
+
/* We do it again over all previously installed packages to force
conflict resolution on them all. */
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (I->CurrentVer != 0)
Cache.MarkInstall(I, false, 0, false);
+ if (Progress != NULL)
+ Progress->Progress(65);
+
pkgProblemResolver Fix(&Cache);
+ if (Progress != NULL)
+ Progress->Progress(95);
+
// Hold back held packages.
if (_config->FindB("APT::Ignore-Hold",false) == false)
{
@@ -98,18 +114,22 @@ bool pkgDistUpgrade(pkgDepCache &Cache)
}
}
}
-
- return Fix.Resolve();
+
+ bool const success = Fix.Resolve(false, Progress);
+ if (Progress != NULL)
+ Progress->Done();
+ return success;
}
/*}}}*/
// AllUpgradeNoNewPackages - Upgrade but no removals or new pkgs /*{{{*/
-static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache)
+static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache, OpProgress * const Progress)
{
std::string const solver = _config->Find("APT::Solver", "internal");
- if (solver != "internal") {
- OpTextProgress Prog(*_config);
- return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog);
- }
+ if (solver != "internal")
+ return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, Progress);
+
+ if (Progress != NULL)
+ Progress->OverallProgress(0, 100, 1, _("Calculating upgrade"));
pkgDepCache::ActionGroup group(Cache);
@@ -131,8 +151,15 @@ static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache)
if (I->CurrentVer != 0 && Cache[I].InstallVer != 0)
Cache.MarkInstall(I, false, 0, false);
}
-
- return Fix.ResolveByKeep();
+
+ if (Progress != NULL)
+ Progress->Progress(50);
+
+ // resolve remaining issues via keep
+ bool const success = Fix.ResolveByKeep(Progress);
+ if (Progress != NULL)
+ Progress->Done();
+ return success;
}
/*}}}*/
// AllUpgradeWithNewInstalls - Upgrade + install new packages as needed /*{{{*/
@@ -141,13 +168,14 @@ static bool pkgAllUpgradeNoNewPackages(pkgDepCache &Cache)
* Upgrade as much as possible without deleting anything (useful for
* stable systems)
*/
-static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache)
+static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache, OpProgress * const Progress)
{
std::string const solver = _config->Find("APT::Solver", "internal");
- if (solver != "internal") {
- OpTextProgress Prog(*_config);
- return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, &Prog);
- }
+ if (solver != "internal")
+ return EDSP::ResolveExternal(solver.c_str(), Cache, true, false, false, Progress);
+
+ if (Progress != NULL)
+ Progress->OverallProgress(0, 100, 1, _("Calculating upgrade"));
pkgDepCache::ActionGroup group(Cache);
@@ -170,18 +198,30 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache)
}
}
+ if (Progress != NULL)
+ Progress->Progress(10);
+
// then let auto-install loose
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (Cache[I].Install())
Cache.MarkInstall(I, true, 0, false);
+ if (Progress != NULL)
+ Progress->Progress(50);
+
// ... but it may remove stuff, we we need to clean up afterwards again
for (pkgCache::PkgIterator I = Cache.PkgBegin(); I.end() == false; ++I)
if (Cache[I].Delete() == true)
Cache.MarkKeep(I, false, false);
+ if (Progress != NULL)
+ Progress->Progress(60);
+
// resolve remaining issues via keep
- return Fix.ResolveByKeep();
+ bool const success = Fix.ResolveByKeep(Progress);
+ if (Progress != NULL)
+ Progress->Done();
+ return success;
}
/*}}}*/
// AllUpgrade - Upgrade as many packages as possible /*{{{*/
@@ -189,9 +229,9 @@ static bool pkgAllUpgradeWithNewPackages(pkgDepCache &Cache)
/* Right now the system must be consistent before this can be called.
It also will not change packages marked for install, it only tries
to install packages not marked for install */
-bool pkgAllUpgrade(pkgDepCache &Cache)
+bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress)
{
- return pkgAllUpgradeNoNewPackages(Cache);
+ return pkgAllUpgradeNoNewPackages(Cache, Progress);
}
/*}}}*/
// MinimizeUpgrade - Minimizes the set of packages to be upgraded /*{{{*/
@@ -239,24 +279,25 @@ bool pkgMinimizeUpgrade(pkgDepCache &Cache)
return true;
}
/*}}}*/
-// APT::Upgrade::Upgrade - Upgrade using a specific strategy /*{{{*/
-bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode)
+// APT::Upgrade::Upgrade - Upgrade using a specific strategy /*{{{*/
+bool APT::Upgrade::Upgrade(pkgDepCache &Cache, int mode, OpProgress * const Progress)
{
- if (mode == 0)
- {
- return pkgDistUpgrade(Cache);
- }
+#if __GNUC__ >= 4
+ // the deprecated methods will become our privates, so that is fine
+ #pragma GCC diagnostic push
+ #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
+ if (mode == ALLOW_EVERYTHING)
+ return pkgDistUpgrade(Cache, Progress);
else if ((mode & ~FORBID_REMOVE_PACKAGES) == 0)
- {
- return pkgAllUpgradeWithNewPackages(Cache);
- }
+ return pkgAllUpgradeWithNewPackages(Cache, Progress);
else if ((mode & ~(FORBID_REMOVE_PACKAGES|FORBID_INSTALL_NEW_PACKAGES)) == 0)
- {
- return pkgAllUpgradeNoNewPackages(Cache);
- }
+ return pkgAllUpgradeNoNewPackages(Cache, Progress);
else
_error->Error("pkgAllUpgrade called with unsupported mode %i", mode);
-
+#if __GNUC__ >= 4
+ #pragma GCC diagnostic pop
+#endif
return false;
}
/*}}}*/
diff --git a/apt-pkg/upgrade.h b/apt-pkg/upgrade.h
index aa883df10..a3f693d86 100644
--- a/apt-pkg/upgrade.h
+++ b/apt-pkg/upgrade.h
@@ -10,23 +10,27 @@
#ifndef PKGLIB_UPGRADE_H
#define PKGLIB_UPGRADE_H
+#include <stddef.h>
+#include <apt-pkg/macros.h>
+
class pkgDepCache;
+class OpProgress;
namespace APT {
namespace Upgrade {
// FIXME: make this "enum class UpgradeMode {" once we enable c++11
enum UpgradeMode {
+ ALLOW_EVERYTHING = 0,
FORBID_REMOVE_PACKAGES = 1,
FORBID_INSTALL_NEW_PACKAGES = 2
};
- bool Upgrade(pkgDepCache &Cache, int UpgradeMode);
+ bool Upgrade(pkgDepCache &Cache, int UpgradeMode, OpProgress * const Progress = NULL);
}
}
// please use APT::Upgrade::Upgrade() instead
-bool pkgDistUpgrade(pkgDepCache &Cache);
-bool pkgAllUpgrade(pkgDepCache &Cache);
-bool pkgMinimizeUpgrade(pkgDepCache &Cache);
-
+APT_DEPRECATED bool pkgDistUpgrade(pkgDepCache &Cache, OpProgress * const Progress = NULL);
+APT_DEPRECATED bool pkgAllUpgrade(pkgDepCache &Cache, OpProgress * const Progress = NULL);
+bool pkgMinimizeUpgrade(pkgDepCache &Cache);
#endif
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index 17a12799c..d6ce192ad 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -202,9 +202,9 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner)
S += strlen(S);
// Show the short mode string
- if (I->CurrentItem->Owner->Mode != 0)
+ if (I->CurrentItem->Owner->ActiveSubprocess.empty() == false)
{
- snprintf(S,End-S," %s",I->CurrentItem->Owner->Mode);
+ snprintf(S,End-S, " %s", I->CurrentItem->Owner->ActiveSubprocess.c_str());
S += strlen(S);
}
diff --git a/apt-private/private-cachefile.cc b/apt-private/private-cachefile.cc
index 5e955ac39..29e665245 100644
--- a/apt-private/private-cachefile.cc
+++ b/apt-private/private-cachefile.cc
@@ -32,8 +32,10 @@ int CacheFile::NameComp(const void *a,const void *b)
const pkgCache::Package &A = **(pkgCache::Package **)a;
const pkgCache::Package &B = **(pkgCache::Package **)b;
+ const pkgCache::Group * const GA = SortCache->GrpP + A.Group;
+ const pkgCache::Group * const GB = SortCache->GrpP + B.Group;
- return strcmp(SortCache->StrP + A.Name,SortCache->StrP + B.Name);
+ return strcmp(SortCache->StrP + GA->Name,SortCache->StrP + GB->Name);
}
/*}}}*/
// CacheFile::Sort - Sort by name /*{{{*/
diff --git a/apt-private/private-cacheset.cc b/apt-private/private-cacheset.cc
index eb77be274..cb68024db 100644
--- a/apt-private/private-cacheset.cc
+++ b/apt-private/private-cacheset.cc
@@ -60,22 +60,22 @@ bool GetLocalitySortedVersionSet(pkgCacheFile &CacheFile,
if (insertCurrentVer == true)
{
if (P->CurrentVer != 0)
- vci->FromPackage(vci, CacheFile, P, APT::VersionContainerInterface::INSTALLED, helper);
+ vci->FromPackage(vci, CacheFile, P, APT::CacheSetHelper::INSTALLED, helper);
}
else if (insertUpgradable == true)
{
if(P.CurrentVer() && state.Upgradable())
- vci->FromPackage(vci, CacheFile, P, APT::VersionContainerInterface::CANDIDATE, helper);
+ vci->FromPackage(vci, CacheFile, P, APT::CacheSetHelper::CANDIDATE, helper);
}
else if (insertManualInstalled == true)
{
if (P.CurrentVer() &&
((*DepCache)[P].Flags & pkgCache::Flag::Auto) == false)
- vci->FromPackage(vci, CacheFile, P, APT::VersionContainerInterface::CANDIDATE, helper);
+ vci->FromPackage(vci, CacheFile, P, APT::CacheSetHelper::CANDIDATE, helper);
}
else
{
- if (vci->FromPackage(vci, CacheFile, P, APT::VersionContainerInterface::CANDIDATE, helper) == false)
+ if (vci->FromPackage(vci, CacheFile, P, APT::CacheSetHelper::CANDIDATE, helper) == false)
{
// no candidate, this may happen for packages in
// dpkg "deinstall ok config-file" state - we pick the first ver
diff --git a/apt-private/private-cacheset.h b/apt-private/private-cacheset.h
index ca8f4be5d..059c7637e 100644
--- a/apt-private/private-cacheset.h
+++ b/apt-private/private-cacheset.h
@@ -76,19 +76,16 @@ class CacheSetHelperVirtuals: public APT::CacheSetHelper {
public:
APT::PackageSet virtualPkgs;
- virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- virtualPkgs.insert(Pkg);
- return CacheSetHelper::canNotFindCandidateVer(Cache, Pkg);
+ virtual pkgCache::VerIterator canNotGetVersion(enum CacheSetHelper::VerSelector const select, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
+ if (select == NEWEST || select == CANDIDATE || select == ALL)
+ virtualPkgs.insert(Pkg);
+ return CacheSetHelper::canNotGetVersion(select, Cache, Pkg);
}
- virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- virtualPkgs.insert(Pkg);
- return CacheSetHelper::canNotFindNewestVer(Cache, Pkg);
- }
-
- virtual void canNotFindAllVer(APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- virtualPkgs.insert(Pkg);
- CacheSetHelper::canNotFindAllVer(vci, Cache, Pkg);
+ virtual void canNotFindVersion(enum CacheSetHelper::VerSelector const select, APT::VersionContainerInterface * vci, pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
+ if (select == NEWEST || select == CANDIDATE || select == ALL)
+ virtualPkgs.insert(Pkg);
+ return CacheSetHelper::canNotFindVersion(select, vci, Cache, Pkg);
}
CacheSetHelperVirtuals(bool const ShowErrors = true, GlobalError::MsgType const &ErrorType = GlobalError::NOTICE) : CacheSetHelper(ShowErrors, ErrorType) {}
@@ -190,7 +187,7 @@ public:
}
virtual pkgCache::VerIterator canNotFindCandidateVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
- APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::CANDIDATE);
+ APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::CANDIDATE);
if (verset.empty() == false)
return *(verset.begin());
else if (ShowError == true) {
@@ -203,7 +200,7 @@ public:
virtual pkgCache::VerIterator canNotFindNewestVer(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg) {
if (Pkg->ProvidesList != 0)
{
- APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, APT::VersionSet::NEWEST);
+ APT::VersionSet const verset = tryVirtualPackage(Cache, Pkg, CacheSetHelper::NEWEST);
if (verset.empty() == false)
return *(verset.begin());
if (ShowError == true)
@@ -231,7 +228,7 @@ public:
}
APT::VersionSet tryVirtualPackage(pkgCacheFile &Cache, pkgCache::PkgIterator const &Pkg,
- APT::VersionSet::Version const &select) {
+ CacheSetHelper::VerSelector const select) {
/* This is a pure virtual package and there is a single available
candidate providing it. */
if (unlikely(Cache[Pkg].CandidateVer != 0) || Pkg->ProvidesList == 0)
diff --git a/apt-private/private-install.cc b/apt-private/private-install.cc
index 55893bda0..86ba52857 100644
--- a/apt-private/private-install.cc
+++ b/apt-private/private-install.cc
@@ -560,9 +560,9 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
std::list<APT::VersionSet::Modifier> mods;
mods.push_back(APT::VersionSet::Modifier(MOD_INSTALL, "+",
- APT::VersionSet::Modifier::POSTFIX, APT::VersionSet::CANDIDATE));
+ APT::VersionSet::Modifier::POSTFIX, APT::CacheSetHelper::CANDIDATE));
mods.push_back(APT::VersionSet::Modifier(MOD_REMOVE, "-",
- APT::VersionSet::Modifier::POSTFIX, APT::VersionSet::NEWEST));
+ APT::VersionSet::Modifier::POSTFIX, APT::CacheSetHelper::NEWEST));
CacheSetHelperAPTGet helper(c0out);
verset = APT::VersionSet::GroupedFromCommandLine(Cache,
CmdL.FileList + 1, mods, fallback, helper);
@@ -619,15 +619,14 @@ bool DoCacheManipulationFromCommandLine(CommandLine &CmdL, CacheFile &Cache,
if (Fix != NULL)
{
// Call the scored problem resolver
+ OpTextProgress Progress(*_config);
+ bool const distUpgradeMode = strcmp(CmdL.FileList[0], "dist-upgrade") == 0 || strcmp(CmdL.FileList[0], "full-upgrade") == 0;
+
bool resolver_fail = false;
- if (UpgradeMode == 0)
- {
- if (strcmp(CmdL.FileList[0], "dist-upgrade") == 0 || strcmp(CmdL.FileList[0], "full-upgrade") == 0)
- resolver_fail = APT::Upgrade::Upgrade(Cache, 0);
- else
- resolver_fail = Fix->Resolve(true);
- } else
- resolver_fail = APT::Upgrade::Upgrade(Cache, UpgradeMode);
+ if (distUpgradeMode == true || UpgradeMode != APT::Upgrade::ALLOW_EVERYTHING)
+ resolver_fail = APT::Upgrade::Upgrade(Cache, UpgradeMode, &Progress);
+ else
+ resolver_fail = Fix->Resolve(true, &Progress);
if (resolver_fail == false && Cache->BrokenCount() == 0)
return false;
diff --git a/apt-private/private-show.cc b/apt-private/private-show.cc
index 8ae6a6dac..289f035a6 100644
--- a/apt-private/private-show.cc
+++ b/apt-private/private-show.cc
@@ -141,16 +141,16 @@ bool ShowPackage(CommandLine &CmdL) /*{{{*/
{
pkgCacheFile CacheFile;
CacheSetHelperVirtuals helper(true, GlobalError::NOTICE);
- APT::VersionList::Version const select = _config->FindB("APT::Cache::AllVersions", false) ?
- APT::VersionList::ALL : APT::VersionList::CANDIDATE;
+ APT::CacheSetHelper::VerSelector const select = _config->FindB("APT::Cache::AllVersions", false) ?
+ APT::CacheSetHelper::ALL : APT::CacheSetHelper::CANDIDATE;
APT::VersionList const verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, select, helper);
for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver)
if (DisplayRecord(CacheFile, Ver, c1out) == false)
return false;
- if (select == APT::VersionList::CANDIDATE)
+ if (select == APT::CacheSetHelper::CANDIDATE)
{
- APT::VersionList const verset_all = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionList::ALL, helper);
+ APT::VersionList const verset_all = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::CacheSetHelper::ALL, helper);
int const records = verset_all.size() - verset.size();
if (records > 0)
_error->Notice(P_("There is %i additional record. Please use the '-a' switch to see it", "There are %i additional records. Please use the '-a' switch to see them.", records), records);
diff --git a/apt-private/private-update.cc b/apt-private/private-update.cc
index 860d84b86..1cf3012ed 100644
--- a/apt-private/private-update.cc
+++ b/apt-private/private-update.cc
@@ -56,10 +56,17 @@ bool DoUpdate(CommandLine &CmdL)
if (List->GetIndexes(&Fetcher,true) == false)
return false;
+ std::string compExt = APT::Configuration::getCompressionTypes()[0];
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); ++I)
- c1out << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
+ {
+ std::string FileName = flNotDir(I->Owner->DestFile);
+ if(compExt.empty() == false &&
+ APT::String::Endswith(FileName, compExt))
+ FileName = FileName.substr(0, FileName.size() - compExt.size() - 1);
+ c1out << '\'' << I->URI << "' " << FileName << ' ' <<
I->Owner->FileSize << ' ' << I->Owner->HashSum() << std::endl;
+ }
return true;
}
diff --git a/apt-private/private-upgrade.cc b/apt-private/private-upgrade.cc
index 31f067576..d13a6af49 100644
--- a/apt-private/private-upgrade.cc
+++ b/apt-private/private-upgrade.cc
@@ -22,10 +22,8 @@ static bool UpgradeHelper(CommandLine &CmdL, int UpgradeFlags)
if (Cache.OpenForInstall() == false || Cache.CheckDeps() == false)
return false;
- c0out << _("Calculating upgrade... ") << std::flush;
if(!DoCacheManipulationFromCommandLine(CmdL, Cache, UpgradeFlags))
return false;
- c0out << _("Done") << std::endl;
return InstallPackages(Cache,true);
}
@@ -35,7 +33,7 @@ static bool UpgradeHelper(CommandLine &CmdL, int UpgradeFlags)
/* Intelligent upgrader that will install and remove packages at will */
bool DoDistUpgrade(CommandLine &CmdL)
{
- return UpgradeHelper(CmdL, 0);
+ return UpgradeHelper(CmdL, APT::Upgrade::ALLOW_EVERYTHING);
}
/*}}}*/
bool DoUpgrade(CommandLine &CmdL) /*{{{*/
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 1447feb81..0f4f7e1ce 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -191,7 +191,7 @@ static bool UnMet(CommandLine &CmdL)
{
CacheSetHelperVirtuals helper(true, GlobalError::NOTICE);
APT::VersionList verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1,
- APT::VersionList::CANDIDATE, helper);
+ APT::CacheSetHelper::CANDIDATE, helper);
for (APT::VersionList::iterator V = verset.begin(); V != verset.end(); ++V)
if (ShowUnMet(V, Important) == false)
return false;
@@ -375,31 +375,58 @@ static bool Stats(CommandLine &)
SizeToStr(Cache->Head().DescFileCount*Cache->Head().DescFileSz) << ')' << endl;
cout << _("Total Provides mappings: ") << Cache->Head().ProvidesCount << " (" <<
SizeToStr(Cache->Head().ProvidesCount*Cache->Head().ProvidesSz) << ')' << endl;
-
- // String list stats
- unsigned long Size = 0;
- unsigned long Count = 0;
- for (pkgCache::StringItem *I = Cache->StringItemP + Cache->Head().StringList;
- I!= Cache->StringItemP; I = Cache->StringItemP + I->NextItem)
- {
- Count++;
- Size += strlen(Cache->StrP + I->String) + 1;
- }
- cout << _("Total globbed strings: ") << Count << " (" << SizeToStr(Size) << ')' << endl;
- unsigned long DepVerSize = 0;
+ // String list stats
+ std::set<map_stringitem_t> stritems;
+ for (pkgCache::GrpIterator G = Cache->GrpBegin(); G.end() == false; ++G)
+ stritems.insert(G->Name);
for (pkgCache::PkgIterator P = Cache->PkgBegin(); P.end() == false; ++P)
{
+ stritems.insert(P->Arch);
for (pkgCache::VerIterator V = P.VersionList(); V.end() == false; ++V)
{
+ if (V->VerStr != 0)
+ stritems.insert(V->VerStr);
+ if (V->Section != 0)
+ stritems.insert(V->Section);
+ stritems.insert(V->SourcePkgName);
+ stritems.insert(V->SourceVerStr);
for (pkgCache::DepIterator D = V.DependsList(); D.end() == false; ++D)
{
if (D->Version != 0)
- DepVerSize += strlen(D.TargetVer()) + 1;
+ stritems.insert(D->Version);
+ }
+ for (pkgCache::DescIterator D = V.DescriptionList(); D.end() == false; ++D)
+ {
+ stritems.insert(D->md5sum);
+ stritems.insert(D->language_code);
}
}
+ for (pkgCache::PrvIterator Prv = P.ProvidesList(); Prv.end() == false; ++Prv)
+ {
+ if (Prv->ProvideVersion != 0)
+ stritems.insert(Prv->ProvideVersion);
+ }
}
- cout << _("Total dependency version space: ") << SizeToStr(DepVerSize) << endl;
+ for (pkgCache::PkgFileIterator F = Cache->FileBegin(); F != Cache->FileEnd(); ++F)
+ {
+ stritems.insert(F->FileName);
+ stritems.insert(F->Archive);
+ stritems.insert(F->Codename);
+ stritems.insert(F->Component);
+ stritems.insert(F->Version);
+ stritems.insert(F->Origin);
+ stritems.insert(F->Label);
+ stritems.insert(F->Architecture);
+ stritems.insert(F->Site);
+ stritems.insert(F->IndexType);
+ }
+ unsigned long Size = 0;
+ for (std::set<map_stringitem_t>::const_iterator i = stritems.begin(); i != stritems.end(); ++i)
+ Size += strlen(Cache->StrP + *i) + 1;
+
+ cout << _("Total globbed strings: ") << stritems.size() << " (" << SizeToStr(Size) << ')' << endl;
+ stritems.clear();
unsigned long Slack = 0;
for (int I = 0; I != 7; I++)
@@ -631,7 +658,7 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
return false;
CacheSetHelperVirtuals helper(false);
- APT::VersionList verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper);
+ APT::VersionList verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper);
if (verset.empty() == true && helper.virtualPkgs.empty() == true)
return _error->Error(_("No packages found"));
std::vector<bool> Shown(Cache->Head().PackageCount);
@@ -699,7 +726,7 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
if (Recurse == true && Shown[Trg->ID] == false)
{
Shown[Trg->ID] = true;
- verset.insert(APT::VersionSet::FromPackage(CacheFile, Trg, APT::VersionSet::CANDIDATE, helper));
+ verset.insert(APT::VersionSet::FromPackage(CacheFile, Trg, APT::CacheSetHelper::CANDIDATE, helper));
}
}
@@ -718,7 +745,7 @@ static bool ShowDepends(CommandLine &CmdL, bool const RevDepends)
if (Recurse == true && Shown[V.ParentPkg()->ID] == false)
{
Shown[V.ParentPkg()->ID] = true;
- verset.insert(APT::VersionSet::FromPackage(CacheFile, V.ParentPkg(), APT::VersionSet::CANDIDATE, helper));
+ verset.insert(APT::VersionSet::FromPackage(CacheFile, V.ParentPkg(), APT::CacheSetHelper::CANDIDATE, helper));
}
}
@@ -813,9 +840,9 @@ static bool XVcg(CommandLine &CmdL)
// Load the list of packages from the command line into the show list
APT::CacheSetHelper helper(true, GlobalError::NOTICE);
- std::list<APT::PackageSet::Modifier> mods;
- mods.push_back(APT::PackageSet::Modifier(0, ",", APT::PackageSet::Modifier::POSTFIX));
- mods.push_back(APT::PackageSet::Modifier(1, "^", APT::PackageSet::Modifier::POSTFIX));
+ std::list<APT::CacheSetHelper::PkgModifier> mods;
+ mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::PackageSet::Modifier::POSTFIX));
+ mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::PackageSet::Modifier::POSTFIX));
std::map<unsigned short, APT::PackageSet> pkgsets =
APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper);
@@ -1025,9 +1052,9 @@ static bool Dotty(CommandLine &CmdL)
// Load the list of packages from the command line into the show list
APT::CacheSetHelper helper(true, GlobalError::NOTICE);
- std::list<APT::PackageSet::Modifier> mods;
- mods.push_back(APT::PackageSet::Modifier(0, ",", APT::PackageSet::Modifier::POSTFIX));
- mods.push_back(APT::PackageSet::Modifier(1, "^", APT::PackageSet::Modifier::POSTFIX));
+ std::list<APT::CacheSetHelper::PkgModifier> mods;
+ mods.push_back(APT::CacheSetHelper::PkgModifier(0, ",", APT::PackageSet::Modifier::POSTFIX));
+ mods.push_back(APT::CacheSetHelper::PkgModifier(1, "^", APT::PackageSet::Modifier::POSTFIX));
std::map<unsigned short, APT::PackageSet> pkgsets =
APT::PackageSet::GroupedFromCommandLine(CacheFile, CmdL.FileList + 1, mods, 0, helper);
@@ -1481,8 +1508,8 @@ static bool ShowPackage(CommandLine &CmdL)
{
pkgCacheFile CacheFile;
CacheSetHelperVirtuals helper(true, GlobalError::NOTICE);
- APT::VersionList::Version const select = _config->FindB("APT::Cache::AllVersions", true) ?
- APT::VersionList::ALL : APT::VersionList::CANDIDATE;
+ APT::CacheSetHelper::VerSelector const select = _config->FindB("APT::Cache::AllVersions", true) ?
+ APT::CacheSetHelper::ALL : APT::CacheSetHelper::CANDIDATE;
APT::VersionList const verset = APT::VersionList::FromCommandLine(CacheFile, CmdL.FileList + 1, select, helper);
for (APT::VersionList::const_iterator Ver = verset.begin(); Ver != verset.end(); ++Ver)
if (DisplayRecord(CacheFile, Ver) == false)
diff --git a/cmdline/apt-get.cc b/cmdline/apt-get.cc
index d6cd94f72..0cea05cb3 100644
--- a/cmdline/apt-get.cc
+++ b/cmdline/apt-get.cc
@@ -195,7 +195,7 @@ static std::string GetReleaseForSourceRecord(pkgSourceList *SrcList,
// FindSrc - Find a source record /*{{{*/
// ---------------------------------------------------------------------
/* */
-static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
+static pkgSrcRecords::Parser *FindSrc(const char *Name,
pkgSrcRecords &SrcRecs,string &Src,
CacheFile &CacheFile)
{
@@ -303,16 +303,10 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
(VF.File().Archive() != 0 && VF.File().Archive() == RelTag) ||
(VF.File().Codename() != 0 && VF.File().Codename() == RelTag))
{
- pkgRecords::Parser &Parse = Recs.Lookup(VF);
- Src = Parse.SourcePkg();
- // no SourcePkg name, so it is the "binary" name
- if (Src.empty() == true)
- Src = TmpSrc;
+ Src = Ver.SourcePkgName();
// the Version we have is possibly fuzzy or includes binUploads,
- // so we use the Version of the SourcePkg (empty if same as package)
- VerTag = Parse.SourceVer();
- if (VerTag.empty() == true)
- VerTag = Ver.VerStr();
+ // so we use the Version of the SourcePkg
+ VerTag = Ver.SourceVerStr();
break;
}
}
@@ -343,10 +337,10 @@ static pkgSrcRecords::Parser *FindSrc(const char *Name,pkgRecords &Recs,
pkgCache::VerIterator Ver = Cache->GetCandidateVer(Pkg);
if (Ver.end() == false)
{
- pkgRecords::Parser &Parse = Recs.Lookup(Ver.FileList());
- Src = Parse.SourcePkg();
- if (VerTag.empty() == true)
- VerTag = Parse.SourceVer();
+ if (strcmp(Ver.SourcePkgName(),Ver.ParentPkg().Name()) != 0)
+ Src = Ver.SourcePkgName();
+ if (VerTag.empty() == true && strcmp(Ver.SourceVerStr(),Ver.VerStr()) != 0)
+ VerTag = Ver.SourceVerStr();
}
}
}
@@ -540,7 +534,7 @@ static bool DoDSelectUpgrade(CommandLine &)
}
// Now upgrade everything
- if (pkgAllUpgrade(Cache) == false)
+ if (APT::Upgrade::Upgrade(Cache, APT::Upgrade::FORBID_REMOVE_PACKAGES | APT::Upgrade::FORBID_INSTALL_NEW_PACKAGES) == false)
{
ShowBroken(c1out,Cache,false);
return _error->Error(_("Internal error, problem resolver broke stuff"));
@@ -555,30 +549,44 @@ static bool DoDSelectUpgrade(CommandLine &)
static bool DoClean(CommandLine &)
{
std::string const archivedir = _config->FindDir("Dir::Cache::archives");
- std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
- std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
+ std::string const listsdir = _config->FindDir("Dir::state::lists");
if (_config->FindB("APT::Get::Simulate") == true)
{
+ std::string const pkgcache = _config->FindFile("Dir::cache::pkgcache");
+ std::string const srcpkgcache = _config->FindFile("Dir::cache::srcpkgcache");
cout << "Del " << archivedir << "* " << archivedir << "partial/*"<< endl
+ << "Del " << listsdir << "partial/*" << endl
<< "Del " << pkgcache << " " << srcpkgcache << endl;
return true;
}
-
+
+ bool const NoLocking = _config->FindB("Debug::NoLocking",false);
// Lock the archive directory
FileFd Lock;
- if (_config->FindB("Debug::NoLocking",false) == false)
+ if (NoLocking == false)
{
int lock_fd = GetLock(archivedir + "lock");
if (lock_fd < 0)
- return _error->Error(_("Unable to lock the download directory"));
+ return _error->Error(_("Unable to lock directory %s"), archivedir.c_str());
Lock.Fd(lock_fd);
}
-
+
pkgAcquire Fetcher;
Fetcher.Clean(archivedir);
Fetcher.Clean(archivedir + "partial/");
+ if (NoLocking == false)
+ {
+ Lock.Close();
+ int lock_fd = GetLock(listsdir + "lock");
+ if (lock_fd < 0)
+ return _error->Error(_("Unable to lock directory %s"), listsdir.c_str());
+ Lock.Fd(lock_fd);
+ }
+
+ Fetcher.Clean(listsdir + "partial/");
+
pkgCacheFile::RemoveCaches();
return true;
@@ -632,14 +640,14 @@ static bool DoDownload(CommandLine &CmdL)
APT::CacheSetHelper helper(c0out);
APT::VersionSet verset = APT::VersionSet::FromCommandLine(Cache,
- CmdL.FileList + 1, APT::VersionSet::CANDIDATE, helper);
+ CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper);
if (verset.empty() == true)
return false;
AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet", 0));
pkgAcquire Fetcher;
- if (Fetcher.Setup(&Stat) == false)
+ if (Fetcher.Setup(&Stat, "", false) == false)
return false;
pkgRecords Recs(Cache);
@@ -665,7 +673,7 @@ static bool DoDownload(CommandLine &CmdL)
{
pkgAcquire::UriIterator I = Fetcher.UriBegin();
for (; I != Fetcher.UriEnd(); ++I)
- cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
+ cout << '\'' << I->URI << "' " << flNotDir(I->Owner->DestFile) << ' ' <<
I->Owner->FileSize << ' ' << I->Owner->HashSum() << endl;
return true;
}
@@ -731,7 +739,6 @@ static bool DoSource(CommandLine &CmdL)
pkgSourceList *List = Cache.GetSourceList();
// Create the text record parsers
- pkgRecords Recs(Cache);
pkgSrcRecords SrcRecs(*List);
if (_error->PendingError() == true)
return false;
@@ -760,7 +767,7 @@ static bool DoSource(CommandLine &CmdL)
for (const char **I = CmdL.FileList + 1; *I != 0; I++, J++)
{
string Src;
- pkgSrcRecords::Parser *Last = FindSrc(*I,Recs,SrcRecs,Src,Cache);
+ pkgSrcRecords::Parser *Last = FindSrc(*I,SrcRecs,Src,Cache);
if (Last == 0) {
return _error->Error(_("Unable to find a source package for %s"),Src.c_str());
@@ -1037,7 +1044,6 @@ static bool DoBuildDep(CommandLine &CmdL)
pkgSourceList *List = Cache.GetSourceList();
// Create the text record parsers
- pkgRecords Recs(Cache);
pkgSrcRecords SrcRecs(*List);
if (_error->PendingError() == true)
return false;
@@ -1090,7 +1096,7 @@ static bool DoBuildDep(CommandLine &CmdL)
Last = Type->CreateSrcPkgParser(*I);
} else {
// normal case, search the cache for the source file
- Last = FindSrc(*I,Recs,SrcRecs,Src,Cache);
+ Last = FindSrc(*I,SrcRecs,Src,Cache);
}
if (Last == 0)
@@ -1441,21 +1447,15 @@ static bool DoBuildDep(CommandLine &CmdL)
* pool/ next to the deb itself)
* Example return: "pool/main/a/apt/apt_0.8.8ubuntu3"
*/
-static string GetChangelogPath(CacheFile &Cache,
- pkgCache::PkgIterator Pkg,
+static string GetChangelogPath(CacheFile &Cache,
pkgCache::VerIterator Ver)
{
- string path;
-
pkgRecords Recs(Cache);
pkgRecords::Parser &rec=Recs.Lookup(Ver.FileList());
- string srcpkg = rec.SourcePkg().empty() ? Pkg.Name() : rec.SourcePkg();
- string ver = Ver.VerStr();
- // if there is a source version it always wins
- if (rec.SourceVer() != "")
- ver = rec.SourceVer();
- path = flNotFile(rec.FileName());
- path += srcpkg + "_" + StripEpoch(ver);
+ string path = flNotFile(rec.FileName());
+ path.append(Ver.SourcePkgName());
+ path.append("_");
+ path.append(StripEpoch(Ver.SourceVerStr()));
return path;
}
/*}}}*/
@@ -1469,7 +1469,6 @@ static string GetChangelogPath(CacheFile &Cache,
* http://packages.medibuntu.org/pool/non-free/m/mplayer/mplayer_1.0~rc4~try1.dsfg1-1ubuntu1+medibuntu1.changelog
*/
static bool GuessThirdPartyChangelogUri(CacheFile &Cache,
- pkgCache::PkgIterator Pkg,
pkgCache::VerIterator Ver,
string &out_uri)
{
@@ -1484,7 +1483,7 @@ static bool GuessThirdPartyChangelogUri(CacheFile &Cache,
return false;
// get archive uri for the binary deb
- string path_without_dot_changelog = GetChangelogPath(Cache, Pkg, Ver);
+ string path_without_dot_changelog = GetChangelogPath(Cache, Ver);
out_uri = index->ArchiveURI(path_without_dot_changelog + ".changelog");
// now strip away the filename and add srcpkg_srcver.changelog
@@ -1502,25 +1501,20 @@ static bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
* GuessThirdPartyChangelogUri for details how)
*/
{
- string path;
- string descr;
- string server;
- string changelog_uri;
-
- // data structures we need
- pkgCache::PkgIterator Pkg = Ver.ParentPkg();
-
// make the server root configurable
- server = _config->Find("Apt::Changelogs::Server",
+ string const server = _config->Find("Apt::Changelogs::Server",
"http://packages.debian.org/changelogs");
- path = GetChangelogPath(CacheFile, Pkg, Ver);
+ string const path = GetChangelogPath(CacheFile, Ver);
+ string changelog_uri;
strprintf(changelog_uri, "%s/%s/changelog", server.c_str(), path.c_str());
if (_config->FindB("APT::Get::Print-URIs", false) == true)
{
std::cout << '\'' << changelog_uri << '\'' << std::endl;
return true;
}
+ pkgCache::PkgIterator const Pkg = Ver.ParentPkg();
+ string descr;
strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), changelog_uri.c_str());
// queue it
new pkgAcqFile(&Fetcher, changelog_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile);
@@ -1531,7 +1525,7 @@ static bool DownloadChangelog(CacheFile &CacheFile, pkgAcquire &Fetcher,
if (!FileExists(targetfile))
{
string third_party_uri;
- if (GuessThirdPartyChangelogUri(CacheFile, Pkg, Ver, third_party_uri))
+ if (GuessThirdPartyChangelogUri(CacheFile, Ver, third_party_uri))
{
strprintf(descr, _("Changelog for %s (%s)"), Pkg.Name(), third_party_uri.c_str());
new pkgAcqFile(&Fetcher, third_party_uri, "", 0, descr, Pkg.Name(), "ignored", targetfile);
@@ -1556,7 +1550,7 @@ static bool DoChangelog(CommandLine &CmdL)
APT::CacheSetHelper helper(c0out);
APT::VersionList verset = APT::VersionList::FromCommandLine(Cache,
- CmdL.FileList + 1, APT::VersionList::CANDIDATE, helper);
+ CmdL.FileList + 1, APT::CacheSetHelper::CANDIDATE, helper);
if (verset.empty() == true)
return false;
pkgAcquire Fetcher;
@@ -1571,7 +1565,8 @@ static bool DoChangelog(CommandLine &CmdL)
}
AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
- Fetcher.Setup(&Stat);
+ if (Fetcher.Setup(&Stat, "",false) == false)
+ return false;
bool const downOnly = _config->FindB("APT::Get::Download-Only", false);
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index dd43ea1bc..b89df61d6 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -51,7 +51,8 @@ static bool DoDownloadFile(CommandLine &CmdL)
pkgAcquire Fetcher;
AcqTextStatus Stat(ScreenWidth, _config->FindI("quiet",0));
- Fetcher.Setup(&Stat);
+ if (Fetcher.Setup(&Stat, "", false) == false)
+ return false;
std::string download_uri = CmdL.FileList[1];
std::string targetfile = CmdL.FileList[2];
std::string hash;
diff --git a/cmdline/apt-internal-solver.cc b/cmdline/apt-internal-solver.cc
index c24a96cdf..0f2ec6283 100644
--- a/cmdline/apt-internal-solver.cc
+++ b/cmdline/apt-internal-solver.cc
@@ -175,10 +175,10 @@ int main(int argc,const char *argv[]) /*{{{*/
std::string failure;
if (upgrade == true) {
- if (pkgAllUpgrade(CacheFile) == false)
+ if (APT::Upgrade::Upgrade(CacheFile, APT::Upgrade::FORBID_REMOVE_PACKAGES | APT::Upgrade::FORBID_INSTALL_NEW_PACKAGES) == false)
failure = "ERR_UNSOLVABLE_UPGRADE";
} else if (distUpgrade == true) {
- if (pkgDistUpgrade(CacheFile) == false)
+ if (APT::Upgrade::Upgrade(CacheFile, APT::Upgrade::ALLOW_EVERYTHING) == false)
failure = "ERR_UNSOLVABLE_DIST_UPGRADE";
} else if (Fix.Resolve() == false)
failure = "ERR_UNSOLVABLE";
diff --git a/cmdline/apt-key.in b/cmdline/apt-key.in
index 0774cf4b7..83a7a31b9 100644
--- a/cmdline/apt-key.in
+++ b/cmdline/apt-key.in
@@ -3,29 +3,6 @@
set -e
unset GREP_OPTIONS
-GPG_CMD="gpg --ignore-time-conflict --no-options --no-default-keyring"
-
-# gpg needs (in different versions more or less) files to function correctly,
-# so we give it its own homedir and generate some valid content for it
-GPGHOMEDIR="$(mktemp -d)"
-CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';"
-trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
-chmod 700 "$GPGHOMEDIR"
-# We don't use a secret keyring, of course, but gpg panics and
-# implodes if there isn't one available - and writeable for imports
-SECRETKEYRING="${GPGHOMEDIR}/secring.gpg"
-touch $SECRETKEYRING
-GPG_CMD="$GPG_CMD --homedir $GPGHOMEDIR"
-# create the trustdb with an (empty) dummy keyring
-# older gpgs required it, newer gpgs even warn that it isn't needed,
-# but require it nonetheless for some commands, so we just play safe
-# here for the foreseeable future and create a dummy one
-$GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING >/dev/null 2>&1
-# tell gpg that it shouldn't try to maintain a trustdb file
-GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"
-
-GPG="$GPG_CMD"
-
APT_DIR="/"
eval $(apt-config shell APT_DIR Dir)
@@ -37,22 +14,26 @@ REMOVED_KEYS='&keyring-removed-filename;'
eval $(apt-config shell REMOVED_KEYS APT::Key::RemovedKeys)
ARCHIVE_KEYRING_URI='&keyring-uri;'
eval $(apt-config shell ARCHIVE_KEYRING_URI APT::Key::ArchiveKeyringURI)
-TMP_KEYRING=${APT_DIR}/var/lib/apt/keyrings/maybe-import-keyring.gpg
+
+aptkey_echo() { echo "$@"; }
requires_root() {
if [ "$(id -u)" -ne 0 ]; then
- echo >&1 "ERROR: This command can only be used by root."
+ echo >&2 "ERROR: This command can only be used by root."
exit 1
fi
}
-# gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead.
-init_keyring() {
- for path; do
- if ! [ -e "$path" ]; then
- touch -- "$path"
- chmod 0644 -- "$path"
- fi
+get_fingerprints_of_keyring() {
+ $GPG_CMD --keyring "$1" --with-colons --fingerprint | while read publine; do
+ # search for a public key
+ if [ "${publine%%:*}" != 'pub' ]; then continue; fi
+ # search for the associated fingerprint (should be the very next line)
+ while read fprline; do
+ if [ "${fprline%%:*}" = 'sub' ]; then break; # should never happen
+ elif [ "${fprline%%:*}" != 'fpr' ]; then continue; fi
+ echo "$fprline" | cut -d':' -f 10
+ done
done
}
@@ -61,11 +42,11 @@ add_keys_with_verify_against_master_keyring() {
MASTER=$2
if [ ! -f "$ADD_KEYRING" ]; then
- echo "ERROR: '$ADD_KEYRING' not found"
+ echo >&2 "ERROR: '$ADD_KEYRING' not found"
return
- fi
+ fi
if [ ! -f "$MASTER" ]; then
- echo "ERROR: '$MASTER' not found"
+ echo >&2 "ERROR: '$MASTER' not found"
return
fi
@@ -73,7 +54,7 @@ add_keys_with_verify_against_master_keyring() {
# is honored. so:
# all keys that are exported must have a valid signature
# from a key in the $distro-master-keyring
- add_keys=`$GPG_CMD --keyring $ADD_KEYRING --with-colons --list-keys | grep ^pub | cut -d: -f5`
+ add_keys="$(get_fingerprints_of_keyring "$ADD_KEYRING")"
all_add_keys=`$GPG_CMD --keyring $ADD_KEYRING --with-colons --list-keys | grep ^[ps]ub | cut -d: -f5`
master_keys=`$GPG_CMD --keyring $MASTER --with-colons --list-keys | grep ^pub | cut -d: -f5`
@@ -86,24 +67,28 @@ add_keys_with_verify_against_master_keyring() {
fi
done
done
-
+
for add_key in $add_keys; do
# export the add keyring one-by-one
- rm -f $TMP_KEYRING
- $GPG_CMD --keyring $ADD_KEYRING --output $TMP_KEYRING --export $add_key
- # check if signed with the master key and only add in this case
- ADDED=0
+ local TMP_KEYRING="${GPGHOMEDIR}/tmp-keyring.gpg"
+ $GPG_CMD --batch --yes --keyring "$ADD_KEYRING" --output "$TMP_KEYRING" --export "$add_key"
+ if ! $GPG_CMD --batch --yes --keyring "$TMP_KEYRING" --import "$MASTER" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
+ cat "${GPGHOMEDIR}/gpgoutput.log"
+ false
+ fi
+ # check if signed with the master key and only add in this case
+ ADDED=0
for master_key in $master_keys; do
- if $GPG_CMD --keyring $MASTER --keyring $TMP_KEYRING --check-sigs --with-colons $add_key | grep '^sig:!:' | cut -d: -f5 | grep -q $master_key; then
- $GPG --import $TMP_KEYRING
+ if $GPG_CMD --keyring $TMP_KEYRING --check-sigs --with-colons $add_key | grep '^sig:!:' | cut -d: -f5 | grep -q $master_key; then
+ $GPG_CMD --batch --yes --keyring "$ADD_KEYRING" --export "$add_key" | $GPG --batch --yes --import
ADDED=1
fi
done
if [ $ADDED = 0 ]; then
echo >&2 "Key '$add_key' not added. It is not signed with a master key"
fi
+ rm -f "${TMP_KEYRING}"
done
- rm -f $TMP_KEYRING
}
# update the current archive signing keyring from a network URI
@@ -121,7 +106,6 @@ net_update() {
echo >&2 "ERROR: Your distribution is not supported in net-update as no uri for the archive-keyring is set"
exit 1
fi
- requires_root
# in theory we would need to depend on wget for this, but this feature
# isn't useable in debian anyway as we have no keyring uri nor a master key
if ! which wget >/dev/null 2>&1; then
@@ -142,7 +126,7 @@ net_update() {
fi
new_mtime=$(stat -c %Y $keyring)
if [ $new_mtime -ne $old_mtime ]; then
- echo "Checking for new archive signing keys now"
+ aptkey_echo "Checking for new archive signing keys now"
add_keys_with_verify_against_master_keyring $keyring $MASTER_KEYRING
fi
}
@@ -153,7 +137,6 @@ update() {
echo >&2 "Is the &keyring-package; package installed?"
exit 1
fi
- requires_root
# add new keys from the package;
@@ -166,71 +149,159 @@ update() {
if [ -r "$REMOVED_KEYS" ]; then
# remove no-longer supported/used keys
- keys=`$GPG_CMD --keyring $REMOVED_KEYS --with-colons --list-keys | grep ^pub | cut -d: -f5`
- for key in $keys; do
- if $GPG --list-keys --with-colons | grep ^pub | cut -d: -f5 | grep -q $key; then
- $GPG --quiet --batch --delete-key --yes ${key}
- fi
+ get_fingerprints_of_keyring "$REMOVED_KEYS" | while read key; do
+ foreach_keyring_do 'remove_key_from_keyring' "$key"
done
else
- echo "Warning: removed keys keyring $REMOVED_KEYS missing or not readable" >&2
+ echo >&2 "Warning: removed keys keyring $REMOVED_KEYS missing or not readable"
fi
}
remove_key_from_keyring() {
- local GPG="$GPG_CMD --keyring $1"
- # check if the key is in this keyring: the key id is in the 5 column at the end
- if ! $GPG --with-colons --list-keys 2>&1 | grep -q "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]\+$2:"; then
- return
- fi
- if [ ! -w "$1" ]; then
- echo >&2 "Key ${2} is in keyring ${1}, but can't be removed as it is read only."
- return
+ local KEYRINGFILE="$1"
+ shift
+ # non-existent keyrings have by definition no keys
+ if [ ! -e "$KEYRINGFILE" ]; then
+ return
fi
- # check if it is the only key in the keyring and if so remove the keyring altogether
- if [ '1' = "$($GPG --with-colons --list-keys | grep "^pub:[^:]*:[^:]*:[^:]*:[0-9A-F]\+:" | wc -l)" ]; then
- mv -f "$1" "${1}~" # behave like gpg
- return
- fi
- # we can't just modify pointed to files as these might be in /usr or something
- local REALTARGET
- if [ -L "$1" ]; then
- REALTARGET="$(readlink -f "$1")"
- mv -f "$1" "${1}.dpkg-tmp"
- cp -a "$REALTARGET" "$1"
- ls "$(dirname $1)"
- fi
- # delete the key from the keyring
- $GPG --batch --delete-key --yes "$2"
- if [ -n "$REALTARGET" ]; then
- # the real backup is the old link, not the copy we made
- mv -f "${1}.dpkg-tmp" "${1}~"
- fi
-}
-remove_key() {
- requires_root
+ local GPG="$GPG_CMD --keyring $KEYRINGFILE"
+ for KEY in "$@"; do
+ # check if the key is in this keyring: the key id is in the 5 column at the end
+ if ! get_fingerprints_of_keyring "$KEYRINGFILE" | grep -q "^[0-9A-F]*${KEY}$"; then
+ continue
+ fi
+ if [ ! -w "$KEYRINGFILE" ]; then
+ echo >&2 "Key ${KEY} is in keyring ${KEYRINGFILE}, but can't be removed as it is read only."
+ continue
+ fi
+ # check if it is the only key in the keyring and if so remove the keyring altogether
+ if [ '1' = "$(get_fingerprints_of_keyring "$KEYRINGFILE" | wc -l)" ]; then
+ mv -f "$KEYRINGFILE" "${KEYRINGFILE}~" # behave like gpg
+ return
+ fi
+ # we can't just modify pointed to files as these might be in /usr or something
+ local REALTARGET
+ if [ -L "$KEYRINGFILE" ]; then
+ REALTARGET="$(readlink -f "$KEYRINGFILE")"
+ mv -f "$KEYRINGFILE" "${KEYRINGFILE}.dpkg-tmp"
+ cp -a "$REALTARGET" "$KEYRINGFILE"
+ fi
+ # delete the key from the keyring
+ $GPG --batch --delete-key --yes "$KEY"
+ if [ -n "$REALTARGET" ]; then
+ # the real backup is the old link, not the copy we made
+ mv -f "${KEYRINGFILE}.dpkg-tmp" "${KEYRINGFILE}~"
+ fi
+ done
+}
- # if a --keyring was given, just remove from there
- if [ -n "$FORCED_KEYRING" ]; then
- remove_key_from_keyring "$FORCED_KEYRING" "$1"
- else
+foreach_keyring_do() {
+ local ACTION="$1"
+ shift
+ # if a --keyring was given, just remove from there
+ if [ -n "$FORCED_KEYRING" ]; then
+ $ACTION "$FORCED_KEYRING" "$@"
+ else
# otherwise all known keyrings are up for inspection
- local TRUSTEDFILE="/etc/apt/trusted.gpg"
- eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
- eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
- remove_key_from_keyring "$TRUSTEDFILE" "$1"
- TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
+ if [ -s "$TRUSTEDFILE" ]; then
+ $ACTION "$TRUSTEDFILE" "$@"
+ fi
+ local TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
if [ -d "$TRUSTEDPARTS" ]; then
+ # strip / suffix as gpg will double-slash in that case (#665411)
+ local STRIPPED_TRUSTEDPARTS="${TRUSTEDPARTS%/}"
+ if [ "${STRIPPED_TRUSTEDPARTS}/" = "$TRUSTEDPARTS" ]; then
+ TRUSTEDPARTS="$STRIPPED_TRUSTEDPARTS"
+ fi
for trusted in $(run-parts --list "$TRUSTEDPARTS" --regex '^.*\.gpg$'); do
- remove_key_from_keyring "$trusted" "$1"
+ if [ -s "$trusted" ]; then
+ $ACTION "$trusted" "$@"
+ fi
done
fi
+ fi
+}
+
+run_cmd_on_keyring() {
+ local KEYRINGFILE="$1"
+ shift
+ # fingerprint and co will fail if key isn't in this keyring
+ $GPG_CMD --keyring "$KEYRINGFILE" --batch "$@" 2>/dev/null || true
+}
+
+import_keys_from_keyring() {
+ local IMPORT="$1"
+ local KEYRINGFILE="$2"
+ if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
+ cat "${GPGHOMEDIR}/gpgoutput.log"
+ false
fi
- echo "OK"
}
+merge_keys_into_keyrings() {
+ local KEYRINGFILE="$1"
+ local IMPORT="$2"
+ if ! $GPG_CMD --keyring "$KEYRINGFILE" --batch --import --import-options 'merge-only' "$IMPORT" > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
+ cat "${GPGHOMEDIR}/gpgoutput.log"
+ false
+ fi
+}
+
+merge_back_changes() {
+ if [ -n "$FORCED_KEYRING" ]; then
+ # if the keyring was forced merge is already done
+ return
+ fi
+ if [ -s "${GPGHOMEDIR}/pubring.gpg" ]; then
+ # merge all updated keys
+ foreach_keyring_do 'merge_keys_into_keyrings' "${GPGHOMEDIR}/pubring.gpg"
+ fi
+ # look for keys which were added or removed
+ get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.orig.gpg" > "${GPGHOMEDIR}/pubring.orig.keylst"
+ get_fingerprints_of_keyring "${GPGHOMEDIR}/pubring.gpg" > "${GPGHOMEDIR}/pubring.keylst"
+ sort "${GPGHOMEDIR}/pubring.keylst" "${GPGHOMEDIR}/pubring.orig.keylst" | uniq --unique | while read key; do
+ if grep -q "^${key}$" "${GPGHOMEDIR}/pubring.orig.keylst"; then
+ # key isn't part of new keyring, so remove
+ foreach_keyring_do 'remove_key_from_keyring' "$key"
+ elif grep -q "^${key}$" "${GPGHOMEDIR}/pubring.keylst"; then
+ # key is part of new keyring, so we need to import it
+ create_new_keyring "$TRUSTEDFILE"
+ if ! $GPG --batch --yes --export "$key" | $GPG_CMD --keyring "$TRUSTEDFILE" --batch --yes --import > "${GPGHOMEDIR}/gpgoutput.log" 2>&1; then
+ cat "${GPGHOMEDIR}/gpgoutput.log"
+ false
+ fi
+ else
+ echo >&2 "Errror: Key ${key} (dis)appeared out of nowhere"
+ fi
+ done
+}
+
+setup_merged_keyring() {
+ if [ -z "$FORCED_KEYRING" ]; then
+ foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg"
+ if [ -r "${GPGHOMEDIR}/pubring.gpg" ]; then
+ cp -a "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg"
+ else
+ touch "${GPGHOMEDIR}/pubring.gpg" "${GPGHOMEDIR}/pubring.orig.gpg"
+ fi
+ GPG="$GPG --keyring ${GPGHOMEDIR}/pubring.gpg"
+ else
+ GPG="$GPG --keyring $TRUSTEDFILE"
+ create_new_keyring "$TRUSTEDFILE"
+ fi
+}
+
+create_new_keyring() {
+ # gpg defaults to mode 0600 for new keyrings. Create one with 0644 instead.
+ if ! [ -e "$TRUSTEDFILE" ]; then
+ if [ -w "$(dirname "$TRUSTEDFILE")" ]; then
+ touch -- "$TRUSTEDFILE"
+ chmod 0644 -- "$TRUSTEDFILE"
+ fi
+ fi
+}
usage() {
echo "Usage: apt-key [--keyring file] [command] [arguments]"
@@ -256,17 +327,19 @@ while [ -n "$1" ]; do
shift
TRUSTEDFILE="$1"
FORCED_KEYRING="$1"
- if [ -r "$TRUSTEDFILE" ] || [ "$2" = 'add' ] || [ "$2" = 'adv' ]; then
- GPG="$GPG --keyring $TRUSTEDFILE --primary-keyring $TRUSTEDFILE"
- else
- echo >&2 "Error: The specified keyring »$TRUSTEDFILE« is missing or not readable"
- exit 1
- fi
+ ;;
+ --secret-keyring)
shift
+ FORCED_SECRET_KEYRING="$1"
+ ;;
+ --readonly)
+ merge_back_changes() { true; }
;;
--fakeroot)
requires_root() { true; }
- shift
+ ;;
+ --quiet)
+ aptkey_echo() { true; }
;;
--*)
echo >&2 "Unknown option: $1"
@@ -275,28 +348,13 @@ while [ -n "$1" ]; do
*)
break;;
esac
+ shift
done
if [ -z "$TRUSTEDFILE" ]; then
TRUSTEDFILE="/etc/apt/trusted.gpg"
eval $(apt-config shell TRUSTEDFILE Apt::GPGV::TrustedKeyring)
eval $(apt-config shell TRUSTEDFILE Dir::Etc::Trusted/f)
- if [ -r "$TRUSTEDFILE" ]; then
- GPG="$GPG --keyring $TRUSTEDFILE"
- fi
- GPG="$GPG --primary-keyring $TRUSTEDFILE"
- TRUSTEDPARTS="/etc/apt/trusted.gpg.d"
- eval $(apt-config shell TRUSTEDPARTS Dir::Etc::TrustedParts/d)
- if [ -d "$TRUSTEDPARTS" ]; then
- # strip / suffix as gpg will double-slash in that case (#665411)
- STRIPPED_TRUSTEDPARTS="${TRUSTEDPARTS%/}"
- if [ "${STRIPPED_TRUSTEDPARTS}/" = "$TRUSTEDPARTS" ]; then
- TRUSTEDPARTS="$STRIPPED_TRUSTEDPARTS"
- fi
- for trusted in $(run-parts --list "$TRUSTEDPARTS" --regex '^.*\.gpg$'); do
- GPG="$GPG --keyring $trusted"
- done
- fi
fi
command="$1"
@@ -306,52 +364,100 @@ if [ -z "$command" ]; then
fi
shift
-if [ "$command" != "help" ] && ! which gpg >/dev/null 2>&1; then
- echo >&2 "Warning: gnupg does not seem to be installed."
- echo >&2 "Warning: apt-key requires gnupg for most operations."
- echo >&2
+if [ "$command" != "help" ]; then
+ eval $(apt-config shell GPG_EXE Apt::Key::gpgcommand)
+
+ if [ -n "$GPG_EXE" ] && which "$GPG_EXE" >/dev/null 2>&1; then
+ true
+ elif which gpg >/dev/null 2>&1; then
+ GPG_EXE="gpg"
+ elif which gpg2 >/dev/null 2>&1; then
+ GPG_EXE="gpg2"
+ else
+ echo >&2 "Error: gnupg or gnupg2 do not seem to be installed,"
+ echo >&2 "Error: but apt-key requires gnupg or gnupg2 for operation."
+ echo >&2
+ exit 255
+ fi
+
+ GPG_CMD="$GPG_EXE --ignore-time-conflict --no-options --no-default-keyring"
+
+ # gpg needs (in different versions more or less) files to function correctly,
+ # so we give it its own homedir and generate some valid content for it
+ GPGHOMEDIR="$(mktemp -d)"
+ CURRENTTRAP="${CURRENTTRAP} rm -rf '${GPGHOMEDIR}';"
+ trap "${CURRENTTRAP}" 0 HUP INT QUIT ILL ABRT FPE SEGV PIPE TERM
+ chmod 700 "$GPGHOMEDIR"
+ # We don't use a secret keyring, of course, but gpg panics and
+ # implodes if there isn't one available - and writeable for imports
+ SECRETKEYRING="${GPGHOMEDIR}/secring.gpg"
+ touch $SECRETKEYRING
+ GPG_CMD="$GPG_CMD --homedir $GPGHOMEDIR"
+ # create the trustdb with an (empty) dummy keyring
+ # older gpgs required it, newer gpgs even warn that it isn't needed,
+ # but require it nonetheless for some commands, so we just play safe
+ # here for the foreseeable future and create a dummy one
+ $GPG_CMD --quiet --check-trustdb --keyring $SECRETKEYRING >/dev/null 2>&1
+ # tell gpg that it shouldn't try to maintain a trustdb file
+ GPG_CMD="$GPG_CMD --no-auto-check-trustdb --trust-model always"
+ GPG="$GPG_CMD"
+
+ # for advanced operations, we might really need a secret keyring after all
+ if [ -n "$FORCED_SECRET_KEYRING" ] && [ -r "$FORCED_SECRET_KEYRING" ]; then
+ rm -f "$SECRETKEYRING"
+ cp -a "$FORCED_SECRET_KEYRING" "$SECRETKEYRING"
+ fi
fi
case "$command" in
add)
- requires_root
- init_keyring "$TRUSTEDFILE"
- $GPG --quiet --batch --import "$1"
- echo "OK"
+ requires_root
+ setup_merged_keyring
+ $GPG --quiet --batch --import "$@"
+ merge_back_changes
+ aptkey_echo "OK"
;;
del|rm|remove)
- init_keyring "$TRUSTEDFILE"
- remove_key "$1"
+ requires_root
+ foreach_keyring_do 'remove_key_from_keyring' "$@"
+ aptkey_echo "OK"
;;
update)
- init_keyring "$TRUSTEDFILE"
+ requires_root
+ setup_merged_keyring
update
+ merge_back_changes
;;
net-update)
- init_keyring "$TRUSTEDFILE"
+ requires_root
+ setup_merged_keyring
net_update
+ merge_back_changes
;;
list)
- init_keyring "$TRUSTEDFILE"
- $GPG --batch --list-keys
- ;;
+ foreach_keyring_do 'run_cmd_on_keyring' --list-keys "$@"
+ ;;
finger*)
- init_keyring "$TRUSTEDFILE"
- $GPG --batch --fingerprint
- ;;
- export)
- init_keyring "$TRUSTEDFILE"
- $GPG --armor --export "$1"
- ;;
- exportall)
- init_keyring "$TRUSTEDFILE"
- $GPG --armor --export
- ;;
+ foreach_keyring_do 'run_cmd_on_keyring' --fingerprint "$@"
+ ;;
+ export|exportall)
+ foreach_keyring_do 'import_keys_from_keyring' "${GPGHOMEDIR}/pubring.gpg"
+ $GPG_CMD --keyring "${GPGHOMEDIR}/pubring.gpg" --armor --export "$@"
+ ;;
adv*)
- init_keyring "$TRUSTEDFILE"
- echo "Executing: $GPG $*"
- $GPG $*
- ;;
+ setup_merged_keyring
+ aptkey_echo "Executing: $GPG $*"
+ $GPG "$@"
+ merge_back_changes
+ ;;
+ verify)
+ setup_merged_keyring
+ if which gpgv >/dev/null 2>&1; then
+ gpgv --homedir "${GPGHOMEDIR}" --keyring "${GPGHOMEDIR}/pubring.gpg" --ignore-time-conflict "$@"
+ else
+ $GPG --verify "$@"
+ fi
+ ;;
help)
usage
;;
diff --git a/debian/apt.postinst b/debian/apt.postinst
index fab026504..01f78a1dd 100644..100755
--- a/debian/apt.postinst
+++ b/debian/apt.postinst
@@ -15,6 +15,15 @@ set -e
case "$1" in
configure)
+ if dpkg --compare-versions "$2" lt 1.0.7; then
+ # apt-key before 0.9.10 could leave empty keyrings around
+ find /etc/apt/trusted.gpg.d/ -name '*.gpg' | while read keyring; do
+ if ! test -s "$keyring"; then
+ rm -f "$keyring"
+ fi
+ done
+ fi
+
if dpkg --compare-versions "$2" lt-nl 0.9.9.5; then
# we are using tmpfiles for both
rm -f /etc/apt/trustdb.gpg
@@ -27,8 +36,8 @@ case "$1" in
fi
# add unprivileged user for the apt methods
- adduser --force-badname --system --no-create-home \
- --quiet _apt || true
+ adduser --force-badname --system -home /var/empty \
+ --no-create-home --quiet _apt || true
chown -R _apt:root \
/var/lib/apt/lists \
/var/cache/apt/archives
diff --git a/debian/postrm b/debian/apt.postrm
index ae1e18d33..ae1e18d33 100755
--- a/debian/postrm
+++ b/debian/apt.postrm
diff --git a/debian/control b/debian/control
index 51bb85d30..d95e56f92 100644
--- a/debian/control
+++ b/debian/control
@@ -18,7 +18,7 @@ XS-Testsuite: autopkgtest
Package: apt
Architecture: any
-Depends: ${shlibs:Depends}, ${misc:Depends}, ${apt:keyring}, gnupg
+Depends: ${shlibs:Depends}, ${misc:Depends}, ${apt:keyring}, gnupg | gnupg2, adduser
Replaces: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~), sun-java6-jdk (>> 0), sun-java5-jdk (>> 0), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~)
Breaks: manpages-pl (<< 20060617-3~), manpages-it (<< 2.80-4~), sun-java6-jdk (>> 0), sun-java5-jdk (>> 0), openjdk-6-jdk (<< 6b24-1.11-0ubuntu1~)
Conflicts: python-apt (<< 0.7.93.2~)
@@ -43,7 +43,7 @@ Architecture: any
Multi-Arch: same
Pre-Depends: ${misc:Pre-Depends}
Depends: ${shlibs:Depends}, ${misc:Depends}
-Breaks: apt (<< 0.9.4~), libapt-inst1.5 (<< 0.9.9~)
+Breaks: apt (<< 1.0.2~), libapt-inst1.5 (<< 0.9.9~)
Section: libs
Description: package management runtime library
This library provides the common functionality for searching and
diff --git a/debian/postinst b/debian/postinst
deleted file mode 100755
index 1588f5241..000000000
--- a/debian/postinst
+++ /dev/null
@@ -1,39 +0,0 @@
-#! /bin/sh
-
-# apt postinst, based liberally on James Troup's gpm postinst
-# Copyright (C) 1998, Ben Gertzfield <che@debian.org>
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-
-set -e
-
-create_apt_conf ()
-{
- EXAMPLE_SOURCE=/usr/share/doc/apt/examples/sources.list
- if [ -f $EXAMPLE_SOURCE ]; then
- cp $EXAMPLE_SOURCE /etc/apt/sources.list
- fi
-}
-
-check_apt_conf ()
-{
- true
- # this is for future expansion
-}
-
-#DEBHELPER#
-
-case "$1" in
- configure)
- #
- # If there is no /etc/apt/sources.list then create a default
- #
- if [ ! -f /etc/apt/sources.list ]; then
- create_apt_conf
- else
- check_apt_conf
- fi
-esac
diff --git a/debian/tests/control b/debian/tests/control
index f7e47c5f3..0e774d4ca 100644
--- a/debian/tests/control
+++ b/debian/tests/control
@@ -1,3 +1,3 @@
Tests: run-tests
-Restrictions: allow-stderr
-Depends: @, @builddeps@, fakeroot, wget, stunnel4, db-util
+Restrictions: allow-stderr
+Depends: @, @builddeps@, fakeroot, wget, stunnel4, db-util, gnupg, gnupg2
diff --git a/doc/Doxyfile.in b/doc/Doxyfile.in
index 98eecdbd2..ab3fc0a7c 100644
--- a/doc/Doxyfile.in
+++ b/doc/Doxyfile.in
@@ -152,7 +152,7 @@ FULL_PATH_NAMES = YES
# will be relative from the directory where doxygen is started.
# This tag requires that the tag FULL_PATH_NAMES is set to YES.
-STRIP_FROM_PATH =
+STRIP_FROM_PATH = @top_srcdir@
# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the
# path mentioned in the documentation of a class, which tells the reader which
@@ -161,7 +161,7 @@ STRIP_FROM_PATH =
# specify the list of include paths that are normally passed to the compiler
# using the -I flag.
-STRIP_FROM_INC_PATH =
+STRIP_FROM_INC_PATH = @top_srcdir@
# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but
# less readable) file names. This can be useful is your file systems doesn't
diff --git a/ftparchive/cachedb.cc b/ftparchive/cachedb.cc
index 7770a3244..da45eb8d2 100644
--- a/ftparchive/cachedb.cc
+++ b/ftparchive/cachedb.cc
@@ -34,18 +34,18 @@
#include <apti18n.h>
/*}}}*/
-CacheDB::CacheDB(std::string const &DB)
+CacheDB::CacheDB(std::string const &DB)
: Dbp(0), Fd(NULL), DebFile(0)
{
TmpKey[0]='\0';
ReadyDB(DB);
-};
+}
CacheDB::~CacheDB()
{
ReadyDB();
delete DebFile;
-};
+}
// CacheDB::ReadyDB - Ready the DB2 /*{{{*/
// ---------------------------------------------------------------------
diff --git a/ftparchive/cachedb.h b/ftparchive/cachedb.h
index b40fd7df7..613963f6f 100644
--- a/ftparchive/cachedb.h
+++ b/ftparchive/cachedb.h
@@ -99,8 +99,8 @@ class CacheDB
// Stat info stored in the DB, Fixed types since it is written to disk.
enum FlagList {FlControl = (1<<0),FlMD5=(1<<1),FlContents=(1<<2),
- FlSize=(1<<3), FlSHA1=(1<<4), FlSHA256=(1<<5),
- FlSHA512=(1<<6), FlSource=(1<<7),
+ FlSize=(1<<3), FlSHA1=(1<<4), FlSHA256=(1<<5),
+ FlSHA512=(1<<6), FlSource=(1<<7)
};
// the on-disk format changed (FileSize increased to 64bit) in
diff --git a/ftparchive/contents.cc b/ftparchive/contents.cc
index 91dd2b8bd..8c4181eda 100644
--- a/ftparchive/contents.cc
+++ b/ftparchive/contents.cc
@@ -302,17 +302,17 @@ void GenContents::DoPrint(FILE *Out,GenContents::Node *Top, char *Buf)
DoPrint(Out,Top->BTreeRight,Buf);
}
/*}}}*/
-// ContentsExtract Constructor /*{{{*/
+// ContentsExtract Constructor /*{{{*/
ContentsExtract::ContentsExtract()
- : Data(0), MaxSize(0), CurSize(0)
+ : Data(0), MaxSize(0), CurSize(0)
{
-};
+}
/*}}}*/
-// ContentsExtract Destructor /*{{{*/
+// ContentsExtract Destructor /*{{{*/
ContentsExtract::~ContentsExtract()
{
free(Data);
-};
+}
/*}}}*/
// ContentsExtract::Read - Read the archive /*{{{*/
// ---------------------------------------------------------------------
diff --git a/ftparchive/sources.h b/ftparchive/sources.h
index 91e0b1376..9ada15728 100644
--- a/ftparchive/sources.h
+++ b/ftparchive/sources.h
@@ -17,7 +17,7 @@ class DscExtract
bool TakeDsc(const void *Data, unsigned long Size);
bool Read(std::string FileName);
- DscExtract() : Data(0), Length(0) {
+ DscExtract() : Data(0), Length(0), IsClearSigned(false) {
Data = new char[maxSize];
};
~DscExtract() {
diff --git a/methods/copy.cc b/methods/copy.cc
index faf330ace..a23c0316c 100644
--- a/methods/copy.cc
+++ b/methods/copy.cc
@@ -37,15 +37,12 @@ class CopyMethod : public pkgAcqMethod
void CopyMethod::CalculateHashes(FetchResult &Res)
{
- // For gzip indexes we need to look inside the gzip for the hash
- // We can not use the extension here as its not used in partial
- // on a IMS hit
- FileFd::OpenMode OpenMode = FileFd::ReadOnly;
+ Hashes Hash;
+ FileFd::CompressMode CompressMode = FileFd::None;
if (_config->FindB("Acquire::GzipIndexes", false) == true)
- OpenMode = FileFd::ReadOnlyGzip;
+ CompressMode = FileFd::Extension;
- Hashes Hash;
- FileFd Fd(Res.Filename, OpenMode);
+ FileFd Fd(Res.Filename, FileFd::ReadOnly, CompressMode);
Hash.AddFD(Fd);
Res.TakeHashes(Hash);
}
@@ -128,6 +125,5 @@ int main()
CopyMethod Mth;
- Mth.DropPrivsOrDie();
return Mth.Run();
}
diff --git a/methods/ftp.cc b/methods/ftp.cc
index a658b5657..ac76295f0 100644
--- a/methods/ftp.cc
+++ b/methods/ftp.cc
@@ -75,9 +75,10 @@ time_t FtpMethod::FailTime = 0;
// FTPConn::FTPConn - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* */
-FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
+FTPConn::FTPConn(URI Srv) : Len(0), ServerFd(-1), DataFd(-1),
DataListenFd(-1), ServerName(Srv),
- ForceExtended(false), TryPassive(true)
+ ForceExtended(false), TryPassive(true),
+ PeerAddrLen(0), ServerAddrLen(0)
{
Debug = _config->FindB("Debug::Acquire::Ftp",false);
PasvAddr = 0;
diff --git a/methods/gpgv.cc b/methods/gpgv.cc
index 72e4c7987..7e8500c51 100644
--- a/methods/gpgv.cc
+++ b/methods/gpgv.cc
@@ -75,7 +75,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
FILE *pipein = fdopen(fd[0], "r");
- // Loop over the output of gpgv, and check the signatures.
+ // Loop over the output of apt-key (which really is gnupg), and check the signatures.
size_t buffersize = 64;
char *buffer = (char *) malloc(buffersize);
size_t bufferoff = 0;
@@ -172,7 +172,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
else if (WEXITSTATUS(status) == 1)
return _("At least one invalid signature was encountered.");
else if (WEXITSTATUS(status) == 111)
- return _("Could not execute 'gpgv' to verify signature (is gpgv installed?)");
+ return _("Could not execute 'apt-key' to verify signature (is gnupg installed?)");
else if (WEXITSTATUS(status) == 112)
{
// acquire system checks for "NODATA" to generate GPG errors (the others are only warnings)
@@ -182,7 +182,7 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile,
return errmsg;
}
else
- return _("Unknown error executing gpgv");
+ return _("Unknown error executing apt-key");
}
bool GPGVMethod::Fetch(FetchItem *Itm)
@@ -200,7 +200,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
Res.Filename = Itm->DestFile;
URIStart(Res);
- // Run gpgv on file, extract contents and get the key ID of the signer
+ // Run apt-key on file, extract contents and get the key ID of the signer
string msg = VerifyGetSigners(Path.c_str(), Itm->DestFile.c_str(),
GoodSigners, BadSigners, WorthlessSigners,
NoPubKeySigners);
@@ -252,7 +252,7 @@ bool GPGVMethod::Fetch(FetchItem *Itm)
if (_config->FindB("Debug::Acquire::gpgv", false))
{
- std::clog << "gpgv succeeded\n";
+ std::clog << "apt-key succeeded\n";
}
return true;
diff --git a/methods/https.h b/methods/https.h
index faac8a3cd..45d1f7f63 100644
--- a/methods/https.h
+++ b/methods/https.h
@@ -69,10 +69,9 @@ class HttpsMethod : public pkgAcqMethod
public:
FileFd *File;
-
- HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), File(NULL)
+
+ HttpsMethod() : pkgAcqMethod("1.2",Pipeline | SendConfig), Server(NULL), File(NULL)
{
- File = 0;
curl = curl_easy_init();
};
diff --git a/methods/server.cc b/methods/server.cc
index ff67eb09b..4a961f454 100644
--- a/methods/server.cc
+++ b/methods/server.cc
@@ -324,10 +324,10 @@ ServerMethod::DealWithHeaders(FetchResult &Res)
failure */
if (Server->Result < 200 || Server->Result >= 300)
{
- char err[255];
- snprintf(err,sizeof(err)-1,"HttpError%i",Server->Result);
+ std::string err;
+ strprintf(err, "HttpError%u", Server->Result);
SetFailReason(err);
- _error->Error("%u %s",Server->Result,Server->Code);
+ _error->Error("%u %s", Server->Result, Server->Code);
if (Server->HaveContent == true)
return ERROR_WITH_CONTENT_PAGE;
return ERROR_UNRECOVERABLE;
diff --git a/po/ChangeLog b/po/ChangeLog
deleted file mode 100644
index 373ef4ca6..000000000
--- a/po/ChangeLog
+++ /dev/null
@@ -1,1077 +0,0 @@
-2009-09-26 Christian Perrier <bubulle@debian.org>
-
- * LINGUAS: re-disabled Hebrew translation on translator's request.
-
-2009-06-05 Jordi Mallach <jordi@debian.org>
-
- * ca.po: Updated to 539t
-
-2009-06-04 Milo Casagrande <milo@ubuntu.com>
-
- * it.po: Updated to 539t
-
-2009-06-01 Deng Xiyue <manphiz-guest@users.alioth.debian.org>
-
- * zh_CN.po: Updated to 539t
-
-2009-05-21 Marcos <marcos.alvarez.costales@gmail.com>
-
- * ast.po: Updated to 539t
-
-2009-04-28 Ivan Masár <helix84@centrum.sk>
-
- * sk.po: Updated to 539t
-
-2009-04-23 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 545 strings.
- Formerly complete PO files are now 539t1f6u
- * fr.po: updated to 545t.
-
-2009-03-19 Ivan Masár <helix84@centrum.sk>
-
- * sk.po: Updated to 539t
-
-2009-03-04 Daniel Nylander <po@danielnylander.se>
-
- * sv.po: Updated to 539t
-
-2009-02-23 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 539 strings.
- Formerly complete PO files are now 538t1u
- * fr.po: updated to 539t.
-
-2009-02-01 Hans Fredrik Nordhaug <hans@nordhaug.priv.no>
-
- * nb.po: updated to 539t.
-
-2009-01-27 Damyan Ivanov <dmn@debian.org>
-
- * bg.po: updated to 539t.
-
-2008-12-11 Christian Perrier <bubulle@debian.org>
-
- * fr.po: fix spelling error to "défectueux"
-
-2009-01-04 Tetralet <tetralet@gmail.com>
-
- * zh_TW.po: Added as 538t1u.
-
-2008-12-22 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: updated to 539t.
-
-2008-12-22 Jordi Mallach <jordi@debian.org>
-
- * ca.po: updated to 539t.
-
-2008-12-19 Marcelino Villarino <mvillarino@gmail.com>
-
- * gl.po: updated to 539t.
-
-2008-12-12 Tapio Lehtonen <tale@debian.org>
-
- * fi.po: updated to 539t.
-
-2008-12-06 Christian Perrier <bubulle@debian.org>
-
- * fr.po: dropped awful use of first person
-
-2008-11-23 Artem Bondarenko <artem.brz@gmail.com>
-
- * uk.po: updated to 477t55f7u
-
-2008-11-23 Sampada Nakhare <sampadanakhare@gmail.com>
-
- * mr.po: updated to 539t
-
-2008-11-21 Yuri Kozlov <kozlov.y@gmail.com>
-
- * ru.po: Update to 539t
-
-2008-11-18 Piarres Beobide <pi@beobide.net>
-
- * eu.po: updated to 539t.
-
-2008-11-17 Felipe Augusto van de Wiel (faw) <faw@debian.org>
-
- * pt_BR.po: updated to 539t.
-
-2008-11-17 Hans Fredrik Nordhaug <hans@nordhaug.priv.no>
-
- * nb.po: updated to 539t.
-
-2008-11-17 Miroslav Kure <kurem@upcase.inf.upol.cz>
-
- * cs.po: updated to 539t.
-
-2008-11-17 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: Updated to 539t
-
-2008-11-16 Javier Fernandez-Sanguino <jfs@debian.org>
-
- * es.po: updated to 539t
-
-2008-11-15 Deng Xiyue <manphiz-guest@users.alioth.debian.org>
-
- * zh_CN.po: updated to 539t.
-
-2008-11-15 Eddy Petrișor <eddy.petrisor@gmail.com>
-
- * ro.po: updated to 539t.
-
-2008-11-15 Javier Fernandez-Sanguino <jfs@debian.org>
-
- * es.po: updated to 536t3f2u
-
-2008-11-14 Holger Wansing <linux@wansing-online.de>
-
- * de.po: Updated to 539t
-
-2008-11-14 Wiktor Wandachowicz <siryes@gmail.com>
-
- * pl.po: Updated to 539t
-
-2008-11-14 Neil Williams <linux@codehelp.co.uk>
-
- * en_GB.po: Updated to 539t
-
-2008-11-14 Samuele Giovanni Tonon <samu@debian.org>
-
- * it.po: Updated to 539t
-
-2008-11-14 Jordi Mallach <jordi@debian.org>
-
- * ca.po: Updated to 539t
-
-2008-11-14 Changwoo Ryu <cwryu@debian.org>
-
- * ko.po: Updated to 539t
-
-2008-11-14 Kenshi Muto <kmuto@debian.org>
-
- * ja.po: Updated to 539t
-
-2008-11-14 Daniel Nylander <po@danielnylander.se>
-
- * sv.po: Updated to 539t
-
-2008-11-14 Ivan Masár <helix84@centrum.sk>
-
- * sk.po: Updated to 539t
-
-2008-11-13 Damyan Ivanov <dmn@debian.org>
-
- * bg.po: Updated to 538t1f
-
-2008-11-13 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 538 strings.
- Formerly complete PO files are now 538t1f
- * French translation re-completed
-
-2008-11-09 Theppitak Karoonboonyanan <thep@linux.thai.net>
-
- * th.po: updated to 540t.
-
-2008-11-06 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 540 strings.
- Formerly complete PO files are now 538t1f1u
-
-2008-09-19 Jordi Mallach <jordi@debian.org>
-
- * ca.po: Update to 538t
-
-2008-09-16 Wiktor Wandachowicz <siryes@gmail.com>
-
- * pl.po: Update to 538t
-
-2008-09-16 Yuri Kozlov <kozlov.y@gmail.com>
-
- * ru.po: Update to 538t
-
-2008-09-12 Emmanuel Galatoulas <galaxico@quad-nrg.net>
-
- * el.po: Update to 538t
-
-2008-09-10 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: Updated to 538t
-
-2008-09-05 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: updated to 538t.
-
-2008-09-01 Hans Fredrik Nordhaug <hans@nordhaug.priv.no>
-
- * nb.po: updated to 538t.
-
-2008-08-31 Miroslav Kure <kurem@upcase.inf.upol.cz>
-
- * cs.po: updated to 538t.
-
-2008-08-28 Piarres Beobide <pi@beobide.net>
-
- * eu.po: updated to 538t.
-
-2008-08-26 Felipe Augusto van de Wiel (faw) <faw@debian.org>
-
- * pt_BR.po: updated to 538t.
-
-2008-08-18 Deng Xiyue <manphiz-guest@users.alioth.debian.org>
-
- * zh_CN.po: updated to 538t.
-
-2008-08-07 Serafeim Zanikolas <serzan@hellug.gr>
-
- * el.po: updated to 534t3f1u.
-
-2008-08-02 Gintautas Miliauskas <gintas@akl.lt>
-
- * lt.po: updated to 300t4f234u.
-
-2008-08-01 Kenshi Muto <kmuto@debian.org>
-
- * ja.po: updated to 538t.
-
-2008-07-28 Eddy Petrisor <eddy.petrisor@gmail.com>
-
- * ro.po: updated to 538t.
-
-2008-07-28 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: updated to 538t.
-
-2008-07-27 Ivan Masár <helix84@centrum.sk>
-
- * sk.po: Updated to 538t
-
-2008-07-26 Damyan Ivanov <dmn@debian.org>
-
- * bg.po: Updated to 538t
-
-2008-07-26 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Updated to 538t
-
-2008-07-25 Michael Vogt <mvo@debian.org>
-
- * Update all PO files and apt-all.pot. 538 strings.
- Formerly complete PO files are now 536t1f1u
-
-2008-07-21 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: Updated to 536t
-
-2008-07-19 Changwoo Ryu <cwryu@debian.org>
-
- * ko.po: Updated to 536t
-
-2008-07-12 Holger Wansing <linux@wansing-online.de>
-
- * de.po: corrected.
-
-2008-06-29 Asho Yeh <asho@debian.org.tw>
-
- * zh_TW.po: Updated to 536t
-
-2008-06-27 Eddy Petrisor <eddy.petrisor@gmail.com>
-
- * ro.po: updated to 536t.
-
-2008-05-14 Hans Fr. Nordhaug <hans@nordhaug.priv.no>
-
- * nb.po: updated to 536t.
-
-2008-05-11 SZERVÁC Attila <sas@321.hu>
-
- * hu.po: updated to 536t.
-
-2008-05-11 Felipe Augusto van de Wiel (faw) <faw@debian.org>
-
- * pt_BR.po: updated to 536t.
-
-2008-05-08 Erdal Ronahi <erdal dot ronahi at gmail dot com>
-
- * ku.po: updated to 136t25f343u
-
-2008-05-08 Bart Cornelis <cobaco@skolelinux.no>
-
- * nl.po: updated to 536t.
-
-2008-05-07 Jens Seidel <jensseidel@users.sf.net>
-
- * de.po: updated to 536t.
-
-2008-05-07 Peter Karlsson <peterk@debian.org>
-
- * sv.po: updated to 536t.
-
-2008-05-07 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: updated to 536t.
-
-2008-05-07 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: updated to 536t.
-
-2008-05-07 Yuri Kozlov <kozlov.y@gmail.com>
-
- * ru.po: updated to 536t.
-
-2008-05-07 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: updated to 536t.
-
-2008-05-06 Peter Mann <Peter.Mann@tuke.sk>
-
- * sk.po: updated to 536t.
-
-2008-05-06 Miroslav Kure <kurem@upcase.inf.upol.cz>
-
- * cs.po: updated to 536t.
-
-2008-05-06 Kenshi Muto <kmuto@debian.org>
-
- * ja.po: updated to 536t.
-
-2008-05-05 Piarres Beobide <pi@beobide.net>
-
- * eu.po: updated to 536t.
-
-2008-05-05 Sunjae Park <darehanl@gmail.com>
-
- * ko.po: updated to 536t.
-
-2008-05-05 Tapio Lehtonen <tale@debian.org>
-
- * fi.po: updated to 536t.
-
-2008-05-04 Damyan Ivanov <dmn@debiian.org>
-
- * bg.po: updated to 536t.
-
-2008-05-04 Samuele Giovanni Tonon <samu@debian.org>
-
- * it.po: updated to 536t.
-
-2008-05-04 Wiktor Wandachowicz <siryes@gmail.com>
-
- * pl.po: updated to 536t.
-
-2008-05-04 Theppitak Karoonboonyanan <thep@linux.thai.net>
-
- * th.po: updated to 536t.
-
-2008-05-04 Christian Perrier <bubulle@debian.org>
-
- * fr.po: updated to 536t.
-
-2008-05-04 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 536 strings.
- Formerly complete PO files are now 535t1u (new string
- from dselect/install. See #322470
-
-2008-05-04 Deng Xiyue <manphiz-guest@users.alioth.debian.org>
-
- * zh_CN.po: updated to 535t. Closes: #473360
-
-2008-05-03 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: updated to 535t. Closes: #479008
-
-2008-04-19 Jacobo Tarrío <jtarrio@debian.org>
-
- * gl.po: updated to 536t.
-
-2008-04-16 Damyan Ivanov <dmn@debian.org>
-
- * bg.po: updated to 536t.
-
-2008-04-16 Christian Perrier <bubulle@debian.org>
-
- * fr.po: updated to 536t.
-
-2008-03-19 Ivan Masár <helix84@centrum.sk>
-
- * sk.po: updated to 536t.
-
-2008-03-06 Wiktor Wandachowicz <siryes@gmail.com>\
-
- * pl.po: updated to 536t.
-
-2008-02-28 Peter Karlsson <peterk@debian.org>
-
- * sv.po: updated to 536t.
-
-2008-02-21 Jens Seidel <jensseidel@users.sf.net>
-
- * de.po: updated to 536t. Closes: #466842
-
-2008-02-16 Deng Xiyue <manphiz-guest@users.alioth.debian.org>
-
- * zh_CN.po: updated to 536t. Closes: #465866
-
-2008-02-13 Sunjae Park <darehanl@gmail.com>
-
- * ko.po: updated to 529t7f. Closes: #448430
-
-2008-02-07 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: updated to 536t. Closes: #464575
-
-2008-01-19 Christian Perrier <bubulle@debian.org>
-
- * Preventive unfuzzy files for a message aimed at fixing #452640
-
-2008-01-19 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: updated to 536t. Closes: #461468
-
-2008-01-17 Piarres Beobide <pi@beobide.net>
-
- * eu.po: updated to 536t. Closes: #461166
-
-2008-01-13 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 536 strings.
- Formerly complete PO files are now 534t2f but were
- unfuzzied
-
-2008-01-04 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: updated to 536t. Closes: #459013
-
-2008-01-02 Hans Fredrik Nordhaug <hans@nordhaug.priv.no>
-
- * nb.po: Updated to 536t. Closes: #457917
-
-2007-12-29 Deng Xiyue <manphiz-guest@users.alioth.debian.org>
-
- * zh_CN.po: Updated to 536t. Closes: #458039
-
-2007-12-18 Kenshi Muto <kmuto@debian.org>
-
- * ja.po: Updated to 536t. Closes: #456909
-
-2007-12-17 Christian Perrier <bubulle@debian.org>
-
- * fr.po: completed to 536t.
-
-2007-12-17 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 536 strings.
- Formerly complete PO files are now 530t6f
-
-2007-12-15 Christian Perrier <bubulle@debian.org>
-
- * fr.po: completed to 542t.
-
-2007-12-15 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 542 strings.
- Formerly complete PO files are now 536t6f
-
-2007-12-01 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: updated to 536t.
-
-2007-11-27 Piarres Beobide <pi@beobide.net>
-
- * eu.po: updated to 536t.
-
-2007-11-01 Christian Perrier <bubulle@debian.org>
-
- * *.po: preventive unfuzzy after removal of an extra space
- in a message "Stored label: %s\n"
-
-2007-10-30 Peter Karlsson <peterk@debian.org>
-
- * sv.po: updated to 536t.
-
-2007-10-29 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: updated to 536t. Closes: #448497
-
-2007-10-29 Sunjae Park <darehanl@gmail.com>
-
- * ko.po: Updated to 536t. Closes: #448430
-
-2007-10-28 Christian Perrier <bubulle@debian.org>
-
- * Add a bunch of languages that were not listed in LINGUAS:
- Arabic, Dzongkha, Khmer, Marathi, Nepali, Thai
-
-2007-10-28 Christian Perrier <bubulle@debian.org>
-
- * fr.po: completed to 536t.
-
-2007-10-28 Christian Perrier <bubulle@debian.org>
-
- * Update all PO files and apt-all.pot. 536 strings.
- Formerly complete PO files are now 532t3f1u
-
-2007-10-14 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: updated to 535t. Closes: #446626
-
-2007-10-12 Peter Karlsson <peterk@debian.org>
-
- * sv.po: updated to 535t.
-
-2007-09-17 Theppitak Karoonboonyanan <thep@linux.thai.net>
-
- * th.po: added with 535t. Closes: #442833
-
-2007-09-07 Claus Hindsgaul <claus.hindsgaul@gmail.com>
-
- * da.po: completed to 532t3f. Closes: #441102
-
-2007-09-03 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: completed to 535t. Closes: #440611
-
-2007-08-07 Piarres Beobide <pi@beobide.net>
-
- * eu.po: completed to 535t. Closes: #436425
-
-2007-08-04 Christian Perrier <bubulle@debian.org>
-
- * fr.po: completed to 535t.
-
-2007-08-04 Christian Perrier <bubulle@debian.org>
-
- * Update all PO and the POT. Gives 529t6f for formerly
- complete translations
-
-2007-07-11 Piarres Beobide <pi@beobide.net>
-
- * eu.po: completed to 532t. Closes: #423766
-
-2007-07-06 Christian Perrier <bubulle@debian.org>
-
- * Update all PO and the POT. Gives 529t3f for formerly
- complete translations
- * Unfuzzy formerly complete translations (es, fr, gl, vi)
-
-2007-06-21 Javier Fernandez-Sanguino <jfs@debian.org>
-
- * es.po: completed to 532t, again. Closes: #429935
-
-2007-06-21 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: completed to 532t, again. Closes: #429899
-
-2007-06-19 Jacobo Tarrío <jtarrio@debian.org>
-
- * gl.po: completed to 532t. Closes: #429506
-
-2007-06-13 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: completed to 532t. Closes: #428672
-
-2007-06-12 Christian Perrier <bubulle@debian.org>
-
- * Update all PO and the POT. Gives 514t14f4u for formerly
- complete translations
- * fr.po: completed to 532t
-
-2007-06-12 Christian Perrier <bubulle@debian.org>
-
- * ku.po, uk.po, LINGUAS: reintegrate those translations
- which disappeared from the BZR repositories
-
-2007-06-01 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: Updated to 515t. Closes: #426976
-
-2007-05-13 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Updated to 515t. Closes: #423766
-
-2007-05-10 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: 515t. Closes: #423111
-
-2007-05-08 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Updated by Christian Perrier
-
-2007-05-08 Christian Perrier <bubulle@debian.org>
-
- * Update all PO and the POT. Gives 513t2f for formerly
- complete translations
-
-2007-04-01 priti Patil <prithisd@gmail.com>
-
- * mr.po: New Marathi translation
- Closes: #416806
-
-2007-03-31 Kov Chai <tchaikov@sjtu.org>
-
- * zh_CN.po: Updated by Kov Chai
- Closes: #416822
-
-2007-03-29 eric pareja <xenos@upm.edu.ph>
-
- * tl.po: Updated by Eric Pareja
- Closes: #416638
-
-2007-02-28 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: Updated by Jacobo Tarrio
- Closes: #412828
-
-2007-02-03 Claus Hindsgaul <claus.hindsgaul@gmail.com>
-
- * da.po: Updated by Claus Hindsgaul
- Closes: #409483
-
-2007-01-29 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Remove a non-breakable space for usability
- issues. Closes: #408877
-
-2006-12-12 Yuri Kozlov <kozlov.y@gmail.com>
-
- * ru.po: Updated Russian translation. Closes: #405476
-
-2006-12-12 Christian Perrier <bubulle@debian.org>
-
- * *.po: Unfuzzy after upstream typo corrections
-
-2006-12-12 Eugeniy Meshcheryakov <eugen@debian.org>
-
- * uk.po: Updated Ukrainian translation: 495t16f3u
-
-2006-11-04 Artem Bondarenko <artem.brz@gmail.com>
-
- * uk.po: New Ukrainian translation: 483t28f3u
-
-2006-11-02 Emmanuel Galatoulas <galas@tee.gr>
-
- * el.po: Update to 503t9f2u
-
-2006-10-24 Michael Piefel <piefel@debian.org>
-
- * de.po: Updates and corrections.
-
-2006-10-22 Jordi Mallach <jordi@debian.org>
-
- * ca.po: Updated to 514t
-
-2006-10-22 Bart Cornelis <cobaco@linux.be>
-
- * be.po: Updated to 514t
-
-2006-10-21 Samuele Giovanni Tonon <samu@debian.org>
-
- * it.po: Updated to 514t
-
-2006-10-21 SZERVÁC Attila <sas@321.hu>
-
- * hu.po: Updated to 514t
-
-2006-10-21 Asho Yeh <asho@debian.org.tw>
-
- * zh_TW.po: Updated to 514t
-
-2006-10-21 Ossama M. Khayat <okhayat@yahoo.com>
-
- * ar.po: Updated to 293t221u.
-
-2006-10-16 Yuri Kozlov <kozlov.y@gmail.com>
-
- * ru.po: Updated to 514t. Closes: #392466
-
-2006-10-16 Hans Fredrik Nordhaug <hans@nordhaug.priv.no>
-
- * nb.po: Updated to 514t. Closes: #392466
-
-2006-10-15 Rui Az. <astronomy@mail.pt>
-
- * pt.po: Updated to 514t. Closes: #393199
-
-2006-10-14 Christian Perrier <bubulle@debian.org>
-
- * fr.po: One spelling error corrected: s/accèder/accéder
-
-2006-10-13 Khoem Sokhem <khoemsokhem@khmeros.info>
-
- * km.po: Updated to 514t.
-
-2006-10-13 Sunjae Park <darehanl@gmail.com>
-
- * ko.po: Updated to 514t.
-
-2006-10-12 Yavor Doganov <yavor@doganov.org>
-
- * bg.po: Updated to 514t.
-
-2006-10-12 Michael Piefel <piefel@debian.org>
-
- * de.po: Updated to 514t.
-
-2006-10-12 Neil Williams <linux@codehelp.co.uk>
-
- * en_GB.po: Updated to 514t.
-
-2006-10-08 Javier Fernández-Sanguino Peña <jfs@computer.org>
-
- * es.po: Updated to 514t. Closes: #391661
-
-2006-10-06 Claus Hindsgaul <claus.hindsgaul@gmail.com>
-
- * da.po: Updated to 514t. Closes: #391424
-
-2006-10-04 Miroslav Kure <kurem@upcase.inf.upol.cz>
-
- * cs.po: Updated. Closes: #391064
-
-2006-09-29 Tapio Lehtonen <tale@debian.org>
-
- * fi.po: Updated to 514t. Closes: #390149
-
-2006-09-27 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Updated to 514t. Closes: #389725
-
-2006-09-21 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: Updated to 514t. Closes: #388555
-
-2006-09-20 Sorin Batariuc <sorin@bonbon.net>
-
- * ro.po: Updated to 514t. Closes: #388402
-
-2006-09-18 Kinley Tshering <gasepkuenden2k3@hotmail.com>
-
- * dz.po: Updated to 514t. Closes: #388184
-
-2006-09-17 Davide Viti <zinosat@tiscali.it>
-
- * it.po: Fixed typos. Closes: #387812
-
-2006-09-17 Erdal Ronahi <erdal.ronahi@gmail.com>
-
- * ku.po: New kurdish translation. Closes: #387766
- 71t40f403u
-
-2006-09-10 Peter Mann <Peter.Mann@tuke.sk>
-
- * sk.po: Updated to 514t. Closes: #386851
-
-2006-09-08 Christian Perrier <bubulle@debian.org>
-
- * LINGUAS: re-enabled Hebrew translation on translator's request.
-
-2006-09-08 Kenshi Muto <kmuto@debian.org>
-
- * ja.po: Updated to 514t. Closes: #386537
-
-2006-09-06 Jacobo Tarrio <jtarrio@debian.org>
-
- * gl.po: Updated to 514t. Closes: #386397
-
-2006-09-02 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Updated to 516t.
-
-2006-09-02 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Updated to 516t.
-
-2006-08-20 Christian Perrier <bubulle@debian.org>
-
- * Update all PO and the POT. Gives 512t3f1uf for formerly
- complete translations
-
-2006-08-13 Tapio Lehtonen <tale@debian.org>
-
- * fi.po: Updated to 512t. Closes: #382702
-
-2006-07-19 Sunjae Park <darehanl@gmail.com>
-
- * ko.po: Updated to 512t. Closes: #378901
-
-2006-07-02 SZERVAC Attila <sas@321.hu>
-
- * hu.po: Updated to 512t. Closes: #376330
-
-2006-07-01 Leang Chumsoben <soben@khmeros.info>
-
- * km.po: New Khmer translation: 506t6f. Closes: #375068
-
-2006-07-01 Shiva Pokharel <pokharelshiva@hotmail.com>
-
- * ne.po: New Nepali translation: 512t. Closes: #373729
-
-2006-07-01 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: Updated to 512t. Closes: #368038
-
-2006-07-01 Christian Perrier <bubulle@debian.org>
-
- * zh_TW.po: Remove an extra %s in one string. Closes: #370551
-
-2006-07-01 Kinley Tshering <gasepkuenden2k3@hotmail.com>
-
- * dz.po: New Dzongkha translation: 512t
-
-2006-06-25 Sorin Batariuc <sorin@bonbon.net>
-
- * ro.po: Updated to 512t
-
-2006-06-21 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Updated
-
-2006-06-07 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Updated
-
-2006-05-29 Peter Mann <Peter.Mann@tuke.sk>
-
- * sk.po: Completed to 512t
-
-2006-05-28 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Completed to 512t
-
-2006-05-17 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Completed to 512t
-
-2006-05-17 Daniel Nylander <yeager@lidkoping.net>
-
- * sv.po: Completed to 512t
-
-2006-05-16 Christian Perrier <bubulle@debian.org>
-
- * Update all PO and the POT. Gives 506t6f for formerly
- complete translations
-
-2006-04-01 Yavor Doganov <yavor@doganov.org>
-
- * bg.po: Added, complete to 512t. Closes: #360262
-
-2006-03-16 eric pareja <xenos@upm.edu.ph>
-
- * tl.po: Completed to 512t. Closes: #357215
-
-2006-03-13 Sorin Batariuc <sorin@bonbon.net>
-
- * ro.po: Completed to 512t. Closes: #355897
-
-2006-03-12 Miguel Figueiredo <elmig@debianpt.org>
-
- * pt.po: Completed to 512t. Closes: #355798
-
-2006-02-14 Carlos Z.F. Liu <carlosliu@users.sourceforge.net>
-
- * zh_CN.po: Completed to 512t. Closes: #353936
-
-2006-02-14 Samuele Giovanni Tonon <samu@debian.org>
-
- * it.po: Completed to 512t. Closes: #352803
-
-2006-02-13 Andre Luis Lopes <andrelop@debian.org>
-
- * ca.po: Completed to 512t. Closes: #352419
-
-2006-02-06 Jordi Mallach <jordi@debian.org>
-
- * ca.po: Completed to 512t. Closes: #351592
-
-2006-01-30 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Completed to 512t. Closes: #350483
-
-2006-01-24 Kenshi Muto <kmuto@debian.org>
-
- * ja.po: Completed to 512t. Closes: #349806
-
-2006-01-23 Bartosz Fenski aka fEnIo <fenio@debian.org>
-
- * pl.po: Completed to 512t. Closes: #349514
-
-2006-01-23 Peter Mann <Peter.Mann@tuke.sk>
-
- * sk.po: Completed to 512t. Closes: #349474
-
-2006-01-23 Jacobo Tarrio <jtarrio@trasno.net>
-
- * gl.po: Completed to 512 strings
- Closes: #349407
-
-2006-01-22 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: Completed to 512 strings
-
-2006-01-21 Daniel Nylander <yeager@lidkoping.net>
-
- * sv.po: Completed to 512 strings
- Closes: #349210
-
-2006-01-21 Yuri Kozlov <kozlov.y@gmail.com>
-
- * ru.po: Completed to 512 strings
- Closes: #349154
-
-2006-01-21 Claus Hindsgaul <claus_h@image.dk>
-
- * da.po: Completed to 512 strings
- Closes: #349084
-
-2006-01-20 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Completed to 512 strings
- * LINGUAS: Add Welsh
-
-2006-01-20 Christian Perrier <bubulle@debian.org>
-
- * *.po: Updated from sources (512 strings)
-
-2006-01-20 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: Completed to 511 strings
- Closes: #348968
-
-2006-01-18 Konstantinos Margaritis <markos@debian.org>
-
- * el.po: Completed to 511 strings
- Closes: #344642
-
-2005-11-07 Claus Hindsgaul <claus_h@image.dk>
-
- * da.po: Completed to 511 strings
- Closes: #348574
-
-2005-11-16 Andrew Deason <adeason@tjhsst.edu>
-
- * en_GB.po: Minor errors correction
-
-2005-11-12 Ruben Porras <nahoo82@telefonica.net>
-
- * es.po: Updated to 510t1f
- Closes: #348158
-
-2005-11-12 Jacobo Tarrio <jacobo@tarrio.org>
-
- * gl.po: Completed to 511 strings
- Closes: #347729
-
-2006-01-10 Samuele Giovanni Tonon <samu@mclink.it>
-
- * it.po: Yet another update
- Closes: #347435
-
-2006-01-09 Jonas Koelker <jonaskoelker@users.sourceforge.net>
-
- * en_GB.po, de.po: fix spaces errors in "Ign " translations
- Closes: #347258
-
-2006-01-09 Thomas Huriaux <thomas.huriaux@gmail.com>
-
- * makefile: make update-po a pre-requisite of clean target so
- that POT and PO files are always up-to-date
-
-2006-01-08 Daniel Nylander <yeager@lidkoping.net>
-
- * sv.po: Completed to 511t. Closes: #346450
-
-2006-01-06 Peter Mann <Peter.Mann@tuke.sk>
-
- * sk.po: Completed to 511t. Closes: #346369
-
-2006-01-06 Christian Perrier <bubulle@debian.org>
-
- * *.po: Updated from sources (511 strings)
- * fr.po: Completed to 511t
-
-2006-01-01 Samuele Giovanni Tonon <samu@mclink.it>
-
- * it.po: Completed to 510t
-
-2006-01-01 Neil Williams <linux@codehelp.co.uk>
-
- * en_GB.po: Completed to 510t
-
-2005-12-30 Miroslav Kure <kurem@upcase.inf.upol.cz>
-
- * cs.po: Completed to 510t
-
-2005-12-25 Ming Hua <minghua@rice.edu>
-
- * zh_CN.po: Completed to 510t
-
-2005-12-25 Konstantinos Margaritis <markos@debian.org>
-
- * el.po: Updated to 510t
-
-2005-12-19 Clytie Siddall <clytie@riverland.net.au>
-
- * vi.po: Updated to 383t93f34u
-
-2005-12-19 eric pareja <xenos@upm.edu.ph>
-
- * tl.po: Completed to 510 strings
- Closes: #344306
-
-2005-12-19 Daniel Nylander <yeager@lidkoping.net>
-
- * sv.po: Completed to 510 strings
- Closes: #344056
-
-2005-11-29 Christian Perrier <bubulle@debian.org>
-
- * LINGUAS: disabled Hebrew translation. Closes: #313283
-
-2005-12-05 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Completed to 510 strings
- Closes: #342091
-
-2005-11-29 Christian Perrier <bubulle@debian.org>
-
- * fr.po: Completed to 510 strings
- * *.po : Synced with the POT files
-
-2005-11-14 Kov Tchai <tchaikov@sjtu.edu.cn>
-
- * zh_CN.po: Completed to 510 strings
- Definitely Closes: #338267
-
-2005-11-13 Kov Tchai <tchaikov@sjtu.edu.cn>
-
- * zh_CN.po: Completed to 507 strings
- Closes: #338267
-
-2005-11-09 Jacobo Tarrio <jacobo@tarrio.org>
-
- * gl.po: Completed to 510 strings
- Closes: #338356
-
-2005-11-08 Piarres Beobide <pi@beobide.net>
-
- * eu.po: Completed to 510 strings
- Closes: #338101
-
-2005-11-07 Claus Hindsgaul <claus_h@image.dk>
-
- * da.po: Completed to 510 strings
- Closes: #337949
-
-2005-11-04 Eric Pareja <xenos@upm.edu.ph>
-
- * tl.po: Completed to 510 strings
- Closes: #337306
-
-2005-11-04 Christian Perrier <bubulle@debian.org>
-
- * Changelog: added to better track down fixed issues
-
diff --git a/po/apt-all.pot b/po/apt-all.pot
index d2229a936..664965900 100644
--- a/po/apt-all.pot
+++ b/po/apt-all.pot
@@ -901,7 +901,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -913,7 +913,7 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
+msgid "Unknown error executing apt-key"
msgstr ""
#: methods/gpgv.cc:217 methods/gpgv.cc:224
diff --git a/po/ar.po b/po/ar.po
index c4069143e..1bea20877 100644
--- a/po/ar.po
+++ b/po/ar.po
@@ -914,7 +914,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -926,7 +926,7 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
+msgid "Unknown error executing apt-key"
msgstr ""
#: methods/gpgv.cc:217 methods/gpgv.cc:224
@@ -1578,8 +1578,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "حساب الترقية..."
+msgid "Calculating upgrade"
+msgstr "حساب الترقية"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ast.po b/po/ast.po
index 629c8f2da..9f7d7b2d0 100644
--- a/po/ast.po
+++ b/po/ast.po
@@ -1021,8 +1021,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Atopóse polo menos una robla mala."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Nun pudo executase 'gpgv' pa verificar la robla (¿ta instaláu gpgv?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Nun pudo executase 'apt-key' pa verificar la robla (¿ta instaláu gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1033,8 +1033,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Fallu desconocíu al executar gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Fallu desconocíu al executar apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1706,8 +1706,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calculando l'anovamientu... "
+msgid "Calculating upgrade"
+msgstr "Calculando l'anovamientu"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/bg.po b/po/bg.po
index ea7382513..e41b2bdd0 100644
--- a/po/bg.po
+++ b/po/bg.po
@@ -1051,10 +1051,10 @@ msgid "At least one invalid signature was encountered."
msgstr "Намерен е поне един невалиден подпис."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Неуспех при изпълнение на „gpgv“ за проверка на подписа (инсталиран ли е "
-"gpgv?)"
+"Неуспех при изпълнение на „apt-key“ за проверка на подписа (инсталиран ли е "
+"gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1065,8 +1065,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Неизвестна грешка при изпълнението на gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Неизвестна грешка при изпълнението на apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1743,8 +1743,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Изчисляване на актуализацията..."
+msgid "Calculating upgrade"
+msgstr "Изчисляване на актуализацията"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/bs.po b/po/bs.po
index 3cf69f0b1..81294d8c8 100644
--- a/po/bs.po
+++ b/po/bs.po
@@ -920,7 +920,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -932,7 +932,7 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
+msgid "Unknown error executing apt-key"
msgstr ""
#: methods/gpgv.cc:217 methods/gpgv.cc:224
@@ -1575,8 +1575,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Računam nadogradnju..."
+msgid "Calculating upgrade"
+msgstr "Računam nadogradnju"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ca.po b/po/ca.po
index 31961ecac..db6d12e77 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -1034,10 +1034,10 @@ msgid "At least one invalid signature was encountered."
msgstr "S'ha trobat almenys una signatura invàlida."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"No s'ha pogut executar el «gpgv» per a verificar la signatura (està "
-"instaŀlat el gpgv?)"
+"No s'ha pogut executar el «apt-key» per a verificar la signatura (està "
+"instaŀlat el gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1048,8 +1048,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "S'ha produït un error desconegut en executar el gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "S'ha produït un error desconegut en executar el apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1731,8 +1731,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "S'està calculant l'actualització… "
+msgid "Calculating upgrade"
+msgstr "S'està calculant l'actualització"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/cs.po b/po/cs.po
index 5bb6a79b7..5d7625d6c 100644
--- a/po/cs.po
+++ b/po/cs.po
@@ -1062,8 +1062,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Byl zaznamenán nejméně jeden neplatný podpis. "
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Nelze spustit „gpgv“ pro ověření podpisu (je gpgv nainstalováno?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Nelze spustit „apt-key“ pro ověření podpisu (je gnupg nainstalováno?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1076,8 +1076,8 @@ msgstr ""
"ověření?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Neznámá chyba při spouštění gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Neznámá chyba při spouštění apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1757,8 +1757,8 @@ msgid "All packages are up to date."
msgstr "Všechny balíky jsou aktuální."
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Propočítává se aktualizace… "
+msgid "Calculating upgrade"
+msgstr "Propočítává se aktualizace"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/cy.po b/po/cy.po
index dbf4bfba9..dd6feb3d4 100644
--- a/po/cy.po
+++ b/po/cy.po
@@ -1042,7 +1042,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1054,7 +1054,7 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
+msgid "Unknown error executing apt-key"
msgstr ""
#: methods/gpgv.cc:217 methods/gpgv.cc:224
@@ -1731,8 +1731,8 @@ msgstr ""
#: apt-private/private-upgrade.cc:25
#, fuzzy
-msgid "Calculating upgrade... "
-msgstr "Yn Cyfrifo'r Uwchraddiad... "
+msgid "Calculating upgrade"
+msgstr "Yn Cyfrifo'r Uwchraddiad"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/da.po b/po/da.po
index 11ef78a5e..e6c853fd3 100644
--- a/po/da.po
+++ b/po/da.po
@@ -1075,9 +1075,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Stødte på mindst én ugyldig signatur."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Kunne ikke køre »gpgv« for at verificere signaturen (er gpgv installeret?)"
+"Kunne ikke køre »apt-key« for at verificere signaturen (er gnupg installeret?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1090,8 +1090,8 @@ msgstr ""
"autentificering?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Ukendt fejl ved kørsel af gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Ukendt fejl ved kørsel af apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1771,8 +1771,8 @@ msgid "All packages are up to date."
msgstr "Alle pakker er opdateret."
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Beregner opgraderingen ... "
+msgid "Calculating upgrade"
+msgstr "Beregner opgraderingen"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/de.po b/po/de.po
index ae3b15d41..13b291043 100644
--- a/po/de.po
+++ b/po/de.po
@@ -1113,9 +1113,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Mindestens eine ungültige Signatur wurde entdeckt."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"»gpgv« konnte zur Überprüfung der Signatur nicht ausgeführt werden (ist gpgv "
+"»apt-key« konnte zur Überprüfung der Signatur nicht ausgeführt werden (ist gnupg "
"installiert?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1129,8 +1129,8 @@ msgstr ""
"das Netzwerk eine Authentifizierung?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Unbekannter Fehler beim Ausführen von gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Unbekannter Fehler beim Ausführen von apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1833,8 +1833,8 @@ msgid "All packages are up to date."
msgstr "Alle Pakete sind aktuell."
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Paketaktualisierung (Upgrade) wird berechnet... "
+msgid "Calculating upgrade"
+msgstr "Paketaktualisierung (Upgrade) wird berechnet"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/dz.po b/po/dz.po
index 3ed665f94..8ee4d15da 100644
--- a/po/dz.po
+++ b/po/dz.po
@@ -1016,7 +1016,7 @@ msgstr "ཉུང་མཐའ་རང་ནུས་མེད་ཀྱི་མ
#: methods/gpgv.cc:174
#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
"མིང་རྟགས་བདེན་སྦྱོར་འབད་ནི་ལུ་'%s'འདི་ལག་ལེན་འཐབ་མ་ཚུགས། (gpgv་དེ་ཁཞི་བཙུགས་འབད་ཡོདཔ་ཨིན་ན།?)"
@@ -1029,8 +1029,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "gpgv་ལག་ལེན་འཐབ་ནི་ལུ་མ་ཤེས་པའི་འཛོལ་བ་།"
+msgid "Unknown error executing apt-key"
+msgstr "apt-key་ལག་ལེན་འཐབ་ནི་ལུ་མ་ཤེས་པའི་འཛོལ་བ་།"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1696,8 +1696,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "ཡར་བསྐྱེད་རྩིས་བཏོན་དོ་... "
+msgid "Calculating upgrade"
+msgstr "ཡར་བསྐྱེད་རྩིས་བཏོན་དོ་"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/el.po b/po/el.po
index 92f178b0d..1b19f54da 100644
--- a/po/el.po
+++ b/po/el.po
@@ -1028,10 +1028,10 @@ msgstr "Βρέθηκε τουλάχιστον μια μη έγκυρη υπογ
#: methods/gpgv.cc:174
#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
"Αδυναμία εκτέλεσης του '%s' για την επαλήθευση της υπογραφής (είναι "
-"εγκατεστημένο το gpgv;)"
+"εγκατεστημένο το gnupg;)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1042,8 +1042,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Άγνωστο σφάλμα κατά την εκτέλεση του gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Άγνωστο σφάλμα κατά την εκτέλεση του apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1718,8 +1718,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Υπολογισμός της αναβάθμισης... "
+msgid "Calculating upgrade"
+msgstr "Υπολογισμός της αναβάθμισης"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/es.po b/po/es.po
index 471774590..f808761df 100644
--- a/po/es.po
+++ b/po/es.po
@@ -1086,9 +1086,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Se encontró al menos una firma inválida."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"No se pudo ejecutar «gpgv» para verificar la firma (¿está instalado gpgv?)"
+"No se pudo ejecutar «apt-key» para verificar la firma (¿está instalado gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1099,8 +1099,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Error desconocido ejecutando gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Error desconocido ejecutando apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1780,8 +1780,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calculando la actualización... "
+msgid "Calculating upgrade"
+msgstr "Calculando la actualización"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/eu.po b/po/eu.po
index 9379abad0..8b3dd9025 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -1016,9 +1016,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Beintza sinadura baliogabe bat aurkitu da."
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Ezin da %s abiarazi sinadura egiaztatzeko (gpgv instalaturik al dago?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Ezin da apt-key abiarazi sinadura egiaztatzeko (gnupg instalaturik al dago?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1029,8 +1028,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Errore ezezaguna gpgv exekutatzean"
+msgid "Unknown error executing apt-key"
+msgstr "Errore ezezaguna apt-key exekutatzean"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1700,8 +1699,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Berriketak kalkulatzen... "
+msgid "Calculating upgrade"
+msgstr "Berriketak kalkulatzen"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/fi.po b/po/fi.po
index cb23ace35..b4333d57f 100644
--- a/po/fi.po
+++ b/po/fi.po
@@ -1007,10 +1007,9 @@ msgid "At least one invalid signature was encountered."
msgstr "LÖytyi ainakin yksi kelvoton allekirjoitus."
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Ei käynnistynyt \"%s\" allekirjoitusta tarkistamaan (onko gpgv asennettu?)"
+"Ei käynnistynyt \"apt-key\" allekirjoitusta tarkistamaan (onko gnupg asennettu?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1021,8 +1020,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Tapahtui tuntematon virhe suoritettaessa gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Tapahtui tuntematon virhe suoritettaessa apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1692,8 +1691,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Käsitellään päivitystä ... "
+msgid "Calculating upgrade"
+msgstr "Käsitellään päivitystä"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/fr.po b/po/fr.po
index f3b69a800..2325fc0bf 100644
--- a/po/fr.po
+++ b/po/fr.po
@@ -1077,10 +1077,10 @@ msgid "At least one invalid signature was encountered."
msgstr "Au moins une signature non valable a été rencontrée."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Impossible d'exécuter « gpgv » pour contrôler la signature (veuillez "
-"vérifier si gpgv est installé)."
+"Impossible d'exécuter « apt-key » pour contrôler la signature (veuillez "
+"vérifier si gnupg est installé)."
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1093,8 +1093,8 @@ msgstr ""
"Peut-être le réseau nécessite-t-il une authentification."
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Erreur inconnue à l'exécution de gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Erreur inconnue à l'exécution de apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1788,8 +1788,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calcul de la mise à jour... "
+msgid "Calculating upgrade"
+msgstr "Calcul de la mise à jour"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/gl.po b/po/gl.po
index e7aa78713..23d0f1c6b 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -1032,10 +1032,10 @@ msgid "At least one invalid signature was encountered."
msgstr "Atopouse polo menos unha sinatura incorrecta."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Non é posíbel executar «gpgv» para verificar a sinatura (Está instalado "
-"gpgv?)"
+"Non é posíbel executar «apt-key» para verificar a sinatura (Está instalado "
+"gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1046,8 +1046,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Produciuse un erro descoñecido ao executar gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Produciuse un erro descoñecido ao executar apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1729,8 +1729,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calculando a anovación... "
+msgid "Calculating upgrade"
+msgstr "Calculando a anovación"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/he.po b/po/he.po
index adc738bec..8175d0ebb 100644
--- a/po/he.po
+++ b/po/he.po
@@ -1006,7 +1006,7 @@ msgid "Recommended packages:"
msgstr ""
#: cmdline/apt-get.cc:1965
-msgid "Calculating upgrade... "
+msgid "Calculating upgrade"
msgstr ""
#: cmdline/apt-get.cc:1968 methods/ftp.cc:708 methods/connect.cc:112
@@ -1810,11 +1810,11 @@ msgstr ""
#: methods/gpgv.cc:232
#, c-format
-msgid "Could not execute '%s' to verify signature (is gpgv installed?)"
+msgid "Could not execute '%s' to verify signature (is gnupg installed?)"
msgstr ""
#: methods/gpgv.cc:237
-msgid "Unknown error executing gpgv"
+msgid "Unknown error executing apt-key"
msgstr ""
#: methods/gpgv.cc:271 methods/gpgv.cc:278
diff --git a/po/hu.po b/po/hu.po
index 9457b384c..9acff5c86 100644
--- a/po/hu.po
+++ b/po/hu.po
@@ -1050,9 +1050,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Legalább egy aláírás érvénytelen."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Nem indítható el a „gpgv” az aláírás ellenőrzéséhez (telepítve van a gpgv?)"
+"Nem indítható el a „apt-key” az aláírás ellenőrzéséhez (telepítve van a gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1063,8 +1063,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Ismeretlen gpgv futtatási hiba"
+msgid "Unknown error executing apt-key"
+msgstr "Ismeretlen apt-key futtatási hiba"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1736,8 +1736,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Frissítés kiszámítása... "
+msgid "Calculating upgrade"
+msgstr "Frissítés kiszámítása"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/it.po b/po/it.po
index 5348110c2..050b56111 100644
--- a/po/it.po
+++ b/po/it.po
@@ -1093,9 +1093,9 @@ msgid "At least one invalid signature was encountered."
msgstr "È stata trovata almeno una firma non valida."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Impossibile eseguire \"gpgv\" per verificare la firma (forse gpgv non è "
+"Impossibile eseguire \"apt-key\" per verificare la firma (forse gnupg non è "
"installato)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1109,8 +1109,8 @@ msgstr ""
"richiede autenticazione?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Errore sconosciuto durante l'esecuzione di gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Errore sconosciuto durante l'esecuzione di apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1796,8 +1796,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calcolo dell'aggiornamento... "
+msgid "Calculating upgrade"
+msgstr "Calcolo dell'aggiornamento"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ja.po b/po/ja.po
index c79bfbf28..7a5f87a4a 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -6,10 +6,10 @@
# Debian Project, Kenshi Muto <kmuto@debian.org>, 2004-2012
msgid ""
msgstr ""
-"Project-Id-Version: apt 0.9.16.1\n"
+"Project-Id-Version: apt 1.0.9.1\n"
"Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
"POT-Creation-Date: 2014-09-09 20:35+0200\n"
-"PO-Revision-Date: 2014-03-21 19:53+0900\n"
+"PO-Revision-Date: 2014-09-27 19:32+0900\n"
"Last-Translator: Kenshi Muto <kmuto@debian.org>\n"
"Language-Team: Debian Japanese List <debian-japanese@lists.debian.org>\n"
"Language: ja\n"
@@ -640,7 +640,7 @@ msgstr ""
#: cmdline/apt-helper.cc:36
msgid "Need one URL as argument"
-msgstr ""
+msgstr "引数として URL が 1 つ必要です"
#: cmdline/apt-helper.cc:49
msgid "Must specify at least one pair url/filename"
@@ -651,7 +651,6 @@ msgid "Download Failed"
msgstr "ダウンロード失敗"
#: cmdline/apt-helper.cc:80
-#, fuzzy
msgid ""
"Usage: apt-helper [options] command\n"
" apt-helper [options] download-file uri target-path\n"
@@ -671,6 +670,7 @@ msgstr ""
"\n"
"コマンド:\n"
" download-file - 指定した uri を目標パスにダウンロードする\n"
+" auto-detect-proxy - apt.conf を使ってプロキシを検出する\n"
"\n"
" この APT helper は Super Meep Powers 化されています。\n"
@@ -1084,9 +1084,9 @@ msgid "At least one invalid signature was encountered."
msgstr "少なくとも 1 つの不正な署名が発見されました。"
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"署名を検証するための 'gpgv' の実行ができませんでした (gpgv はインストールされ"
+"署名を検証するための 'apt-key' の実行ができませんでした (gnupg はインストールされ"
"ていますか?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1100,8 +1100,8 @@ msgstr ""
"が必要?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "gpgv の実行中に未知のエラーが発生"
+msgid "Unknown error executing apt-key"
+msgstr "apt-key の実行中に未知のエラーが発生"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1496,57 +1496,56 @@ msgid "Recommended packages:"
msgstr "推奨パッケージ:"
#: apt-private/private-install.cc:825
-#, fuzzy, c-format
+#, c-format
msgid "Skipping %s, it is already installed and upgrade is not set.\n"
-msgstr "すでに %s に展開されたソースがあるため、展開をスキップします\n"
+msgstr "%s はすでにインストール済みで upgrade がセットされていないため、インストールをスキップします。\n"
#: apt-private/private-install.cc:829
#, c-format
msgid "Skipping %s, it is not installed and only upgrades are requested.\n"
-msgstr ""
+msgstr "%s はインストールされておらず、アップグレードだけの要求なので、インストールをスキップします。\n"
#: apt-private/private-install.cc:841
#, c-format
msgid "Reinstallation of %s is not possible, it cannot be downloaded.\n"
-msgstr ""
+msgstr "%s はダウンロードできないため、再インストールは不可能です。\n"
#: apt-private/private-install.cc:846
-#, fuzzy, c-format
+#, c-format
msgid "%s is already the newest version.\n"
-msgstr "%s はすでに保留に設定されています。\n"
+msgstr "%s はすでに最新版です。\n"
#: apt-private/private-install.cc:894
#, c-format
msgid "Selected version '%s' (%s) for '%s'\n"
-msgstr ""
+msgstr "'%3$s' のバージョン '%1$s' (%2$s) を選択しました\n"
#: apt-private/private-install.cc:899
#, c-format
msgid "Selected version '%s' (%s) for '%s' because of '%s'\n"
-msgstr ""
+msgstr "'%4$s' のために '%3$s' のバージョン '%1$s' (%2$s) を選択しました\n"
#. TRANSLATORS: Note, this is not an interactive question
#: apt-private/private-install.cc:941
#, c-format
msgid "Package '%s' is not installed, so not removed. Did you mean '%s'?\n"
-msgstr ""
+msgstr "パッケージ '%s' はインストールされていないため削除もされません。削除したかったのは '%s' でしょうか?\n"
#: apt-private/private-install.cc:947
-#, fuzzy, c-format
+#, c-format
msgid "Package '%s' is not installed, so not removed\n"
-msgstr "%lu 個のパッケージが完全にインストールまたは削除されていません。\n"
+msgstr "パッケージ '%s' はインストールされていないため、削除もされません\n"
#: apt-private/private-list.cc:129
msgid "Listing"
msgstr "一覧表示"
#: apt-private/private-list.cc:159
-#, fuzzy, c-format
+#, c-format
msgid "There is %i additional version. Please use the '-a' switch to see it"
msgid_plural ""
"There are %i additional versions. Please use the '-a' switch to see them."
-msgstr[0] ""
-"追加レコードが %i 件あります。表示するには '-a' スイッチを付けてください。"
+msgstr[0] "追加バージョンが %i 件あります。表示するには '-a' スイッチを付けてください。"
#: apt-private/private-main.cc:32
msgid ""
@@ -1758,11 +1757,11 @@ msgstr "update コマンドは引数をとりません"
msgid "%i package can be upgraded. Run 'apt list --upgradable' to see it.\n"
msgid_plural ""
"%i packages can be upgraded. Run 'apt list --upgradable' to see them.\n"
-msgstr[0] ""
+msgstr[0] "アップグレードできるパッケージが %i 個あります。表示するには 'apt list --upgradable' を実行してください。\n"
#: apt-private/private-update.cc:94
msgid "All packages are up to date."
-msgstr ""
+msgstr "パッケージはすべて最新です。"
#: apt-private/private-upgrade.cc:25
msgid "Calculating upgrade... "
@@ -1882,9 +1881,9 @@ msgstr ""
" -o=? 指定した設定オプションを適用する (例: -o dir::cache=/tmp)\n"
#: cmdline/apt-extracttemplates.cc:254
-#, fuzzy, c-format
+#, c-format
msgid "Unable to mkstemp %s"
-msgstr "%s の状態を取得できません"
+msgstr "mkstemp %s を実行できません"
#: cmdline/apt-extracttemplates.cc:259 apt-pkg/pkgcachegen.cc:1400
#, c-format
@@ -2040,9 +2039,8 @@ msgid "Failed to stat %s"
msgstr "%s の状態を取得するのに失敗しました"
#: ftparchive/cachedb.cc:332
-#, fuzzy
msgid "Failed to read .dsc"
-msgstr "%s のリンク読み取りに失敗しました"
+msgstr ".dsc の読み取りに失敗しました"
#: ftparchive/cachedb.cc:365
msgid "Archive has no control record"
@@ -2441,9 +2439,9 @@ msgid "Unable to lock directory %s"
msgstr "ディレクトリ %s をロックできません"
#: apt-pkg/acquire.cc:490 apt-pkg/clean.cc:39
-#, fuzzy, c-format
+#, c-format
msgid "Clean of %s is not supported"
-msgstr "インデックスファイルのタイプ '%s' はサポートされていません"
+msgstr "%s の消去はサポートされていません"
#. only show the ETA if it makes sense
#. two days
diff --git a/po/km.po b/po/km.po
index 9202b6072..ae00856f0 100644
--- a/po/km.po
+++ b/po/km.po
@@ -1005,8 +1005,8 @@ msgstr "​បានជួប​ប្រទះ​​​​ហត្ថលេខ
#: methods/gpgv.cc:174
#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "មិន​អាច​ប្រតិបត្តិ '%s' ដើម្បី​ផ្ទៀងផ្ទាត់​ហត្ថលេខា (តើ gpgv ត្រូវ​បាន​ដំឡើង​ឬនៅ ?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "មិន​អាច​ប្រតិបត្តិ 'apt-key' ដើម្បី​ផ្ទៀងផ្ទាត់​ហត្ថលេខា (តើ gnupg ត្រូវ​បាន​ដំឡើង​ឬនៅ ?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1017,8 +1017,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "មិនស្គាល់កំហុស ក្នុងការប្រតិបត្តិ gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "មិនស្គាល់កំហុស ក្នុងការប្រតិបត្តិ apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1675,8 +1675,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "កំពុង​គណនា​ការ​ធ្វើ​ឲ្យ​ប្រសើរ... "
+msgid "Calculating upgrade"
+msgstr "កំពុង​គណនា​ការ​ធ្វើ​ឲ្យ​ប្រសើរ"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ko.po b/po/ko.po
index c1b756cf7..661da2bde 100644
--- a/po/ko.po
+++ b/po/ko.po
@@ -1011,9 +1011,9 @@ msgid "At least one invalid signature was encountered."
msgstr "최소한 하나 이상의 서명이 잘못되었습니다."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"서명을 확인하는 'gpgv' 프로그램을 실행할 수 없습니다. (gpgv를 설치했습니까?)"
+"서명을 확인하는 'apt-key' 프로그램을 실행할 수 없습니다. (gnupg를 설치했습니까?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1024,8 +1024,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "gpgv 실행 도중 알 수 없는 오류 발생"
+msgid "Unknown error executing apt-key"
+msgstr "apt-key 실행 도중 알 수 없는 오류 발생"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1688,8 +1688,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "업그레이드를 계산하는 중입니다... "
+msgid "Calculating upgrade"
+msgstr "업그레이드를 계산하는 중입니다"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ku.po b/po/ku.po
index 5f5512065..0aaa66c33 100644
--- a/po/ku.po
+++ b/po/ku.po
@@ -923,7 +923,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -935,8 +935,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Di xebitandina gpgv de çewtiya nenas"
+msgid "Unknown error executing apt-key"
+msgstr "Di xebitandina apt-key de çewtiya nenas"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
#, fuzzy
@@ -1578,8 +1578,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Bilindkirin tê hesibandin..."
+msgid "Calculating upgrade"
+msgstr "Bilindkirin tê hesibandin"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/lt.po b/po/lt.po
index 2f6d71365..e66708cdc 100644
--- a/po/lt.po
+++ b/po/lt.po
@@ -928,7 +928,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -940,8 +940,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Nežinoma klaida kviečiant gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Nežinoma klaida kviečiant apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1600,8 +1600,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Skaičiuojami atnaujinimai... "
+msgid "Calculating upgrade"
+msgstr "Skaičiuojami atnaujinimai"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/mr.po b/po/mr.po
index 25134d605..3031722b7 100644
--- a/po/mr.po
+++ b/po/mr.po
@@ -1002,9 +1002,9 @@ msgstr "किमान एक अवैध सही सापडली."
#: methods/gpgv.cc:174
#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"सहीची खात्री करण्यासाठी '%s' कार्यान्वित करू शकत नाही (gpgv संस्थापित केले आहे का?)"
+"सहीची खात्री करण्यासाठी 'apt-key' कार्यान्वित करू शकत नाही (gnupg संस्थापित केले आहे का?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1015,8 +1015,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "gpgv कार्यान्वित होत असताना अपरिचित त्रुटी"
+msgid "Unknown error executing apt-key"
+msgstr "apt-key कार्यान्वित होत असताना अपरिचित त्रुटी"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1679,8 +1679,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "पुढिल आवृत्तीची गणती करीत आहे..."
+msgid "Calculating upgrade"
+msgstr "पुढिल आवृत्तीची गणती करीत आहे"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/nb.po b/po/nb.po
index 445f1cca5..12da02f47 100644
--- a/po/nb.po
+++ b/po/nb.po
@@ -1017,9 +1017,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Minst en ugyldig signatur ble funnet."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Klarte ikke kjøre «gpgv» for å verifisere signaturen (er gpgv installert?)"
+"Klarte ikke kjøre «apt-key» for å verifisere signaturen (er gnupg installert?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1030,8 +1030,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Ukjent feil ved kjøring av gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Ukjent feil ved kjøring av apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1706,8 +1706,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Beregner oppgradering... "
+msgid "Calculating upgrade"
+msgstr "Beregner oppgradering"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ne.po b/po/ne.po
index 08de0f8ef..0d61a52be 100644
--- a/po/ne.po
+++ b/po/ne.po
@@ -1002,9 +1002,8 @@ msgid "At least one invalid signature was encountered."
msgstr "कम्तिमा एउटा अवैध हस्ताक्षर विरोध भयो ।"
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "हस्ताक्षर रूजू गर्न '%s' कार्यन्वयन गर्न सकिएन (के gpgv स्थापना भयो?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "हस्ताक्षर रूजू गर्न 'apt-key' कार्यन्वयन गर्न सकिएन (के gnupg स्थापना भयो?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1015,8 +1014,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "gpgv कार्यन्वयन गर्दा अज्ञात त्रुटि"
+msgid "Unknown error executing apt-key"
+msgstr "apt-key कार्यन्वयन गर्दा अज्ञात त्रुटि"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1675,8 +1674,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "स्तर वृद्धि गणना गरिदैछ..."
+msgid "Calculating upgrade"
+msgstr "स्तर वृद्धि गणना गरिदैछ."
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/nl.po b/po/nl.po
index c410baa46..c333ae9f9 100644
--- a/po/nl.po
+++ b/po/nl.po
@@ -1032,9 +1032,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Er is tenminste één ongeldige ondertekening gevonden."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Kon 'gpgv' niet uitvoeren om ondertekening te verifiëren (is gpgv "
+"Kon 'apt-key' niet uitvoeren om ondertekening te verifiëren (is gnupg "
"geïnstalleerd?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1046,8 +1046,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Onbekende fout bij het uitvoeren van gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Onbekende fout bij het uitvoeren van apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1730,8 +1730,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Opwaardering wordt doorgerekend... "
+msgid "Calculating upgrade"
+msgstr "Opwaardering wordt doorgerekend"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/nn.po b/po/nn.po
index 7c5f77759..40f77e8be 100644
--- a/po/nn.po
+++ b/po/nn.po
@@ -1012,7 +1012,7 @@ msgid "At least one invalid signature was encountered."
msgstr ""
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1024,7 +1024,7 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
+msgid "Unknown error executing apt-key"
msgstr ""
#: methods/gpgv.cc:217 methods/gpgv.cc:224
@@ -1691,8 +1691,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Reknar ut oppgradering ... "
+msgid "Calculating upgrade"
+msgstr "Reknar ut oppgradering"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/pl.po b/po/pl.po
index 95785904a..1646a47e8 100644
--- a/po/pl.po
+++ b/po/pl.po
@@ -1060,9 +1060,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Napotkano przynajmniej jeden nieprawidłowy podpis."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Nie udało się uruchomić gpgv by zweryfikować podpis (czy gpgv jest "
+"Nie udało się uruchomić apt-key by zweryfikować podpis (czy gnupg jest "
"zainstalowane?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1074,8 +1074,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Nieznany błąd podczas uruchamiania gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Nieznany błąd podczas uruchamiania apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1774,8 +1774,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Obliczanie aktualizacji..."
+msgid "Calculating upgrade"
+msgstr "Obliczanie aktualizacji"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/pt.po b/po/pt.po
index 5dcd74bb5..b17fb0380 100644
--- a/po/pt.po
+++ b/po/pt.po
@@ -1050,9 +1050,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Pelo menos uma assinatura inválida foi encontrada."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Não foi possível executar 'gpgv' para verificar a assinatura (o gpgv está "
+"Não foi possível executar 'apt-key' para verificar a assinatura (o gnupg está "
"instalado?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1064,8 +1064,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Erro desconhecido ao executar gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Erro desconhecido ao executar apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1741,8 +1741,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "A calcular a actualização... "
+msgid "Calculating upgrade"
+msgstr "A calcular a actualização"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index c23a42275..0be44e8af 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -1022,10 +1022,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Ao menos uma assinatura inválida foi encontrada."
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Não foi possível executar '%s' para verificar a assinatura (o gpgv está "
+"Não foi possível executar 'apt-key' para verificar a assinatura (o gnupg está "
"instalado?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
@@ -1037,8 +1036,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Erro desconhecido executando gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Erro desconhecido executando apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1710,8 +1709,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calculando atualização... "
+msgid "Calculating upgrade"
+msgstr "Calculando atualização"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ro.po b/po/ro.po
index 2e556ef62..191cd5a44 100644
--- a/po/ro.po
+++ b/po/ro.po
@@ -1023,10 +1023,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Cel puțin o semnătură nevalidă a fost întâlnită."
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Nu s-a putut executa „%s” pentru verificarea semnăturii (gpgv este instalat?)"
+"Nu s-a putut executa „apt-key” pentru verificarea semnăturii (gnupg este instalat?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1037,8 +1036,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Eroare necunoscută în timp ce se execută gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Eroare necunoscută în timp ce se execută apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1717,8 +1716,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Calculez înnoirea... "
+msgid "Calculating upgrade"
+msgstr "Calculez înnoirea"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/ru.po b/po/ru.po
index 93d5163fb..35dc160e1 100644
--- a/po/ru.po
+++ b/po/ru.po
@@ -1059,8 +1059,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Найдена как минимум одна неправильная подпись."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Не удалось выполнить «gpgv» для проверки подписи (gpgv установлена?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Не удалось выполнить «apt-key» для проверки подписи (gnupg установлена?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1071,8 +1071,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Неизвестная ошибка при выполнении gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Неизвестная ошибка при выполнении apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1764,8 +1764,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Расчёт обновлений…"
+msgid "Calculating upgrade"
+msgstr "Расчёт обновлений"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/sk.po b/po/sk.po
index acfd4cf5b..855f309d2 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -1039,8 +1039,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Bola zistená aspoň jedna nesprávna signatúra."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Nedá sa spustiť „gpgv“ kvôli overeniu podpisu (je nainštalované gpgv?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Nedá sa spustiť „apt-key“ kvôli overeniu podpisu (je nainštalované gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1051,8 +1051,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Neznáma chyba pri spustení gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Neznáma chyba pri spustení apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1738,8 +1738,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Prepočítava sa aktualizácia... "
+msgid "Calculating upgrade"
+msgstr "Prepočítava sa aktualizácia"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/sl.po b/po/sl.po
index 69bf678d0..536d99465 100644
--- a/po/sl.po
+++ b/po/sl.po
@@ -1036,8 +1036,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Najden je bil vsaj en neveljaven podpis."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Ni mogoče izvesti 'gpgv' za preverjanje podpisa (je gpgv nameščen?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Ni mogoče izvesti 'apt-key' za preverjanje podpisa (je gnupg nameščen?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1048,8 +1048,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Neznana napaka med izvajanjem gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Neznana napaka med izvajanjem apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1739,8 +1739,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Preračunavanje nadgradnje ... "
+msgid "Calculating upgrade"
+msgstr "Preračunavanje nadgradnje"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/sv.po b/po/sv.po
index 5d11f06c2..d761c5c38 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -1025,9 +1025,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Minst en ogiltig signatur träffades på."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Kunde inte köra \"gpgv\" för att verifiera signatur (är gpgv installerad?)"
+"Kunde inte köra \"apt-key\" för att verifiera signatur (är gnupg installerad?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1038,8 +1038,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Okänt fel vid körning av gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Okänt fel vid körning av apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1723,8 +1723,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Beräknar uppgradering... "
+msgid "Calculating upgrade"
+msgstr "Beräknar uppgradering"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/th.po b/po/th.po
index 5d04c5cda..d241c1314 100644
--- a/po/th.po
+++ b/po/th.po
@@ -1052,8 +1052,8 @@ msgid "At least one invalid signature was encountered."
msgstr "พบลายเซ็นที่ใช้การไม่ได้อย่างน้อยหนึ่งรายการ"
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "ไม่สามารถเรียก 'gpgv' เพื่อตรวจสอบลายเซ็น (ได้ติดตั้ง gpgv ไว้หรือไม่?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "ไม่สามารถเรียก 'apt-key' เพื่อตรวจสอบลายเซ็น (ได้ติดตั้ง gnupg ไว้หรือไม่?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1066,8 +1066,8 @@ msgstr ""
"'%s' (เครือข่ายต้องยืนยันตัวบุคคลหรือไม่?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "เกิดข้อผิดพลาดไม่ทราบสาเหตุขณะเรียก gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "เกิดข้อผิดพลาดไม่ทราบสาเหตุขณะเรียก apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1718,8 +1718,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "กำลังคำนวณการปรับรุ่น... "
+msgid "Calculating upgrade"
+msgstr "กำลังคำนวณการปรับรุ่น"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/tl.po b/po/tl.po
index 49a96a24e..e1186c424 100644
--- a/po/tl.po
+++ b/po/tl.po
@@ -1017,10 +1017,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Hindi kukulang sa isang hindi tanggap na lagda ang na-enkwentro."
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Hindi maitakbo ang '%s' upang maberipika ang lagda (nakaluklok ba ang gpgv?)"
+"Hindi maitakbo ang 'apt-key' upang maberipika ang lagda (nakaluklok ba ang gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1031,8 +1030,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Hindi kilalang error sa pag-execute ng gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Hindi kilalang error sa pag-execute ng apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1700,8 +1699,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Sinusuri ang pag-upgrade... "
+msgid "Calculating upgrade"
+msgstr "Sinusuri ang pag-upgrade"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/tr.po b/po/tr.po
index a3cd7077f..b0a08c46d 100644
--- a/po/tr.po
+++ b/po/tr.po
@@ -1077,8 +1077,8 @@ msgid "At least one invalid signature was encountered."
msgstr "En az bir geçersiz imza ile karşılaşıldı."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "İmza doğrulama için 'gpgv' çalıştırılamadı (gpgv kurulu mu?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "İmza doğrulama için 'apt-key' çalıştırılamadı (gnupg kurulu mu?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1091,8 +1091,8 @@ msgstr ""
"gerektiriyor mu?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "gpgv çalıştırılırken bilinmeyen hata"
+msgid "Unknown error executing apt-key"
+msgstr "apt-key çalıştırılırken bilinmeyen hata"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1779,8 +1779,8 @@ msgid "All packages are up to date."
msgstr "Tüm paketler güncel."
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Yükseltme hesaplanıyor... "
+msgid "Calculating upgrade"
+msgstr "Yükseltme hesaplanıyor"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/uk.po b/po/uk.po
index 4f7b34a37..910e48dbf 100644
--- a/po/uk.po
+++ b/po/uk.po
@@ -1057,8 +1057,8 @@ msgid "At least one invalid signature was encountered."
msgstr "Знайдено як мінімум один невірний підпис."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "Неможливо виконати 'gpgv' для перевірки підпису (чи встановлено gpgv?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "Неможливо виконати 'apt-key' для перевірки підпису (чи встановлено gnupg?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1069,8 +1069,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Невідома помилка виконання gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Невідома помилка виконання apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1759,8 +1759,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Обчислення оновлень... "
+msgid "Calculating upgrade"
+msgstr "Обчислення оновлень"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/vi.po b/po/vi.po
index 71dcfa553..2532d68bf 100644
--- a/po/vi.po
+++ b/po/vi.po
@@ -1092,9 +1092,9 @@ msgid "At least one invalid signature was encountered."
msgstr "Gặp ít nhất một chữ ký không hợp lệ."
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
msgstr ""
-"Không thể thực hiện “gpgv” để thẩm tra chữ ký (gpgv đã được cài đặt chưa?)"
+"Không thể thực hiện “apt-key” để thẩm tra chữ ký (gnupg đã được cài đặt chưa?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1107,8 +1107,8 @@ msgstr ""
"không?)"
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "Gặp lỗi không rõ khi thực hiện gpgv"
+msgid "Unknown error executing apt-key"
+msgstr "Gặp lỗi không rõ khi thực hiện apt-key"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1774,8 +1774,8 @@ msgid "All packages are up to date."
msgstr "Mọi gói đã được cập nhật."
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "Đang tính toán nâng cấp... "
+msgid "Calculating upgrade"
+msgstr "Đang tính toán nâng cấp"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 67e69f716..79e433f3d 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -1006,8 +1006,8 @@ msgid "At least one invalid signature was encountered."
msgstr "至少发现一个无效的签名。"
#: methods/gpgv.cc:174
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "无法运行 gpgv 以验证签名(您安装了 gpgv 吗?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "无法运行 apt-key 以验证签名(您安装了 gnupg 吗?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1018,8 +1018,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "运行 gpgv 时发生未知错误"
+msgid "Unknown error executing apt-key"
+msgstr "运行 apt-key 时发生未知错误"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1669,8 +1669,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "正在对升级进行计算... "
+msgid "Calculating upgrade"
+msgstr "正在对升级进行计算"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index 59a8dcac7..c39e039af 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -998,9 +998,8 @@ msgid "At least one invalid signature was encountered."
msgstr "至少發現一個無效的簽章。"
#: methods/gpgv.cc:174
-#, fuzzy
-msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
-msgstr "無法執行 '%s' 來驗證簽章(gpgv 是否安裝了?)"
+msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
+msgstr "無法執行 'apt-key' 來驗證簽章(gnupg 是否安裝了?)"
#. TRANSLATORS: %s is a single techy word like 'NODATA'
#: methods/gpgv.cc:180
@@ -1011,8 +1010,8 @@ msgid ""
msgstr ""
#: methods/gpgv.cc:184
-msgid "Unknown error executing gpgv"
-msgstr "在執行 gpgv 時發生未知的錯誤"
+msgid "Unknown error executing apt-key"
+msgstr "在執行 apt-key 時發生未知的錯誤"
#: methods/gpgv.cc:217 methods/gpgv.cc:224
msgid "The following signatures were invalid:\n"
@@ -1669,8 +1668,8 @@ msgid "All packages are up to date."
msgstr ""
#: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade... "
-msgstr "籌備升級中... "
+msgid "Calculating upgrade"
+msgstr "籌備升級中"
#: apt-private/private-upgrade.cc:28
msgid "Done"
diff --git a/test/integration/framework b/test/integration/framework
index 7cf4d8a6d..e83606fae 100644
--- a/test/integration/framework
+++ b/test/integration/framework
@@ -133,13 +133,6 @@ gdb() {
shift
runapt command gdb --quiet -ex run "${BUILDDIRECTORY}/$CMD" --args "${BUILDDIRECTORY}/$CMD" "$@"
}
-gpg() {
- # see apt-key for the whole trickery. Setup is done in setupenvironment
- command gpg --ignore-time-conflict --no-options --no-default-keyring \
- --homedir "${TMPWORKINGDIRECTORY}/gnupghome" \
- --no-auto-check-trustdb --trust-model always \
- "$@"
-}
exitwithstatus() {
# error if we about to overflow, but ...
@@ -223,6 +216,7 @@ setupenvironment() {
echo "Debug::NoLocking \"true\";" >> aptconfig.conf
echo "APT::Get::Show-User-Simulation-Note \"false\";" >> aptconfig.conf
echo "Dir::Bin::Methods \"${METHODSDIR}\";" >> aptconfig.conf
+ echo "Dir::Bin::apt-key \"${BUILDDIRECTORY}/apt-key\";" >> aptconfig.conf
echo "Dir::Bin::dpkg \"fakeroot\";" >> aptconfig.conf
echo "DPKG::options:: \"dpkg\";" >> aptconfig.conf
echo "DPKG::options:: \"--root=${TMPWORKINGDIRECTORY}/rootdir\";" >> aptconfig.conf
@@ -238,19 +232,6 @@ setupenvironment() {
echo "Apt::Cmd::Disable-Script-Warning \"1\";" > rootdir/etc/apt/apt.conf.d/apt-binary
configcompression '.' 'gz' #'bz2' 'lzma' 'xz'
- # gpg needs a trustdb to function, but it can't be invalid (not even empty)
- # see also apt-key where this trickery comes from:
- local TRUSTDBDIR="${TMPWORKINGDIRECTORY}/gnupghome"
- mkdir "$TRUSTDBDIR"
- chmod 700 "$TRUSTDBDIR"
- # We also don't use a secret keyring, of course, but gpg panics and
- # implodes if there isn't one available - and writeable for imports
- local SECRETKEYRING="${TRUSTDBDIR}/secring.gpg"
- touch $SECRETKEYRING
- # now create the trustdb with an (empty) dummy keyring
- # newer gpg versions are fine without it, but play it safe for now
- gpg --quiet --check-trustdb --secret-keyring $SECRETKEYRING --keyring $SECRETKEYRING >/dev/null 2>&1
-
# cleanup the environment a bit
# prefer our apt binaries over the system apt binaries
export PATH="${BUILDDIRECTORY}:${PATH}:/usr/local/sbin:/usr/sbin:/sbin"
@@ -339,6 +320,36 @@ configcompression() {
done > ${TMPWORKINGDIRECTORY}/rootdir/etc/testcase-compressor.conf
}
+forcecompressor() {
+ COMPRESSOR="$1"
+ COMPRESSOR_CMD="$1"
+ case $COMPRESSOR in
+ gzip) COMPRESS='gz';;
+ bzip2) COMPRESS='bz2';;
+ lzma) COMPRESS='lzma';;
+ xz) COMPRESS='xz';;
+ *) msgdie "Compressor $COMPRESSOR is unknown to framework, so can't be forced by forcecompressor!";;
+ esac
+ local CONFFILE="${TMPWORKINGDIRECTORY}/rootdir/etc/apt/apt.conf.d/00force-compressor"
+ echo "Acquire::CompressionTypes::Order { \"${COMPRESS}\"; };
+Dir::Bin::uncompressed \"/does/not/exist\";
+Dir::Bin::gzip \"/does/not/exist\";
+Dir::Bin::bzip2 \"/does/not/exist\";
+Dir::Bin::lzma \"/does/not/exist\";
+Dir::Bin::xz \"/does/not/exist\";" > "$CONFFILE"
+ if [ -e "/bin/${COMPRESSOR}" ]; then
+ echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> "$CONFFILE"
+ elif [ -e "/usr/bin/${COMPRESSOR}" ]; then
+ echo "Dir::Bin::${COMPRESSOR} \"/usr/bin/${COMPRESSOR}\";" >> "$CONFFILE"
+ elif [ "${COMPRESSOR}" = 'lzma' ]; then
+ echo 'Dir::Bin::xz "/usr/bin/xz";' >> "$CONFFILE"
+ COMPRESSOR_CMD='xz --format=lzma'
+ else
+ msgtest 'Test for availability of compressor' "${COMPRESSOR}"
+ msgfail
+ fi
+}
+
setupsimplenativepackage() {
local NAME="$1"
local ARCH="$2"
@@ -448,8 +459,8 @@ Package: $NAME" >> ${BUILDDIR}/debian/control
| while read SRC; do
echo "pool/${SRC}" >> ${BUILDDIR}/../${RELEASE}.${DISTSECTION}.srclist
# if expr match "${SRC}" '.*\.dsc' >/dev/null 2>&1; then
-# gpg --yes --secret-keyring ./keys/joesixpack.sec \
-# --keyring ./keys/joesixpack.pub --default-key 'Joe Sixpack' \
+# aptkey --keyring ./keys/joesixpack.pub --secret-keyring ./keys/joesixpack.sec --quiet --readonly \
+# adv --yes --default-key 'Joe Sixpack' \
# --clearsign -o "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC"
# mv "${BUILDDIR}/../${SRC}.sign" "${BUILDDIR}/../$SRC"
# fi
@@ -834,8 +845,9 @@ setupaptarchive() {
signreleasefiles() {
local SIGNER="${1:-Joe Sixpack}"
- local GPG="gpg --batch --yes"
- msgninfo "\tSign archive with $SIGNER key… "
+ local KEY="keys/$(echo "$SIGNER" | tr 'A-Z' 'a-z' | sed 's# ##g')"
+ local GPG="aptkey --quiet --keyring ${KEY}.pub --secret-keyring ${KEY}.sec --readonly adv --batch --yes"
+ msgninfo "\tSign archive with $SIGNER key $KEY… "
local REXKEY='keys/rexexpired'
local SECEXPIREBAK="${REXKEY}.sec.bak"
local PUBEXPIREBAK="${REXKEY}.pub.bak"
@@ -851,17 +863,14 @@ signreleasefiles() {
cp $SECUNEXPIRED ${REXKEY}.sec
cp $PUBUNEXPIRED ${REXKEY}.pub
else
- printf "expire\n1w\nsave\n" | $GPG --keyring ${REXKEY}.pub --secret-keyring ${REXKEY}.sec --command-fd 0 --edit-key "${SIGNER}" >/dev/null 2>&1 || true
+ if ! printf "expire\n1w\nsave\n" | $GPG --default-key "$SIGNER" --command-fd 0 --edit-key "${SIGNER}" >setexpire.gpg 2>&1; then
+ cat setexpire.gpg
+ exit 1
+ fi
cp ${REXKEY}.sec $SECUNEXPIRED
cp ${REXKEY}.pub $PUBUNEXPIRED
fi
fi
- for KEY in $(find keys/ -name '*.sec'); do
- GPG="$GPG --secret-keyring $KEY"
- done
- for KEY in $(find keys/ -name '*.pub'); do
- GPG="$GPG --keyring $KEY"
- done
for RELEASE in $(find aptarchive/ -name Release); do
$GPG --default-key "$SIGNER" --armor --detach-sign --sign --output ${RELEASE}.gpg ${RELEASE}
local INRELEASE="$(echo "${RELEASE}" | sed 's#/Release$#/InRelease#')"
diff --git a/test/integration/test-allow-scores-for-all-dependency-types b/test/integration/test-allow-scores-for-all-dependency-types
index a5c98f3d6..d1bcf1130 100755
--- a/test/integration/test-allow-scores-for-all-dependency-types
+++ b/test/integration/test-allow-scores-for-all-dependency-types
@@ -39,6 +39,7 @@ insertinstalledpackage 'libdb-dev' 'amd64' '5.1.7' 'Depends: libdb5.1-dev'
insertinstalledpackage 'libdb5.1-dev' 'amd64' '5.1.29-7'
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
libdb5.1-dev
The following NEW packages will be installed:
@@ -53,6 +54,7 @@ Conf libdb5.3-dev (5.3.28-3 unversioned [amd64])
Conf libdb-dev (5.3.0 unversioned [amd64])' aptget dist-upgrade -st unversioned
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
libdb5.1-dev
The following NEW packages will be installed:
@@ -71,21 +73,25 @@ insertinstalledpackage 'foo' 'amd64' '1'
insertinstalledpackage 'bar' 'amd64' '1'
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
bar foo
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st unversioned
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
bar foo
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st versioned
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
bar foo
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.' aptget dist-upgrade -st multipleno
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
foo
The following packages will be upgraded:
diff --git a/test/integration/test-apt-cdrom b/test/integration/test-apt-cdrom
index 8d8fdf167..9fbc4288d 100755
--- a/test/integration/test-apt-cdrom
+++ b/test/integration/test-apt-cdrom
@@ -29,7 +29,7 @@ aptcdromlog() {
test ! -e rootdir/media/cdrom || echo "CD-ROM is mounted, but shouldn't be!"
test -e rootdir/media/cdrom-unmounted || echo "Unmounted CD-ROM doesn't exist, but it should!"
aptcdrom "$@" -o quiet=1 >rootdir/tmp/apt-cdrom.log 2>&1 </dev/null
- sed -e '/gpgv/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log
+ sed -e '/gpgv\?: Signature made/ d' -e '/gpgv\?: Good signature/ d' -e '/^Identifying/ d' -e '/Reading / d' rootdir/tmp/apt-cdrom.log
test ! -e rootdir/media/cdrom || echo "CD-ROM is mounted, but shouldn't be!"
test -e rootdir/media/cdrom-unmounted || echo "Unmounted CD-ROM doesn't exist, but it should!"
}
diff --git a/test/integration/test-apt-get-changelog b/test/integration/test-apt-get-changelog
index 4ee113482..02d6c39ab 100755
--- a/test/integration/test-apt-get-changelog
+++ b/test/integration/test-apt-get-changelog
@@ -13,6 +13,12 @@ setupaptarchive --no-update
changetowebserver
testsuccess aptget update
+# simulate normal user with non-existent root-owned directories
+rm -rf rootdir/var/cache/apt/archives/
+mkdir rootdir/var/cache/apt/archives/
+addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;"
+chmod -R -w rootdir/var/cache/apt/archives
+
echo 'Apt::Changelogs::Server "http://localhost:8080/";' > rootdir/etc/apt/apt.conf.d/changelog.conf
testequal "'http://localhost:8080//pool/apt_1.0/changelog'" aptget changelog apt --print-uris
diff --git a/test/integration/test-apt-get-clean b/test/integration/test-apt-get-clean
new file mode 100755
index 000000000..646ea31be
--- /dev/null
+++ b/test/integration/test-apt-get-clean
@@ -0,0 +1,34 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+
+setupenvironment
+configarchitecture 'amd64'
+
+insertpackage 'testing' 'foo' 'all' '1'
+insertpackage 'unstable' 'foo' 'all' '2'
+insertinstalledpackage 'foo' 'all' '3'
+
+setupaptarchive
+
+# nothing to do always works
+testsuccess aptget clean
+
+# generate some dirt and clean it up
+touch rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en
+touch rootdir/var/cache/apt/archives/foo_1_all.deb
+touch rootdir/var/cache/apt/archives/foo_2_all.deb
+touch rootdir/var/cache/apt/archives/foo_3_all.deb
+touch rootdir/var/cache/apt/archives/foo_4_all.deb
+
+testsuccess aptget clean
+
+testsuccess test ! -e rootdir/var/lib/apt/lists/partial/http.debian.net_debian_dists_sid_main_i18n_Translation-en
+testsuccess test ! -e rootdir/var/cache/apt/archives/foo_1_all.deb
+testsuccess test ! -e rootdir/var/cache/apt/archives/foo_2_all.deb
+testsuccess test ! -e rootdir/var/cache/apt/archives/foo_3_all.deb
+testsuccess test ! -e rootdir/var/cache/apt/archives/foo_4_all.deb
+
+
diff --git a/test/integration/test-apt-get-download b/test/integration/test-apt-get-download
index be3144e1f..58ed44f8f 100755
--- a/test/integration/test-apt-get-download
+++ b/test/integration/test-apt-get-download
@@ -20,10 +20,19 @@ testdownload() {
fi
msgtest "Test download of package file $1 with" "$APT"
testsuccess --nomsg aptget download ${APT}
- testsuccess test -f $1
- rm $1
+ testsuccess test -f "$1"
+ rm -f "$1"
}
+# normal case as "root"
+testdownload apt_2.0_all.deb apt
+
+# simulate normal user with non-existent root-owned directories
+rm -rf rootdir/var/cache/apt/archives/
+mkdir rootdir/var/cache/apt/archives/
+addtrap 'prefix' "chmod -f -R +w $PWD/rootdir/var/cache/apt/archives || true;"
+chmod -R -w rootdir/var/cache/apt/archives
+
# normal case(es)
testdownload apt_1.0_all.deb apt stable
testdownload apt_2.0_all.deb apt
@@ -45,3 +54,17 @@ rm -f apt_1.0_all.deb apt_2.0_all.deb
testsuccess aptget download apt apt apt/unstable apt=2.0
testsuccess test -s apt_2.0_all.deb
+# restore "root" rights
+chmod -f -R +w $PWD/rootdir/var/cache/apt/archives
+rm -rf rootdir/var/cache/apt/archives/
+
+# file: debs aren't copied to archives, so change to http which obviously are
+changetowebserver
+testsuccess aptget update
+
+# test with already stored deb
+testsuccess aptget install -d apt
+testsuccess test -s rootdir/var/cache/apt/archives/apt_2.0_all.deb
+mv aptarchive/pool/apt_2.0_all.deb aptarchive/pool/apt_2.0_all.deb.gone
+testdownload apt_2.0_all.deb apt
+mv aptarchive/pool/apt_2.0_all.deb.gone aptarchive/pool/apt_2.0_all.deb
diff --git a/test/integration/test-apt-get-upgrade b/test/integration/test-apt-get-upgrade
index 23446299c..5335c243a 100755
--- a/test/integration/test-apt-get-upgrade
+++ b/test/integration/test-apt-get-upgrade
@@ -31,6 +31,7 @@ setupaptarchive
# Test if normal upgrade works as expected
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
upgrade-with-conflict upgrade-with-new-dep
The following packages will be upgraded:
@@ -42,6 +43,7 @@ Conf upgrade-simple (2.0 unstable [all])' aptget -s upgrade
# Test if apt-get upgrade --with-new-pkgs works
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following NEW packages will be installed:
new-dep
The following packages have been kept back:
@@ -59,6 +61,7 @@ Conf upgrade-with-new-dep (2.0 unstable [all])' aptget -s upgrade --with-new-pkg
# Test if apt-get dist-upgrade works
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
conflicting-dep
The following NEW packages will be installed:
diff --git a/test/integration/test-apt-helper b/test/integration/test-apt-helper
index c749224ca..42c40bb9e 100755
--- a/test/integration/test-apt-helper
+++ b/test/integration/test-apt-helper
@@ -5,30 +5,30 @@ TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configarchitecture "i386"
+configarchitecture 'i386'
changetohttpswebserver
test_apt_helper_download() {
- echo "foo" > aptarchive/foo
+ echo 'foo' > aptarchive/foo
- msgtest 'apt-file download-file md5sum'
+ msgtest 'apt-file download-file' 'md5sum'
apthelper -qq download-file http://localhost:8080/foo foo2 MD5Sum:d3b07384d113edec49eaa6238ad5ff00 && msgpass || msgfail
testfileequal foo2 'foo'
- msgtest 'apt-file download-file sha1'
+ msgtest 'apt-file download-file' 'sha1'
apthelper -qq download-file http://localhost:8080/foo foo1 SHA1:f1d2d2f924e986ac86fdf7b36c94bcdf32beec15 && msgpass || msgfail
testfileequal foo1 'foo'
- msgtest 'apt-file download-file sha256'
+ msgtest 'apt-file download-file' 'sha256'
apthelper -qq download-file http://localhost:8080/foo foo3 SHA256:b5bb9d8014a0f9b1d61e21e796d78dccdf1352f23cd32812f4850b878ae4944c && msgpass || msgfail
testfileequal foo3 'foo'
- msgtest 'apt-file download-file no-hash'
+ msgtest 'apt-file download-file' 'no-hash'
apthelper -qq download-file http://localhost:8080/foo foo4 && msgpass || msgfail
testfileequal foo4 'foo'
- msgtest 'apt-file download-file wrong hash'
+ msgtest 'apt-file download-file' 'wrong hash'
if ! apthelper -qq download-file http://localhost:8080/foo foo5 MD5Sum:aabbcc 2>&1 2> download.stderr; then
msgpass
else
diff --git a/test/integration/test-apt-key b/test/integration/test-apt-key
index 68b3f9710..d5adec5bd 100755
--- a/test/integration/test-apt-key
+++ b/test/integration/test-apt-key
@@ -7,101 +7,170 @@ TESTDIR=$(readlink -f $(dirname $0))
setupenvironment
configarchitecture 'amd64'
-msgtest 'Check that paths in list output are not' 'double-slashed'
-aptkey list 2>&1 | grep -q '//' && msgfail || msgpass
+# start from a clean plate again
+cleanplate() {
+ rm -rf rootdir/etc/apt/trusted.gpg.d/ rootdir/etc/apt/trusted.gpg
+ mkdir rootdir/etc/apt/trusted.gpg.d/
+}
-msgtest 'Check that paths in finger output are not' 'double-slashed'
-aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass
+testaptkeys() {
+ if ! aptkey list | grep '^pub' > aptkey.list; then
+ echo -n > aptkey.list
+ fi
+ testequal "$1" cat ./aptkey.list
+}
echo 'APT::Key::ArchiveKeyring "./keys/joesixpack.pub";
APT::Key::RemovedKeys "./keys/rexexpired.pub";' > rootdir/etc/apt/apt.conf.d/aptkey.conf
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
+testrun() {
+ cleanplate
+ ln -sf ${TMPWORKINGDIRECTORY}/keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-testequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
+ msgtest 'Check that paths in list output are not' 'double-slashed'
+ aptkey list 2>&1 | grep -q '//' && msgfail || msgpass
+
+ msgtest 'Check that paths in finger output are not' 'double-slashed'
+ aptkey finger 2>&1 | grep -q '//' && msgfail || msgpass
+
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18'
+
+ testequal 'gpg: key DBAC8DAE: "Joe Sixpack (APT Testcases Dummy) <joe@example.org>" not changed
gpg: Total number processed: 1
gpg: unchanged: 1' aptkey --fakeroot update
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18'
-testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
+ testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
+ testaptkeys 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
pub 2048R/DBAC8DAE 2010-08-18'
-msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
-testsuccess --nomsg aptkey --fakeroot update
-
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
-
-msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring'
-testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE
+ msgtest 'Check that Sixpack key can be' 'exported'
+ aptkey export 'Sixpack' > aptkey.export
+ aptkey --keyring rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg exportall > aptkey.exportall
+ testsuccess --nomsg cmp aptkey.export aptkey.exportall
+ testsuccess test -s aptkey.export
+ testsuccess test -s aptkey.exportall
+
+ msgtest 'Execute update again to trigger removal of' 'Rex Expired key'
+ testsuccess --nomsg aptkey --fakeroot update
+
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18'
+
+ msgtest "Try to remove a key which exists, but isn't in the" 'forced keyring'
+ testsuccess --nomsg aptkey --fakeroot --keyring rootdir/etc/apt/trusted.gpg del DBAC8DAE
+
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18'
+
+ testsuccess aptkey --fakeroot del DBAC8DAE
+ testempty aptkey list
+
+ msgtest 'Test key removal with' 'single key in real file'
+ cleanplate
+ cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
+ testempty aptkey list
+ testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
+
+ msgtest 'Test key removal with' 'long key ID'
+ cleanplate
+ cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess --nomsg aptkey --fakeroot del 5A90D141DBAC8DAE
+ testempty aptkey list
+ testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
+
+ msgtest 'Test key removal with' 'fingerprint'
+ cleanplate
+ cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess --nomsg aptkey --fakeroot del 34A8E9D18DB320F367E8EAA05A90D141DBAC8DAE
+ testempty aptkey list
+ testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
+
+ msgtest 'Test key removal with' 'single key in softlink'
+ cleanplate
+ ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
+ testempty aptkey list
+ testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess test -L rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
+
+ cleanplate
+ testsuccess aptkey --fakeroot add ./keys/joesixpack.pub
+ testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/528144E2 2011-01-16'
+ cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse
+
+ msgtest 'Test key removal with' 'multi key in real file'
+ cleanplate
+ cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
+ testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
+ testaptkeys 'pub 2048R/528144E2 2011-01-16'
+ testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
+
+ msgtest 'Test key removal with' 'multi key in softlink'
+ cleanplate
+ ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg
+ testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
+ testaptkeys 'pub 2048R/528144E2 2011-01-16'
+ testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
+ testsuccess test ! -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg
+ testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
+
+ msgtest 'Test key removal with' 'multiple files including key'
+ cleanplate
+ cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
+ testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
+ testaptkeys 'pub 2048R/528144E2 2011-01-16'
+ testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
+ testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
+
+ cleanplate
+ cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
+ cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/528144E2 2011-01-16'
+ msgtest 'Test merge-back of' 'added keys'
+ testsuccess --nomsg aptkey adv --batch --yes --import keys/rexexpired.pub
+ testaptkeys 'pub 2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
+pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/528144E2 2011-01-16'
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
+ msgtest 'Test merge-back of' 'removed keys'
+ testsuccess --nomsg aptkey adv --batch --yes --delete-keys 27CE74F9
+ testaptkeys 'pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/DBAC8DAE 2010-08-18
+pub 2048R/528144E2 2011-01-16'
-testsuccess aptkey --fakeroot del DBAC8DAE
-testempty aptkey list
+ msgtest 'Test merge-back of' 'removed duplicate keys'
+ testsuccess --nomsg aptkey adv --batch --yes --delete-keys DBAC8DAE
+ testaptkeys 'pub 2048R/528144E2 2011-01-16'
+}
-# start from a clean plate again
-cleanplate() {
- rm -rf rootdir/etc/apt/trusted.gpg.d/ rootdir/etc/apt/trusted.gpg
- mkdir rootdir/etc/apt/trusted.gpg.d/
+setupgpgcommand() {
+ echo "APT::Key::GPGCommand \"$1\";" > rootdir/etc/apt/apt.conf.d/00gpgcmd
+ msgtest 'Test that apt-key uses for the following tests command' "$1"
+ aptkey adv --version >aptkey.version 2>&1
+ if grep -q "^Executing: $1 --" aptkey.version; then
+ msgpass
+ else
+ cat aptkey.version
+ msgfail
+ fi
}
-msgtest 'Test key removal with' 'single key in real file'
-cleanplate
-cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
-testempty aptkey list
-testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
-
-msgtest 'Test key removal with' 'single key in softlink'
-cleanplate
-ln -s $(readlink -f ./keys/joesixpack.pub) rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
-testempty aptkey list
-testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-testsuccess test -L rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
-
-cleanplate
-testsuccess aptkey --fakeroot add ./keys/joesixpack.pub
-testsuccess aptkey --fakeroot add ./keys/marvinparanoid.pub
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18
-pub 2048R/528144E2 2011-01-16'
-cp -a rootdir/etc/apt/trusted.gpg keys/testcase-multikey.pub # store for reuse
-
-msgtest 'Test key removal with' 'multi key in real file'
-cleanplate
-cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
-testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16'
-testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
-
-msgtest 'Test key removal with' 'multi key in softlink'
-cleanplate
-ln -s $(readlink -f ./keys/testcase-multikey.pub) rootdir/etc/apt/trusted.gpg.d/multikey.gpg
-testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16'
-testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
-testsuccess test ! -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg
-testsuccess test -L rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
-
-msgtest 'Test key removal with' 'multiple files including key'
-cleanplate
-cp -a keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-cp -a keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg
-testsuccess --nomsg aptkey --fakeroot del DBAC8DAE
-aptkey list | grep '^pub' > aptkey.list
-testfileequal ./aptkey.list 'pub 2048R/528144E2 2011-01-16'
-testsuccess test ! -e rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg
-testsuccess cmp keys/joesixpack.pub rootdir/etc/apt/trusted.gpg.d/joesixpack.gpg~
-testsuccess cmp keys/testcase-multikey.pub rootdir/etc/apt/trusted.gpg.d/multikey.gpg~
+# run with default (whatever this is)
+testrun
+# run with …
+setupgpgcommand 'gpg'
+testrun
+setupgpgcommand 'gpg2'
+testrun
diff --git a/test/integration/test-apt-key-net-update b/test/integration/test-apt-key-net-update
index 4b38cd9b5..b3c118555 100755
--- a/test/integration/test-apt-key-net-update
+++ b/test/integration/test-apt-key-net-update
@@ -28,6 +28,9 @@ gpg: key F68C85A3: public key "Test Automatic Archive Signing Key <ftpmaster@exa
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)' aptkey --fakeroot net-update
+aptkey list | grep '^pub' > aptkey.list
+testfileequal ./aptkey.list 'pub 1024R/F68C85A3 2013-12-19
+pub 2048R/DBAC8DAE 2010-08-18'
# now try a different one
# setup archive-keyring
@@ -38,6 +41,8 @@ echo 'APT::Key::Net-Update-Enabled "1";' >> ./aptconfig.conf
# test against the "real" webserver
testequal "Checking for new archive signing keys now
-Key 'E8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update
-
+Key 'DE66AECA9151AFA1877EC31DE8525D47528144E2' not added. It is not signed with a master key" aptkey --fakeroot net-update
+aptkey list | grep '^pub' > aptkey.list
+testfileequal ./aptkey.list 'pub 1024R/F68C85A3 2013-12-19
+pub 2048R/DBAC8DAE 2010-08-18'
diff --git a/test/integration/test-bug-507998-dist-upgrade-recommends b/test/integration/test-bug-507998-dist-upgrade-recommends
index 513421a94..f3b4e04fb 100755
--- a/test/integration/test-bug-507998-dist-upgrade-recommends
+++ b/test/integration/test-bug-507998-dist-upgrade-recommends
@@ -16,6 +16,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
tshark wireshark-common
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-bug-591882-conkeror b/test/integration/test-bug-591882-conkeror
index e1c0b42d1..891ddb8b7 100755
--- a/test/integration/test-bug-591882-conkeror
+++ b/test/integration/test-bug-591882-conkeror
@@ -9,6 +9,7 @@ setupaptarchive
UPGRADEFAIL="Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
conkeror libdatrie0 libkrb53 libxcb-xlib0 xulrunner-1.9
The following NEW packages will be installed:
@@ -40,6 +41,7 @@ E: Trivial Only specified but this is not a trivial operation."
UPGRADESUCCESS="Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
libdatrie0 libkrb53 libxcb-xlib0 xulrunner-1.9
The following NEW packages will be installed:
diff --git a/test/integration/test-bug-595691-empty-and-broken-archive-files b/test/integration/test-bug-595691-empty-and-broken-archive-files
index 8da0a52d2..683c174bd 100755
--- a/test/integration/test-bug-595691-empty-and-broken-archive-files
+++ b/test/integration/test-bug-595691-empty-and-broken-archive-files
@@ -48,37 +48,8 @@ createemptyfile() {
rm -f aptarchive/Packages
}
-setupcompressor() {
- COMPRESSOR="$1"
- COMPRESSOR_CMD="$1"
- case $COMPRESSOR in
- gzip) COMPRESS="gz";;
- bzip2) COMPRESS="bz2";;
- lzma) COMPRESS="lzma";;
- xz) COMPRESS="xz";;
- esac
- echo "Acquire::CompressionTypes::Order { \"${COMPRESS}\"; };
-Dir::Bin::uncompressed \"/does/not/exist\";
-Dir::Bin::gzip \"/does/not/exist\";
-Dir::Bin::bzip2 \"/does/not/exist\";
-Dir::Bin::lzma \"/does/not/exist\";
-Dir::Bin::xz \"/does/not/exist\";" > rootdir/etc/apt/apt.conf.d/00compressor
- if [ -e "/bin/${COMPRESSOR}" ]; then
- echo "Dir::Bin::${COMPRESSOR} \"/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor
- elif [ -e "/usr/bin/${COMPRESSOR}" ]; then
- echo "Dir::Bin::${COMPRESSOR} \"/usr/bin/${COMPRESSOR}\";" >> rootdir/etc/apt/apt.conf.d/00compressor
- elif [ "${COMPRESSOR}" = 'lzma' ]; then
- echo "Dir::Bin::xz \"/usr/bin/xz\";" >> rootdir/etc/apt/apt.conf.d/00compressor
- COMPRESSOR_CMD='xz --format=lzma'
- else
- msgtest "Test for availability of compressor" "${COMPRESSOR}"
- msgfail
- #exit 1
- fi
-}
-
testoverfile() {
- setupcompressor "$1"
+ forcecompressor "$1"
createemptyfile 'en'
testaptgetupdate 'Reading package lists...' "empty file en.$COMPRESS over file"
@@ -100,7 +71,7 @@ E: Some index files failed to download. They have been ignored, or old ones used
}
testoverhttp() {
- setupcompressor "$1"
+ forcecompressor "$1"
createemptyfile 'en'
testaptgetupdate "Get: http://localhost:8080 Packages []
@@ -121,7 +92,7 @@ Reading package lists..." "empty archive Packages.$COMPRESS over http"
testaptgetupdate "Get: http://localhost:8080 Packages
Err http://localhost:8080 Packages
Empty files can't be valid archives
-W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages) Empty files can't be valid archives
+W: Failed to fetch ${COMPRESSOR}:$(readlink -f rootdir/var/lib/apt/lists/partial/localhost:8080_Packages.${COMPRESS}) Empty files can't be valid archives
E: Some index files failed to download. They have been ignored, or old ones used instead." "empty file Packages.$COMPRESS over http"
}
diff --git a/test/integration/test-bug-605394-versioned-or-groups b/test/integration/test-bug-605394-versioned-or-groups
index 0f09d2927..bb72d59e3 100755
--- a/test/integration/test-bug-605394-versioned-or-groups
+++ b/test/integration/test-bug-605394-versioned-or-groups
@@ -9,6 +9,7 @@ setupaptarchive
testequal "Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
php5 php5-cgi
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-bug-612099-multiarch-conflicts b/test/integration/test-bug-612099-multiarch-conflicts
index 20dc3a7e5..c32600037 100755
--- a/test/integration/test-bug-612099-multiarch-conflicts
+++ b/test/integration/test-bug-612099-multiarch-conflicts
@@ -70,6 +70,7 @@ Conf foobar (1.0 stable [i386])' aptget install foobar/stable libc6 -st testing
testequal 'Reading package lists...
Building dependency tree...
Reading state information...
+Calculating upgrade...
The following packages will be upgraded:
libc6
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
@@ -168,6 +169,7 @@ Conf libc6-same:amd64 (1.0 stable [amd64])' aptget install libc6-same:amd64 -s -
testequal 'Reading package lists...
Building dependency tree...
Reading state information...
+Calculating upgrade...
The following packages will be upgraded:
libc6-same
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-bug-64141-install-dependencies-for-on-hold b/test/integration/test-bug-64141-install-dependencies-for-on-hold
index 9a9e7be10..9e6c223a8 100755
--- a/test/integration/test-bug-64141-install-dependencies-for-on-hold
+++ b/test/integration/test-bug-64141-install-dependencies-for-on-hold
@@ -21,6 +21,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
oldcrap
The following NEW packages will be installed:
@@ -35,6 +36,7 @@ testsuccess aptmark hold apt
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
apt
The following packages will be upgraded:
diff --git a/test/integration/test-bug-657695-resolver-breaks-on-virtuals b/test/integration/test-bug-657695-resolver-breaks-on-virtuals
index e9b27cfcd..1b92a04fe 100755
--- a/test/integration/test-bug-657695-resolver-breaks-on-virtuals
+++ b/test/integration/test-bug-657695-resolver-breaks-on-virtuals
@@ -18,6 +18,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
xserver-xorg-video-driver1 xserver-xorg-video-driver10
xserver-xorg-video-driver11 xserver-xorg-video-driver12
diff --git a/test/integration/test-bug-675449-essential-are-protected b/test/integration/test-bug-675449-essential-are-protected
index 7d8cc3484..2a27c62b1 100755
--- a/test/integration/test-bug-675449-essential-are-protected
+++ b/test/integration/test-bug-675449-essential-are-protected
@@ -69,6 +69,7 @@ Purg pkg-none-foreign:i386 [1]' aptget purge pkg-none-foreign:i386 -s
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following NEW packages will be installed:
pkg-depends-new:i386 pkg-none-new
The following packages will be upgraded:
diff --git a/test/integration/test-bug-680041-apt-mark-holds-correctly b/test/integration/test-bug-680041-apt-mark-holds-correctly
index 2e5e39c8e..3f40c23dc 100755
--- a/test/integration/test-bug-680041-apt-mark-holds-correctly
+++ b/test/integration/test-bug-680041-apt-mark-holds-correctly
@@ -19,6 +19,7 @@ runtests() {
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
pkgall pkgarch
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
@@ -30,6 +31,7 @@ E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgr
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
pkgarch
The following packages will be upgraded:
@@ -43,6 +45,7 @@ E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgr
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
pkgall pkgarch
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
@@ -54,6 +57,7 @@ E: Trivial Only specified but this is not a trivial operation.' aptget dist-upgr
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
pkgall
The following packages will be upgraded:
diff --git a/test/integration/test-bug-686346-package-missing-architecture b/test/integration/test-bug-686346-package-missing-architecture
index dc51861ab..8024f81da 100755
--- a/test/integration/test-bug-686346-package-missing-architecture
+++ b/test/integration/test-bug-686346-package-missing-architecture
@@ -53,6 +53,7 @@ testnopackage pkge:*
# this difference seems so important that it has to be maintained …
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade -s
# pkgd has no update with an architecture
diff --git a/test/integration/test-bug-733028-gpg-resource-limit b/test/integration/test-bug-733028-gpg-resource-limit
new file mode 100755
index 000000000..f9c804963
--- /dev/null
+++ b/test/integration/test-bug-733028-gpg-resource-limit
@@ -0,0 +1,27 @@
+#!/bin/sh
+set -e
+
+TESTDIR=$(readlink -f $(dirname $0))
+. $TESTDIR/framework
+setupenvironment
+configarchitecture 'i386'
+
+insertpackage 'unstable' 'foobar' 'all' '1'
+
+setupaptarchive --no-update
+
+for i in $(seq 1 50); do
+ touch rootdir/etc/apt/trusted.gpg.d/emptykey-${i}.gpg
+done
+
+aptkey list | grep '^pub' > aptkey.list
+testfileequal ./aptkey.list 'pub 2048R/DBAC8DAE 2010-08-18'
+
+msgtest 'Test for no gpg errors/warnings in' 'apt-get update'
+aptget update > update.log 2>&1
+if grep -iq 'GPG' update.log; then
+ msgfail
+ cat update.log
+else
+ msgpass
+fi
diff --git a/test/integration/test-bug-735967-lib32-to-i386-unavailable b/test/integration/test-bug-735967-lib32-to-i386-unavailable
index e9f3bf96d..826931fe4 100755
--- a/test/integration/test-bug-735967-lib32-to-i386-unavailable
+++ b/test/integration/test-bug-735967-lib32-to-i386-unavailable
@@ -33,6 +33,7 @@ testsuccess aptget update
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
lib32nss-mdns
The following packages will be upgraded:
@@ -60,6 +61,7 @@ testsuccess aptget update
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following NEW packages will be installed:
libnss-mdns:i386 libnss-mdns-i386:i386
The following packages will be upgraded:
diff --git a/test/integration/test-bug-740843-versioned-up-down-breaks b/test/integration/test-bug-740843-versioned-up-down-breaks
index cb035a71f..9426ffad1 100755
--- a/test/integration/test-bug-740843-versioned-up-down-breaks
+++ b/test/integration/test-bug-740843-versioned-up-down-breaks
@@ -24,6 +24,7 @@ setupaptarchive
testequalor2 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
foo-driver libfoo libfoo:i386 libgl1-foo-glx libgl1-foo-glx:i386
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
@@ -38,6 +39,7 @@ Conf libgl1-foo-glx:i386 (2 stable [i386])
Conf libgl1-foo-glx (2 stable [amd64])
Conf foo-driver (2 stable [amd64])' 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
foo-driver libfoo libfoo:i386 libgl1-foo-glx libgl1-foo-glx:i386
5 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-bug-758153-versioned-provides-support b/test/integration/test-bug-758153-versioned-provides-support
index 2904ae5a1..21f9123c9 100755
--- a/test/integration/test-bug-758153-versioned-provides-support
+++ b/test/integration/test-bug-758153-versioned-provides-support
@@ -28,6 +28,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
webapp webserver
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-compressed-indexes b/test/integration/test-compressed-indexes
index 6671dd75a..805ed5964 100755
--- a/test/integration/test-compressed-indexes
+++ b/test/integration/test-compressed-indexes
@@ -5,53 +5,68 @@ TESTDIR=$(readlink -f $(dirname $0))
. $TESTDIR/framework
setupenvironment
-configcompression '.' 'gz' # only gz is supported for this, so ensure it is used
-configarchitecture "i386"
-
-buildsimplenativepackage "testpkg" "i386" "1.0"
-setupaptarchive
-
-GOODSHOW="$(aptcache show testpkg)
-"
-GOODPOLICY="$(aptcache policy testpkg)"
-GOODSHOWSRC="$(aptcache showsrc testpkg)
-"
-
-test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken'
-testequal "$GOODSHOW" aptcache show testpkg
-test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4 || msgdie 'policy is broken'
-testequal "$GOODPOLICY" aptcache policy testpkg
-test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4 || msgdie 'showsrc is broken'
-testequal "$GOODSHOWSRC" aptcache showsrc testpkg
-
+configcompression '.' 'xz' 'bz2' 'lzma' 'gz'
+configarchitecture 'i386'
+
+buildsimplenativepackage 'testpkg' 'i386' '1.0'
+
+buildaptarchive
+setupdistsaptarchive
+# fake a pdiff setup as apt wouldn't try pdiffs otherwise
+find aptarchive -name 'Packages' -o -name 'Sources' | while read file; do
+ mkdir "${file}.diff"
+ PATCHINDEX="${file}.diff/Index"
+ echo 'SHA1-Current: adc83b19e793491b1c6ea0fd8b46cd9f32e592fc 0
+SHA1-History:
+ adc83b19e793491b1c6ea0fd8b46cd9f32e592fc 33053002 2010-08-18-2013.28
+ ecfd1b19e793491b1c6ea123eabdcd9f32e592fc 33053001 2010-08-18-2013.29
+SHA1-Patches:
+ abc1fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
+ dfe3444ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.29' > $PATCHINDEX
+done
+generatereleasefiles
+signreleasefiles
testrun() {
local F
- if [ -e rootdir/var/lib/apt/lists/*localhost*Release ]; then
- msgtest "Check if all index files are" "${1:-uncompressed}"
- if [ "$1" = "compressed" ]; then
- ! test -e rootdir/var/lib/apt/lists/*_Packages || F=1
- ! test -e rootdir/var/lib/apt/lists/*_Sources || F=1
- test -e rootdir/var/lib/apt/lists/*_Packages.gz || F=1
- test -e rootdir/var/lib/apt/lists/*_Sources.gz || F=1
- else
- test -e rootdir/var/lib/apt/lists/*_Packages || F=1
- test -e rootdir/var/lib/apt/lists/*_Sources || F=1
- ! test -e rootdir/var/lib/apt/lists/*_Packages.gz || F=1
- ! test -e rootdir/var/lib/apt/lists/*_Sources.gz || F=1
- fi
- if [ -n "$F" ]; then
- ls -laR rootdir/var/lib/apt/lists/
- msgfail
- else
- msgpass
- fi
- msgtest "Check if package is downloadable"
- testsuccess --nomsg aptget install -d testpkg
- msgtest "\tdeb file is present"; testsuccess --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb
- aptget clean
- msgtest "\tdeb file is gone"; testfailure --nomsg test -f rootdir/var/cache/apt/archives/testpkg_1.0_i386.deb
+ msgtest 'Check if all index files are' "${1:-uncompressed}"
+ if [ "$1" = 'compressed' ]; then
+ ! test -e rootdir/var/lib/apt/lists/*_Packages || F=1
+ ! test -e rootdir/var/lib/apt/lists/*_Sources || F=1
+ ! test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1
+ test -e rootdir/var/lib/apt/lists/*_Packages.${COMPRESS} || F=1
+ test -e rootdir/var/lib/apt/lists/*_Sources.${COMPRESS} || F=1
+ test -e rootdir/var/lib/apt/lists/*_Translation-en.${COMPRESS} || F=1
+ # there is no point in trying pdiff if we have compressed indexes
+ # as we can't patch compressed files (well, we can, but what is the point?)
+ ! test -e rootdir/var/lib/apt/lists/*.IndexDiff || F=1
+ else
+ # clear the faked pdiff indexes so the glob below works
+ rm -f rootdir/var/lib/apt/lists/*.IndexDiff
+ test -e rootdir/var/lib/apt/lists/*_Packages || F=1
+ test -e rootdir/var/lib/apt/lists/*_Sources || F=1
+ test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1
+ ! test -e rootdir/var/lib/apt/lists/*_Packages.* || F=1
+ ! test -e rootdir/var/lib/apt/lists/*_Sources.* || F=1
+ ! test -e rootdir/var/lib/apt/lists/*_Translation-en.* || F=1
fi
+ if [ -n "$F" ]; then
+ ls -laR rootdir/var/lib/apt/lists/
+ msgfail
+ else
+ msgpass
+ fi
+ msgtest 'Check if package is downloadable'
+ testsuccess --nomsg aptget download testpkg
+ msgtest '\tdeb file is present'; testsuccess --nomsg test -f testpkg_1.0_i386.deb
+ rm testpkg_1.0_i386.deb
+ testequal 'Reading package lists...
+Building dependency tree...
+The following NEW packages will be installed:
+ testpkg
+0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
+Inst testpkg (1.0 unstable [i386])
+Conf testpkg (1.0 unstable [i386])' aptget install testpkg -s
rm -f rootdir/var/cache/apt/pkgcache.bin rootdir/var/cache/apt/srcpkgcache.bin
testequal "$GOODSHOW" aptcache show testpkg
testequal "$GOODSHOW" aptcache show testpkg
@@ -62,73 +77,68 @@ testrun() {
testequal "$GOODSHOWSRC" aptcache showsrc testpkg
testequal "$GOODSHOWSRC" aptcache showsrc testpkg
aptget clean
- msgtest "Check if the source is aptgetable"
+ msgtest 'Check if the source is aptgetable'
testsuccess --nomsg aptget source testpkg
- msgtest "\tdsc file is present"; testsuccess --nomsg test -f testpkg_1.0.dsc
- msgtest "\tdirectory is present"; testsuccess --nomsg test -d testpkg-1.0
- rm -rf testpkg-1.0
+ msgtest '\tdsc file is present'; testsuccess --nomsg test -f testpkg_1.0.dsc
+ msgtest '\tdirectory is present'; testsuccess --nomsg test -d testpkg-1.0
+ rm -rf testpkg-1.0*
testequal "$(aptcache show testpkg -o Acquire::Languages=none)
" aptcache dumpavail
}
-echo 'Acquire::GzipIndexes "false";' > rootdir/etc/apt/apt.conf.d/02compressindex
-msgmsg "File: Test with uncompressed indexes"
-testrun
+echo 'Debug::pkgAcquire::worker "true";
+debug::pkgAcquire::Auth "true";
+Debug::pkgAcquire::Diffs "true";' > rootdir/etc/apt/apt.conf.d/99debugconf
-testsuccess aptget update -o Acquire::Pdiffs=1
-msgmsg "File: Test with uncompressed indexes (update unchanged with pdiffs)"
-testrun
+testovermethod() {
+ forcecompressor $2
-testsuccess aptget update -o Acquire::Pdiffs=0
-msgmsg "File: Test with uncompressed indexes (update unchanged without pdiffs)"
-testrun
+ for INDEX in 'false' 'true'; do
+ rm -rf rootdir/var/lib/apt/lists
+ echo "Acquire::GzipIndexes \"${INDEX}\";" > rootdir/etc/apt/apt.conf.d/02compressindex
+ local INDCOMP
+ if [ "$INDEX" = 'false' ]; then
+ INDCOMP='uncompressed'
+ else
+ INDCOMP='compressed'
+ fi
-rm -rf rootdir/var/lib/apt/lists
-echo 'Acquire::CompressionTypes::Order:: "gz";
-Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex
+ testsuccess aptget update
+ msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes"
+ testrun "$INDCOMP"
-testsuccess aptget update
-msgmsg "File: Test with compressed indexes"
-testrun "compressed"
+ testsuccess aptget update -o Acquire::Pdiffs=1
+ msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes (update unchanged with pdiffs)"
+ testrun "$INDCOMP"
-testsuccess aptget update -o Acquire::Pdiffs=1
-msgmsg "File: Test with compressed indexes (update unchanged with pdiffs)"
-testrun "compressed"
+ testsuccess aptget update -o Acquire::Pdiffs=0
+ msgmsg "${1}: ${COMPRESSOR}: Test with $INDCOMP indexes (update unchanged without pdiffs)"
+ testrun "$INDCOMP"
-testsuccess aptget update -o Acquire::Pdiffs=0
-msgmsg "File: Test with compressed indexes (update unchanged without pdiffs)"
-testrun "compressed"
+ rm rootdir/etc/apt/apt.conf.d/02compressindex
+ done
+}
-rm rootdir/etc/apt/apt.conf.d/02compressindex
-changetowebserver
testsuccess aptget update
+GOODSHOW="$(aptcache show testpkg)
+"
+test $(echo "$GOODSHOW" | grep -e '^Package: testpkg' -e '^Version: 1.0' -e '^Architecture: i386' | wc -l) -eq 3 || msgdie 'show is broken'
+testequal "$GOODSHOW" aptcache show testpkg
+GOODSHOWSRC="$(aptcache showsrc testpkg)
+"
+test $(echo "$GOODSHOWSRC" | grep -e '^Package: testpkg' -e '^Format: 3.0 (native)' -e '^Files:' -e '^Checksums-Sha256:' | wc -l) -eq 4 || msgdie 'showsrc is broken'
+testequal "$GOODSHOWSRC" aptcache showsrc testpkg
GOODPOLICY="$(aptcache policy testpkg)"
-test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4
+test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 file:/' | wc -l) -eq 4 || msgdie 'policy is broken'
testequal "$GOODPOLICY" aptcache policy testpkg
-msgmsg "HTTP: Test with uncompressed indexes"
-testrun
-
-testsuccess aptget update -o Acquire::Pdiffs=1
-msgmsg "HTTP: Test with uncompressed indexes (update unchanged with pdiffs)"
-testrun
-
-testsuccess aptget update -o Acquire::Pdiffs=0
-msgmsg "HTTP: Test with uncompressed indexes (update unchanged without pdiffs)"
-testrun
+for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'file' $COMPRESSOR; done
+changetowebserver
rm -rf rootdir/var/lib/apt/lists
-echo 'Acquire::CompressionTypes::Order:: "gz";
-Acquire::GzipIndexes "true";' > rootdir/etc/apt/apt.conf.d/02compressindex
-
testsuccess aptget update
-msgmsg "HTTP: Test with compressed indexes"
-testrun "compressed"
-
-testsuccess aptget update -o Acquire::Pdiffs=1
-msgmsg "HTTP: Test with compressed indexes (update unchanged with pdiffs)"
-testrun "compressed"
+GOODPOLICY="$(aptcache policy testpkg)"
+test $(echo "$GOODPOLICY" | grep -e '^testpkg:' -e '^ Candidate:' -e '^ Installed: (none)' -e '500 http://' | wc -l) -eq 4 || msgdie 'policy is broken'
+testequal "$GOODPOLICY" aptcache policy testpkg
-testsuccess aptget update -o Acquire::Pdiffs=0
-msgmsg "HTTP: Test with compressed indexes (update unchanged without pdiffs)"
-testrun "compressed"
+for COMPRESSOR in 'gzip' 'bzip2' 'lzma' 'xz'; do testovermethod 'http' $COMPRESSOR; done
diff --git a/test/integration/test-conflicts-loop b/test/integration/test-conflicts-loop
index a2c411aaf..0906ef8fa 100755
--- a/test/integration/test-conflicts-loop
+++ b/test/integration/test-conflicts-loop
@@ -17,6 +17,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
openjdk-6-jre openjdk-6-jre-headless openjdk-6-jre-lib
3 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-pin-non-existent-package b/test/integration/test-pin-non-existent-package
index 35de22115..c567e5285 100755
--- a/test/integration/test-pin-non-existent-package
+++ b/test/integration/test-pin-non-existent-package
@@ -26,6 +26,7 @@ testcandidate rapt '0.8.15'
testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
echo 'Package: rapt
@@ -36,6 +37,7 @@ testcandidate rapt '(none)'
testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist -q=0
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
echo '
@@ -55,6 +57,7 @@ testequal 'N: Unable to locate package doesntexist' aptcache policy doesntexist
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.' aptget dist-upgrade --trivial-only
echo 'Package: arch:amd64
diff --git a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew
index d647856cb..9d2ea2d5d 100755
--- a/test/integration/test-prevent-markinstall-multiarch-same-versionscrew
+++ b/test/integration/test-prevent-markinstall-multiarch-same-versionscrew
@@ -43,6 +43,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
out-of-sync-gone-foreign:i386 out-of-sync-gone-native
The following packages have been kept back:
diff --git a/test/integration/test-provides-gone-with-upgrade b/test/integration/test-provides-gone-with-upgrade
index 70384ce29..3b4bc2d04 100755
--- a/test/integration/test-provides-gone-with-upgrade
+++ b/test/integration/test-provides-gone-with-upgrade
@@ -15,6 +15,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following NEW packages will be installed:
libapt-pkg4.10
The following packages will be upgraded:
diff --git a/test/integration/test-resolve-by-keep-new-recommends b/test/integration/test-resolve-by-keep-new-recommends
index 8134b76aa..6b1772877 100755
--- a/test/integration/test-resolve-by-keep-new-recommends
+++ b/test/integration/test-resolve-by-keep-new-recommends
@@ -13,6 +13,7 @@ setupaptarchive
UPGRADE_KEEP="Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
foo
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded."
diff --git a/test/integration/test-ubuntu-bug-1304403-obsolete-priority-standard b/test/integration/test-ubuntu-bug-1304403-obsolete-priority-standard
index 2f2d384e1..45f70a898 100755
--- a/test/integration/test-ubuntu-bug-1304403-obsolete-priority-standard
+++ b/test/integration/test-ubuntu-bug-1304403-obsolete-priority-standard
@@ -27,6 +27,7 @@ setupaptarchive
# discourage keeping obsolete high-priority packages …
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be REMOVED:
not-downloadable
The following packages will be upgraded:
@@ -43,6 +44,7 @@ done
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages have been kept back:
upgradable
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.' aptget -s dist-upgrade
diff --git a/test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering b/test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering
index 462acad00..d2b6b9bad 100755
--- a/test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering
+++ b/test/integration/test-ubuntu-bug-985852-pre-depends-or-group-ordering
@@ -14,6 +14,7 @@ setupaptarchive
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
custom
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages b/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages
index c1d454f88..409d1212c 100755
--- a/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages
+++ b/test/integration/test-very-tight-loop-configure-with-unpacking-new-packages
@@ -28,6 +28,7 @@ setupaptarchive
testequalor2 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following NEW packages will be installed:
ure
The following packages will be upgraded:
@@ -44,6 +45,7 @@ Conf libreoffice-core (4 sid [amd64])
Conf libreoffice-style-galaxy (4 sid [amd64])
Conf libreoffice (4 sid [amd64])' 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following NEW packages will be installed:
ure
The following packages will be upgraded:
diff --git a/test/integration/test-xorg-break-providers b/test/integration/test-xorg-break-providers
index 139d2c915..0be57d979 100755
--- a/test/integration/test-xorg-break-providers
+++ b/test/integration/test-xorg-break-providers
@@ -26,6 +26,7 @@ E: Trivial Only specified but this is not a trivial operation.' aptget install x
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
xserver-xorg-core xserver-xorg-video-intel
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
@@ -35,6 +36,7 @@ E: Trivial Only specified but this is not a trivial operation.' aptget upgrade -
testequal 'Reading package lists...
Building dependency tree...
+Calculating upgrade...
The following packages will be upgraded:
xserver-xorg-core xserver-xorg-video-intel
2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
diff --git a/test/libapt/commandline_test.cc b/test/libapt/commandline_test.cc
index e403a28c8..627f1b486 100644
--- a/test/libapt/commandline_test.cc
+++ b/test/libapt/commandline_test.cc
@@ -2,6 +2,7 @@
#include <apt-pkg/cmndline.h>
#include <apt-pkg/configuration.h>
+#include <apt-private/private-cmndline.h>
#include <gtest/gtest.h>
@@ -85,3 +86,70 @@ TEST(CommandLineTest, BoolParsing)
}
}
+
+bool DoVoid(CommandLine &) { return false; }
+
+TEST(CommandLineTest,GetCommand)
+{
+ CommandLine::Dispatch Cmds[] = { {"install",&DoVoid}, {"remove", &DoVoid}, {0,0} };
+ {
+ char const * argv[] = { "apt-get", "-t", "unstable", "remove", "-d", "foo" };
+ char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv);
+ EXPECT_STREQ("remove", com);
+ std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com);
+ ::Configuration c;
+ CommandLine CmdL(Args.data(), &c);
+ ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv));
+ EXPECT_EQ(c.Find("APT::Default-Release"), "unstable");
+ EXPECT_TRUE(c.FindB("APT::Get::Download-Only"));
+ ASSERT_EQ(2, CmdL.FileSize());
+ EXPECT_EQ(std::string(CmdL.FileList[0]), "remove");
+ EXPECT_EQ(std::string(CmdL.FileList[1]), "foo");
+ }
+ {
+ char const * argv[] = {"apt-get", "-t", "unstable", "remove", "--", "-d", "foo" };
+ char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv);
+ EXPECT_STREQ("remove", com);
+ std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com);
+ ::Configuration c;
+ CommandLine CmdL(Args.data(), &c);
+ ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv));
+ EXPECT_EQ(c.Find("APT::Default-Release"), "unstable");
+ EXPECT_FALSE(c.FindB("APT::Get::Download-Only"));
+ ASSERT_EQ(3, CmdL.FileSize());
+ EXPECT_EQ(std::string(CmdL.FileList[0]), "remove");
+ EXPECT_EQ(std::string(CmdL.FileList[1]), "-d");
+ EXPECT_EQ(std::string(CmdL.FileList[2]), "foo");
+ }
+ {
+ char const * argv[] = {"apt-get", "-t", "unstable", "--", "remove", "-d", "foo" };
+ char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv);
+ EXPECT_STREQ("remove", com);
+ std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com);
+ ::Configuration c;
+ CommandLine CmdL(Args.data(), &c);
+ ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv));
+ EXPECT_EQ(c.Find("APT::Default-Release"), "unstable");
+ EXPECT_FALSE(c.FindB("APT::Get::Download-Only"));
+ ASSERT_EQ(CmdL.FileSize(), 3);
+ EXPECT_EQ(std::string(CmdL.FileList[0]), "remove");
+ EXPECT_EQ(std::string(CmdL.FileList[1]), "-d");
+ EXPECT_EQ(std::string(CmdL.FileList[2]), "foo");
+ }
+ {
+ char const * argv[] = {"apt-get", "install", "-t", "unstable", "--", "remove", "-d", "foo" };
+ char const * com = CommandLine::GetCommand(Cmds, sizeof(argv)/sizeof(argv[0]), argv);
+ EXPECT_STREQ("install", com);
+ std::vector<CommandLine::Args> Args = getCommandArgs("apt-get", com);
+ ::Configuration c;
+ CommandLine CmdL(Args.data(), &c);
+ ASSERT_TRUE(CmdL.Parse(sizeof(argv)/sizeof(argv[0]), argv));
+ EXPECT_EQ(c.Find("APT::Default-Release"), "unstable");
+ EXPECT_FALSE(c.FindB("APT::Get::Download-Only"));
+ ASSERT_EQ(CmdL.FileSize(), 4);
+ EXPECT_EQ(std::string(CmdL.FileList[0]), "install");
+ EXPECT_EQ(std::string(CmdL.FileList[1]), "remove");
+ EXPECT_EQ(std::string(CmdL.FileList[2]), "-d");
+ EXPECT_EQ(std::string(CmdL.FileList[3]), "foo");
+ }
+}
diff --git a/test/libapt/makefile b/test/libapt/makefile
index 69a13fd92..7f23ace46 100644
--- a/test/libapt/makefile
+++ b/test/libapt/makefile
@@ -14,8 +14,8 @@ test: $(BIN)/gtest$(BASENAME)
$(BIN)/gtest$(BASENAME): $(LIB)/gtest.a
PROGRAM = gtest${BASENAME}
-SLIBS = -lapt-pkg -pthread $(LIB)/gtest.a
-LIB_MAKES = apt-pkg/makefile
+SLIBS = -lapt-pkg -lapt-private -pthread $(LIB)/gtest.a
+LIB_MAKES = apt-pkg/makefile apt-private/makefile
SOURCE = gtest_runner.cc $(wildcard *-helpers.cc *_test.cc)
include $(PROGRAM_H)