1. 01 Feb, 2015 1 commit
  2. 24 Dec, 2014 1 commit
  3. 19 Oct, 2014 1 commit
  4. 16 Oct, 2014 2 commits
  5. 02 Oct, 2014 1 commit
    • Olivier Brunel's avatar
      alpm: Fix wrong xferred/total sizes when resuming downloads · 1e3c088c
      Olivier Brunel authored and Allan McRae's avatar Allan McRae committed
      When a package is already partially downloaded in the cache, its download
      size will only be of what's left to be downloaded. Since pkg->download_size
      is what's used when calculating the total download size for the totaldl
      callback, same thing apply.
      However, the download progress callback was including this initial size,
      which would thus lead to invalid values (and percentage) used in frontends.
      That is, the progress bar could e.g. go further than 100%
      In the case of pacman, there is a sanity check for different historical
      reason (44a57c89
      ), so before the possible "overflow" was noticed, the total
      download size/progress reported was wrong. Once caught, the TotalDownload
      option was ignored and it would use individual file download values as
      fallback instead.
      Signed-off-by: default avatarOlivier Brunel <jjk@jjacky.com>
      Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
  6. 04 Aug, 2014 1 commit
  7. 22 May, 2014 1 commit
  8. 28 Jan, 2014 1 commit
  9. 06 Jan, 2014 1 commit
  10. 19 Dec, 2013 1 commit
  11. 15 Nov, 2013 1 commit
  12. 07 Nov, 2013 1 commit
  13. 18 Sep, 2013 1 commit
    • Christian Hesse's avatar
      dload: avoid renaming files downloaded via sync operations · 3b3152fc
      Christian Hesse authored and Allan McRae's avatar Allan McRae committed
      If the server redirects from ${repo}.db to ${repo}.db.tar.gz pacman gets
      this wrong: It saves to new filename and fails when accessing
      We need the remote filename only when downloading remote files with
      pacman's -U operation. This introduces a new field 'trust_remote_name'
      to payload. If set pacman downloads to the filename given by the server.
      The field trust_remote_name is set in alpm_fetch_pkgurl().
      Fixes FS#36791 ([pacman] downloads to wrong filename with redirect).
      [dave: remove redundant assignment leading to memory leak]
      Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
  14. 21 Aug, 2013 1 commit
  15. 22 Jul, 2013 1 commit
  16. 05 Jul, 2013 1 commit
    • Dave Reisner's avatar
      do not check error from close(2) · eb19d41d
      Dave Reisner authored and Allan McRae's avatar Allan McRae committed
      On operating systems we support, the behavior is always such that the
      kernel will do the right thing as far as invalidating the file
      descriptor, regardless of the eventual return value. Therefore,
      potentially looping and calling close multiple times is wrong.
      At best, we call close again on an invalid FD and throw a spurious EBADF
      error. At worst, we might close an FD which doesn't belong to us when a
      multi-threaded application opens its own file descriptor between
      iterations of the loop.
      Signed-off-by: default avatarDave Reisner <dreisner@archlinux.org>
      Signed-off-by: Allan McRae's avatarAllan McRae <allan@archlinux.org>
  17. 24 Feb, 2013 1 commit
  18. 29 Jan, 2013 2 commits
  19. 17 Jan, 2013 1 commit
  20. 03 Jan, 2013 1 commit
  21. 14 Dec, 2012 1 commit
  22. 20 May, 2012 1 commit
  23. 09 Apr, 2012 1 commit
    • Dan McGee's avatar
      Fix issues with unintialized variable value usage · ded66fbb
      Dan McGee authored
      Detected by clang scan-build static code analyzer.
      * Don't attempt to free an uninitialized gpgme key variable
      * Initialize answer variable before asking frontend a question
      * Pass by reference instead of value if uninitialized fields are
        possible in download signal handler code
      * Ensure we never call strlen() on NULL payload->remote_name value
      Signed-off-by: default avatarDan McGee <dan@archlinux.org>
  24. 15 Mar, 2012 1 commit
  25. 20 Feb, 2012 1 commit
    • Nagy Gabor's avatar
      Print error message when to-be-downloaded file cannot be created · 31d95b86
      Nagy Gabor authored
      It can happen that the to-be-downloaded file cannot be created in cachedir.
      For example, I am an -Sup user, and it is comfortable to set --cachedir to
      /mnt/pendrive, which is a FAT filesystem, so files like
      capseo-1:0.3-2-i686.pkg.tar.xz cannot be downloaded to there.
      Before this patch, pacman didn't give clear output about what happens when
      the download code could not create the necessary file. This can be confusing
      with -Su. An example output:
      $ sudo pacman -S capseo bochs --cachedir /c/TEMP
      resolving dependencies...
      looking for inter-conflicts...
      Targets (2): bochs-2.4.6-1  capseo-1:0.3-2
      Total Download Size:    0.61 MiB
      Total Installed Size:   2.61 MiB
      Proceed with installation? [Y/n]
      :: Retrieving packages from extra...
      warning: failed to retrieve some files from extra
       bochs-2.4.6-1-i686       611.5 KiB   118K/s 00:05 [------------------]  97%
      error: failed to commit transaction (unexpected error)
      Errors occurred, no packages were upgraded.
      After the patch, pacman will give more informative error message (and
      pm_errno is set properly):
      error: could not open file '/c/TEMP/capseo-1:0.3-2-i686.pkg.tar.xz.part': Invalid argument
      error: failed to commit transaction (failed to retrieve some files)
      Unfortunately, the "could not open file" error message is printed for
      every mirror (that can be dozens of lines), which is ugly, but at least
      informative... Without modifying the download logic (for example, by
      introducing -2 return value for _alpm_download() to indicate giving up),
      this ugliness cannot be eliminated.
      Signed-off-by: default avatarNagy Gabor <ngaba@bibl.u-szeged.hu>
      Signed-off-by: default avatarDan McGee <dan@archlinux.org>
  26. 14 Feb, 2012 1 commit
  27. 23 Jan, 2012 2 commits
  28. 19 Jan, 2012 2 commits
  29. 22 Dec, 2011 1 commit
    • Dave Reisner's avatar
      include config.h via Makefiles · d6ccd443
      Dave Reisner authored
      Ensures that config.h is always ordered correctly (first) in the
      includes. Also means that new source files get this for free without
      having to remember to add it.
      We opt for -imacros over -include as its more portable, and the
      added constraint by -imacros doesn't bother us for config.h.
      This also touches the HACKING file to remove the explicit mention of
      config.h as part of the includes.
      Signed-off-by: default avatarDave Reisner <dreisner@archlinux.org>
      Signed-off-by: default avatarDan McGee <dan@archlinux.org>
  30. 05 Dec, 2011 1 commit
  31. 01 Nov, 2011 1 commit
  32. 27 Oct, 2011 2 commits
  33. 24 Oct, 2011 1 commit
    • Dan McGee's avatar
      Add more logging to download code · 58530251
      Dan McGee authored
      This adds a logger to the CURLE_OK case so we can always know the return
      code if it was >= 400, and debug log it regardless. Also adjust another
      logger to use the cURL error message directly, as well as use fstat()
      when we have an open file handle rather than stat().
      Signed-off-by: default avatarDan McGee <dan@archlinux.org>
  34. 13 Oct, 2011 1 commit
    • Dan McGee's avatar
      curl_gethost() potential bug fixups · 86bc3641
      Dan McGee authored
      This is in the realm of "probably not going to happen", but if someone
      were to translate "disk" to a string longer than 256 characters, we
      would have a smashed/corrupted stack due to our unchecked strcpy() call.
      Rework the function to always length-check the value we copy into the
      hostname buffer, and do it with memcpy rather than the more cumbersome
      and unnecessary snprintf.
      Finally, move the magic 256 value into a constant and pass it into the
      function which is going to get inlined anyway.
      Signed-off-by: default avatarDan McGee <dan@archlinux.org>
  35. 11 Oct, 2011 1 commit