summaryrefslogtreecommitdiff
path: root/apt-pkg/deb
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2010-10-15 18:30:09 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2010-10-15 18:30:09 +0200
commitb71a4a8dcd8b1d0e82f8071e5e993cc6423c6a57 (patch)
tree88c3ff0df846f2af9e901872f67e21b051129e3f /apt-pkg/deb
parent58d0598ad6f1c514bf7d89fdea676a697f0d9388 (diff)
parent95fe33dc131bee1a0917ba647e44855c10083ab5 (diff)
merged from debian-sid
Diffstat (limited to 'apt-pkg/deb')
-rw-r--r--apt-pkg/deb/debindexfile.cc44
-rw-r--r--apt-pkg/deb/deblistparser.cc1
2 files changed, 36 insertions, 9 deletions
diff --git a/apt-pkg/deb/debindexfile.cc b/apt-pkg/deb/debindexfile.cc
index a89a2574f..af1209ccb 100644
--- a/apt-pkg/deb/debindexfile.cc
+++ b/apt-pkg/deb/debindexfile.cc
@@ -149,11 +149,20 @@ bool debSourcesIndex::Exists() const
/* */
unsigned long debSourcesIndex::Size() const
{
+ unsigned long size = 0;
+
+ /* we need to ignore errors here; if the lists are absent, just return 0 */
+ _error->PushToStack();
+
FileFd f = FileFd (IndexFile("Sources"), FileFd::ReadOnlyGzip);
+ if (!f.Failed())
+ size = f.Size();
- if (f.Failed())
- return 0;
- return f.Size();
+ if (_error->PendingError() == true)
+ size = 0;
+ _error->RevertToStack();
+
+ return size;
}
/*}}}*/
@@ -269,11 +278,20 @@ bool debPackagesIndex::Exists() const
/* This is really only used for progress reporting. */
unsigned long debPackagesIndex::Size() const
{
+ unsigned long size = 0;
+
+ /* we need to ignore errors here; if the lists are absent, just return 0 */
+ _error->PushToStack();
+
FileFd f = FileFd (IndexFile("Packages"), FileFd::ReadOnlyGzip);
+ if (!f.Failed())
+ size = f.Size();
- if (f.Failed())
- return 0;
- return f.Size();
+ if (_error->PendingError() == true)
+ size = 0;
+ _error->RevertToStack();
+
+ return size;
}
/*}}}*/
// PackagesIndex::Merge - Load the index file into a cache /*{{{*/
@@ -460,12 +478,20 @@ bool debTranslationsIndex::Exists() const
/* This is really only used for progress reporting. */
unsigned long debTranslationsIndex::Size() const
{
+ unsigned long size = 0;
+
+ /* we need to ignore errors here; if the lists are absent, just return 0 */
+ _error->PushToStack();
+
FileFd f = FileFd (IndexFile(Language), FileFd::ReadOnlyGzip);
+ if (!f.Failed())
+ size = f.Size();
- if (f.Failed())
- return 0;
+ if (_error->PendingError() == true)
+ size = 0;
+ _error->RevertToStack();
- return f.Size();
+ return size;
}
/*}}}*/
// TranslationsIndex::Merge - Load the index file into a cache /*{{{*/
diff --git a/apt-pkg/deb/deblistparser.cc b/apt-pkg/deb/deblistparser.cc
index da8b0271b..1b3bfd6ae 100644
--- a/apt-pkg/deb/deblistparser.cc
+++ b/apt-pkg/deb/deblistparser.cc
@@ -481,6 +481,7 @@ const char *debListParser::ConvertRelation(const char *I,unsigned int &Op)
*/
static string CompleteArch(std::string& arch) {
if (arch == "armel") return "linux-arm";
+ if (arch == "armhf") return "linux-arm";
if (arch == "lpia") return "linux-i386";
if (arch == "powerpcspe") return "linux-powerpc";
if (arch == "uclibc-linux-armel") return "linux-arm";