diff -Nru apt-fast-1.9.10/apt-fast apt-fast-1.9.11/apt-fast --- apt-fast-1.9.10/apt-fast 2020-10-18 20:24:53.000000000 +0000 +++ apt-fast-1.9.11/apt-fast 2021-04-26 19:54:50.000000000 +0000 @@ -1,6 +1,6 @@ #!/bin/bash # -# apt-fast v1.9 +# apt-fast v1.9.11 # Use this just like aptitude or apt-get for faster package downloading. # # Copyright: 2008-2012 Matt Parnell, http://www.mattparnell.com @@ -108,7 +108,6 @@ "$0" "$@" fi - # Define lockfile. # Use /tmp as directory because everybody (not only root) has to have write # permissions. @@ -119,7 +118,7 @@ # Set default package manager, APT cache, temporary download dir, # temporary download list file, and maximal parallel downloads -_APTMGR=apt-get +_APTMGR='apt-get' eval "$(apt-config shell APTCACHE Dir::Cache::archives/d)" # Check if APT config option Dir::Cache::archives::apt-fast-partial is set. eval "$(apt-config shell apt_fast_partial Dir::Cache::archives::apt-fast-partial/d)" @@ -321,11 +320,11 @@ # Add header to overwrite file. echo "# apt-fast mirror list: $(date)" > "$DLLIST" - #NOTE: aptitude doesn't have this functionality, so we use apt-get to get - # package URIs. - case "$_APTMGR" in - apt|apt-get) uri_mgr=$_APTMGR;; - *) uri_mgr=apt-get;; + # NOTE: "aptitude" doesn't have this functionality + # so we use "${_APTMGR}" to get package URI's + case "$(basename "${_APTMGR}")" in + 'apt'|'apt-get') uri_mgr="${_APTMGR}";; + *) uri_mgr='apt-get';; esac uris_full="$("$uri_mgr" "${APT_SCRIPT_WARNING[@]}" -y --print-uris "$@")" CLEANUP_STATE="$?" @@ -463,7 +462,7 @@ # Disable script warning if apt is used. APT_SCRIPT_WARNING=() -if [ "$_APTMGR" == "apt" ]; then +if [ "$(basename "${_APTMGR}")" == 'apt' ]; then APT_SCRIPT_WARNING=(-o "Apt::Cmd::Disable-Script-Warning=true") fi @@ -577,6 +576,15 @@ eval "${_DOWNLOADER}" # execute downloadhelper command if [ "$(find "$DLDIR" -printf . | wc -c)" -gt 1 ]; then + + # Delete incomplete/corrupted downloaded files, if any: Not recursive, as we don't expect any dirs to exist within $DLDIR. + + # When Aria2c downloads a file and detects it is corrupted, its filename won't be renamed back to its actual name, + # preserving .aria2 file extension, which also indicates when a file hasn't been completely downloaded. + for x in *.aria2; do + rm -f "$x" "${x%.aria2}" + done + # Move all packages to the apt install directory by force to ensure # already existing debs which may be incomplete are replaced find . -type f \( -name '*.deb' -o -name '*.ddeb' \) -execdir mv -ft "$APTCACHE" {} \+ @@ -592,7 +600,7 @@ fi # different problem resolving for aptitude - if [ -z "$DOWNLOAD_ONLY" ] || [ "$_APTMGR" == "aptitude" ]; then + if [ -z "$DOWNLOAD_ONLY" ] || [ "$(basename "${_APTMGR}")" == 'aptitude' ]; then "${_APTMGR}" "${APT_SCRIPT_WARNING[@]}" "$@" fi @@ -621,7 +629,7 @@ fi # different problem resolving for aptitude - if [ "$_APTMGR" == "aptitude" ]; then + if [ "$(basename "${_APTMGR}")" == 'aptitude' ]; then "${_APTMGR}" "$@" fi diff -Nru apt-fast-1.9.10/debian/changelog apt-fast-1.9.11/debian/changelog --- apt-fast-1.9.10/debian/changelog 2020-10-18 20:24:53.000000000 +0000 +++ apt-fast-1.9.11/debian/changelog 2021-04-26 19:54:50.000000000 +0000 @@ -1,8 +1,17 @@ -apt-fast (1.9.10-1~ubuntu12.04.1) precise; urgency=low +apt-fast (1.9.11-1~ubuntu12.04.1) precise; urgency=low * Auto build. - -- Dominique Lasserre Sun, 18 Oct 2020 20:24:53 +0000 + -- Dominique Lasserre Mon, 26 Apr 2021 19:54:50 +0000 + +apt-fast (1.9.11-1) unstable; urgency=medium + + * New upstream release. + - Fix when $_APTMGR is full path. Closes #188 + - Delete failed downloads. Closes #184 + * Bump standards version to 4.5.1. + + -- Dominique Lasserre Mon, 26 Apr 2021 21:43:29 +0200 apt-fast (1.9.10-1) unstable; urgency=medium diff -Nru apt-fast-1.9.10/debian/control apt-fast-1.9.11/debian/control --- apt-fast-1.9.10/debian/control 2020-10-18 20:24:53.000000000 +0000 +++ apt-fast-1.9.11/debian/control 2021-04-26 19:54:50.000000000 +0000 @@ -4,7 +4,7 @@ Maintainer: Dominique Lasserre Uploaders: Saikrishna Arcot Build-Depends: debhelper (>= 9.0.0), bash-completion, po-debconf -Standards-Version: 4.5.0 +Standards-Version: 4.5.1 Homepage: https://github.com/ilikenwf/apt-fast.git Vcs-Git: https://code.launchpad.net/~apt-fast/apt-fast/debian Vcs-Browser: https://bazaar.launchpad.net/~apt-fast/apt-fast/debian diff -Nru apt-fast-1.9.10/debian/git-build-recipe.manifest apt-fast-1.9.11/debian/git-build-recipe.manifest --- apt-fast-1.9.10/debian/git-build-recipe.manifest 2020-10-18 20:24:53.000000000 +0000 +++ apt-fast-1.9.11/debian/git-build-recipe.manifest 2021-04-26 19:54:50.000000000 +0000 @@ -1,2 +1,2 @@ # git-build-recipe format 0.4 deb-version {debversion} -lp:apt-fast git-commit:8e7e44fa8d3167b476cf96dacef6d4f311277553 +lp:apt-fast git-commit:c51e0ff75df848d9a9210dc6766ff2e224de486b