From c238c02efaec0ee632968358711854e9f4d8d282 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 10 Jul 2013 12:41:13 -0700 Subject: [PATCH] emerge-delta-webrsync: rm empty file, bug #476416 --- bin/emerge-webrsync | 11 ++++++++--- misc/emerge-delta-webrsync | 7 ++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/bin/emerge-webrsync b/bin/emerge-webrsync index 0a943030d..cd8653788 100755 --- a/bin/emerge-webrsync +++ b/bin/emerge-webrsync @@ -1,5 +1,5 @@ #!/bin/bash -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # Author: Karl Trygve Kalleberg # Rewritten from the old, Perl-based emerge-webrsync script @@ -134,8 +134,13 @@ fetch_file() { __vecho "Fetching file ${FILE} ..." # already set DISTDIR= - eval "${FETCHCOMMAND}" ${opts} - [ -s "${DISTDIR}/${FILE}" ] + eval "${FETCHCOMMAND} ${opts}" + if [[ $? -eq 0 && -s ${DISTDIR}/${FILE} ]] ; then + return 0 + else + rm -f "${DISTDIR}/${FILE}" + return 1 + fi } check_file_digest() { diff --git a/misc/emerge-delta-webrsync b/misc/emerge-delta-webrsync index 01d7f4a65..f7f82f817 100755 --- a/misc/emerge-delta-webrsync +++ b/misc/emerge-delta-webrsync @@ -228,7 +228,12 @@ fetch_file() { __vecho "Fetching file ${FILE} ..." # already set DISTDIR= eval "${FETCHCOMMAND} ${opts}" - [ -s "${DISTDIR}/${FILE}" ] + if [[ $? -eq 0 && -s ${DISTDIR}/${FILE} ]] ; then + return 0 + else + rm -f "${DISTDIR}/${FILE}" + return 1 + fi } check_file_digest() { -- 2.26.2