~ubuntu-branches/ubuntu/vivid/aptitude/vivid

« back to all changes in this revision

Viewing changes to src/cmdline/cmdline_download.cc

  • Committer: Bazaar Package Importer
  • Author(s): Michael Vogt
  • Date: 2011-06-22 12:32:56 UTC
  • mfrom: (1.8.6 sid)
  • Revision ID: james.westby@ubuntu.com-20110622123256-8aox9w9ch3x72dci
Tags: 0.6.4-1ubuntu1
* Merge from debian unstable.  Remaining changes:
  - debian/05aptitude: never autoremove kernels
  - drop aptitude-doc to Suggests
  - 03_branding.dpatch: ubuntu branding
  - 04_changelog.dpatch: take changelogs from changelogs.ubuntu.com
  - 09_ubuntu_fortify_source.dpatch: Suppress a number of warnings (turned
    into errors by -Werror) triggered by Ubuntu's default of
    -D_FORTIFY_SOURCE=2.
  - 11_ubuntu_uses_sudo.dpatch: fix status line of 'Become root' menu entry
    to not refer to su.
  - 12_point_manpage_to_doc_package.dpatch: point Finnish manpage to the
    correct place for further info
  - 14_html2text_preferred.dpatch: switch back to html2text in favor of
    elinks, since html2text is in main and elinks isn't.
* dropped 01_intltool_update.dpatch
* updated 15_ftbfs_new_apt

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
#include <stdio.h>
29
29
 
 
30
using aptitude::controllers::acquire_download_progress;
 
31
using aptitude::cmdline::create_cmdline_download_progress;
30
32
using aptitude::cmdline::create_terminal;
31
 
using aptitude::cmdline::create_terminal_locale;
32
33
using aptitude::cmdline::make_text_progress;
33
 
using aptitude::cmdline::terminal;
 
34
using aptitude::cmdline::terminal_io;
34
35
using aptitude::cmdline::terminal_locale;
35
36
using boost::shared_ptr;
36
37
 
37
38
// Download stuff to the current directory
38
39
int cmdline_download(int argc, char *argv[])
39
40
{
40
 
  shared_ptr<terminal> term = create_terminal();
41
 
  shared_ptr<terminal_locale> term_locale = create_terminal_locale();
 
41
  shared_ptr<terminal_io> term = create_terminal();
42
42
 
43
43
  if(argc<=1)
44
44
    {
48
48
 
49
49
  _error->DumpErrors();
50
50
 
51
 
  shared_ptr<OpProgress> progress = make_text_progress(false, term, term_locale);
 
51
  shared_ptr<OpProgress> progress = make_text_progress(false, term, term, term);
52
52
  apt_init(progress.get(), false);
53
53
 
54
54
  pkgSourceList list;
59
59
      _error->DumpErrors();
60
60
      return -1;
61
61
    }
62
 
  pkgAcquire fetcher(gen_cmdline_download_progress(term));
 
62
 
 
63
  std::pair<download_signal_log *, boost::shared_ptr<acquire_download_progress> >
 
64
    progress_display = create_cmdline_download_progress(term, term, term, term);
 
65
 
 
66
  pkgAcquire fetcher;
 
67
  fetcher.Setup(progress_display.first);
63
68
  string filenames[(*apt_cache_file)->Head().PackageCount];
64
69
  string default_release = aptcfg->Find("APT::Default-Release");
65
70