summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Burrows <dburrows@debian.org>2011-03-30 09:25:45 -0700
committerDaniel Burrows <dburrows@debian.org>2011-03-30 09:25:45 -0700
commit3605a316776eee62aeef478e3992399b7a62f008 (patch)
tree7363355ab6b892982686c8c9896a2405f19f4283 /src
parent3aef7ef725cb716bc6f93027d07d5e0fd4a9cd49 (diff)
downloadaptitude-3605a316776eee62aeef478e3992399b7a62f008.tar.gz
Fix compile errors caused by changes in the libapt API.
Whoever's in charge of libapt these days apparently doesn't believe in backwards compatibility. Or in documenting how their APIs are to be used, or why names are deprecated </gripe>
Diffstat (limited to 'src')
-rw-r--r--src/cmdline/cmdline_download.cc3
-rw-r--r--src/cmdline/cmdline_download_progress_display.cc10
-rw-r--r--src/cmdline/cmdline_prompt.cc5
-rw-r--r--src/generic/apt/aptitude_resolver.cc38
-rw-r--r--src/generic/apt/changelog_parse.cc8
-rw-r--r--src/generic/apt/download_install_manager.cc5
-rw-r--r--src/generic/apt/download_queue.cc7
-rw-r--r--src/generic/apt/download_update_manager.cc7
-rw-r--r--src/generic/views/download_progress.h7
-rw-r--r--src/main.cc4
10 files changed, 32 insertions, 62 deletions
diff --git a/src/cmdline/cmdline_download.cc b/src/cmdline/cmdline_download.cc
index 48881643..68329faf 100644
--- a/src/cmdline/cmdline_download.cc
+++ b/src/cmdline/cmdline_download.cc
@@ -63,7 +63,8 @@ int cmdline_download(int argc, char *argv[])
std::pair<download_signal_log *, boost::shared_ptr<acquire_download_progress> >
progress_display = create_cmdline_download_progress(term, term, term, term);
- pkgAcquire fetcher(progress_display.first);
+ pkgAcquire fetcher;
+ fetcher.Setup(progress_display.first);
string filenames[(*apt_cache_file)->Head().PackageCount];
string default_release = aptcfg->Find("APT::Default-Release");
diff --git a/src/cmdline/cmdline_download_progress_display.cc b/src/cmdline/cmdline_download_progress_display.cc
index 15febc6f..5c16cb38 100644
--- a/src/cmdline/cmdline_download_progress_display.cc
+++ b/src/cmdline/cmdline_download_progress_display.cc
@@ -1,6 +1,6 @@
/** \file cmdline_download_progress_display.cc */
-// Copyright (C) 2010 Daniel Burrows
+// Copyright (C) 2010-2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -74,11 +74,11 @@ namespace aptitude
void file_started(const std::string &description,
const boost::optional<unsigned long> &id,
- const boost::optional<unsigned long> &file_size);
+ const boost::optional<unsigned long long> &file_size);
void file_already_downloaded(const std::string &description,
const boost::optional<unsigned long> &id,
- const boost::optional<unsigned long> &file_size);
+ const boost::optional<unsigned long long> &file_size);
void error(bool ignored,
const std::string &error,
@@ -122,7 +122,7 @@ namespace aptitude
void download_progress::file_started(const std::string &description,
const boost::optional<unsigned long> &id,
- const boost::optional<unsigned long> &file_size)
+ const boost::optional<unsigned long long> &file_size)
{
if(display_messages)
{
@@ -145,7 +145,7 @@ namespace aptitude
void download_progress::file_already_downloaded(const std::string &description,
const boost::optional<unsigned long> &id,
- const boost::optional<unsigned long> &file_size)
+ const boost::optional<unsigned long long> &file_size)
{
if(display_messages)
{
diff --git a/src/cmdline/cmdline_prompt.cc b/src/cmdline/cmdline_prompt.cc
index 2e888ab6..eb94fac9 100644
--- a/src/cmdline/cmdline_prompt.cc
+++ b/src/cmdline/cmdline_prompt.cc
@@ -1,6 +1,6 @@
// cmdline_prompt.cc
//
-// Copyright (C) 2010 Daniel Burrows
+// Copyright (C) 2010-2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -82,7 +82,8 @@ static bool pkg_byname_compare(const pkgCache::PkgIterator &a, const pkgCache::P
static bool get_fetchinfo(fetchinfo &f)
{
download_signal_log m;
- pkgAcquire fetcher(&m);
+ pkgAcquire fetcher;
+ fetcher.Setup(&m);
pkgSourceList l;
if(!l.ReadMainList())
return _error->Error(_("Couldn't read list of sources"));
diff --git a/src/generic/apt/aptitude_resolver.cc b/src/generic/apt/aptitude_resolver.cc
index 6331fb33..cae6a937 100644
--- a/src/generic/apt/aptitude_resolver.cc
+++ b/src/generic/apt/aptitude_resolver.cc
@@ -1,6 +1,6 @@
// aptitude_resolver.cc
//
-// Copyright (C) 2005, 2008-2010 Daniel Burrows
+// Copyright (C) 2005, 2008-2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -86,42 +86,6 @@ namespace
}
// Logging operators.
-std::ostream &operator<<(std::ostream &out, const pkgCache::DepIterator &dep)
-{
- pkgCache::DepIterator d = dep;
- bool first = true;
-
- while(true)
- {
- if(first)
- first = false;
- else
- out << " | ";
-
- out << const_cast<pkgCache::DepIterator &>(dep).ParentPkg().Name()
- << " " << const_cast<pkgCache::DepIterator &>(dep).ParentVer().VerStr()
- << " " << const_cast<pkgCache::DepIterator &>(dep).DepType()
- << " " << const_cast<pkgCache::DepIterator &>(dep).TargetPkg().Name();
-
- if((dep->CompareOp & ~pkgCache::Dep::Or) != pkgCache::Dep::NoOp &&
- dep.TargetVer() != NULL)
- {
- out << " (" << const_cast<pkgCache::DepIterator &>(dep).CompType()
- << " " << dep.TargetVer()
- << ")";
- }
-
- if((d->CompareOp & pkgCache::Dep::Or) == 0)
- break;
-
- ++d;
-
- if(d.end())
- break; // Shouldn't happen.
- }
-
- return out;
-}
// Should version selections be logged the way they're written?
// That's a little awkward since the syntax is hairy and some of them
diff --git a/src/generic/apt/changelog_parse.cc b/src/generic/apt/changelog_parse.cc
index 90911fa2..cd109459 100644
--- a/src/generic/apt/changelog_parse.cc
+++ b/src/generic/apt/changelog_parse.cc
@@ -1,6 +1,6 @@
// changelog_parse.cc
//
-// Copyright (C) 2005, 2008-2009 Daniel Burrows
+// Copyright (C) 2005, 2008-2009, 2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -66,9 +66,9 @@ namespace aptitude
could_parse_date(false),
date(0)
{
- // I use StrToTime instead of strptime because strptime is
- // locale-dependent.
- could_parse_date = StrToTime(date_str, date);
+ // I use RFC1123StrToTime instead of strptime because strptime
+ // is locale-dependent.
+ could_parse_date = RFC1123StrToTime(date_str.c_str(), date);
}
// Skips over whitespace in a text element, spilling elements as
diff --git a/src/generic/apt/download_install_manager.cc b/src/generic/apt/download_install_manager.cc
index 7cebd369..9ba5e47e 100644
--- a/src/generic/apt/download_install_manager.cc
+++ b/src/generic/apt/download_install_manager.cc
@@ -1,6 +1,6 @@
// download_install_manager.cc
//
-// Copyright (C) 2005-2010 Daniel Burrows
+// Copyright (C) 2005-2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -89,7 +89,8 @@ bool download_install_manager::prepare(OpProgress &progress,
return false;
}
- fetcher = new pkgAcquire(&acqlog);
+ fetcher = new pkgAcquire;
+ fetcher->Setup(&acqlog);
if(!pm->GetArchives(fetcher, &src_list, apt_package_records) ||
_error->PendingError())
diff --git a/src/generic/apt/download_queue.cc b/src/generic/apt/download_queue.cc
index 51333b11..0c0b184c 100644
--- a/src/generic/apt/download_queue.cc
+++ b/src/generic/apt/download_queue.cc
@@ -1,7 +1,7 @@
/** \file download_queue.cc */
-// Copyright (C) 2009-2010 Daniel Burrows
+// Copyright (C) 2009-2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -316,7 +316,7 @@ namespace aptitude
{
const std::string lastModifiedTimeStr = LookupTag(Message, "Last-Modified");
time_t lastModifiedTime = 0;
- if(!StrToTime(lastModifiedTimeStr, lastModifiedTime))
+ if(!RFC1123StrToTime(lastModifiedTimeStr.c_str(), lastModifiedTime))
lastModifiedTime = 0;
LOG_INFO(Loggers::getAptitudeDownloadQueue(),
@@ -925,7 +925,8 @@ namespace aptitude
"Setting up the download process for the background download queue.");
download_callback cb;
- pkgAcquire downloader(&cb);
+ pkgAcquire downloader;
+ downloader.Setup(&cb);
for(std::deque<boost::shared_ptr<start_request> >::const_iterator it =
start_requests.begin();
diff --git a/src/generic/apt/download_update_manager.cc b/src/generic/apt/download_update_manager.cc
index a0cc8413..c27fbbf3 100644
--- a/src/generic/apt/download_update_manager.cc
+++ b/src/generic/apt/download_update_manager.cc
@@ -1,6 +1,6 @@
// download_update_manager.cc
//
-// Copyright (C) 2005, 2007-2009 Daniel Burrows
+// Copyright (C) 2005, 2007-2009, 2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -94,7 +94,8 @@ bool download_update_manager::prepare(OpProgress &progress,
}
}
- fetcher = new pkgAcquire(&acqlog);
+ fetcher = new pkgAcquire();
+ fetcher->Setup(&acqlog);
if(!src_list.GetIndexes(fetcher))
{
@@ -328,7 +329,7 @@ void download_update_manager::finish(pkgAcquire::RunResult res,
// redundant work at the command-line.
{
pkgCacheFile cachefile;
- if(!cachefile.BuildCaches(*progress, true))
+ if(!cachefile.BuildCaches(progress, true))
{
_error->Error(_("Couldn't rebuild package cache"));
k(failure);
diff --git a/src/generic/views/download_progress.h b/src/generic/views/download_progress.h
index 427c02c9..1b6c919a 100644
--- a/src/generic/views/download_progress.h
+++ b/src/generic/views/download_progress.h
@@ -1,6 +1,6 @@
/** \file download_progress.h */ // -*-c++-*-
-// Copyright (C) 2010 Daniel Burrows
+// Copyright (C) 2010-2011 Daniel Burrows
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
@@ -174,7 +174,7 @@ namespace aptitude
*/
virtual void file_started(const std::string &description,
const boost::optional<unsigned long> &id,
- const boost::optional<unsigned long> &file_size) = 0;
+ const boost::optional<unsigned long long> &file_size) = 0;
/** \brief Invoked when a file isn't even started because it was
* already downloaded.
@@ -185,9 +185,10 @@ namespace aptitude
* \param file_size The size of the file; invalid if the
* file size isn't known.
*/
+
virtual void file_already_downloaded(const std::string &description,
const boost::optional<unsigned long> &id,
- const boost::optional<unsigned long> &file_size) = 0;
+ const boost::optional<unsigned long long> &file_size) = 0;
/** \brief Invoked when a file fails to download.
*
diff --git a/src/main.cc b/src/main.cc
index 590dc110..748d5267 100644
--- a/src/main.cc
+++ b/src/main.cc
@@ -1,6 +1,6 @@
// main.cc (neƩ testscr.cc)
//
-// Copyright 1999-2010 Daniel Burrows
+// Copyright 1999-2011 Daniel Burrows
//
// 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
@@ -1107,7 +1107,7 @@ int main(int argc, char *argv[])
{
// Connect up the "please consume errors" routine for the
// command-line.
- consume_errors.connect(sigc::mem_fun(_error, &GlobalError::DumpErrors));
+ consume_errors.connect(sigc::mem_fun(_error, (void (GlobalError::*)()) &GlobalError::DumpErrors));
if(update_only || install_only || autoclean_only || clean_only)
{