[pacman-dev] [PATCH] makepkg: remove .part file after a failed download

Xavier shiningxc at gmail.com
Wed Oct 21 13:19:54 EDT 2009


On Wed, Oct 21, 2009 at 7:13 PM, Cedric Staniewski <cedric at gmx.ca> wrote:
> Signed-off-by: Cedric Staniewski <cedric at gmx.ca>
> ---
>  scripts/makepkg.sh.in |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 40367ae..f6b87c2 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -336,7 +336,12 @@ download_file() {
>                dlcmd="$dlcmd \"$url\""
>        fi
>
> -       eval $dlcmd || return $?
> +       eval $dlcmd
> +       local ret=$?
> +       if [ $ret -gt 0 ]; then
> +               rm -f -- "$dlfile"
> +               return $ret
> +       fi
>
>        # rename the temporary download file to the final destination
>        if [ "$dlfile" != "$file" ]; then

The purpose of the .part file is to allow resume.
So I don't think we want to remove it.
What was your intention, why are .part files a problem ?


More information about the pacman-dev mailing list