aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-16 17:57:24 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-16 17:57:24 +0000
commiteaa8266c2f938712b8c01ddbbb40387069da19df (patch)
tree1339e37200dae8d566fe3bb9f080b010c2574042
parent92c8dfb51541dff6ac4e483b22167ce5dc1d8b56 (diff)
downloadpaludis-eaa8266c2f938712b8c01ddbbb40387069da19df.tar.gz
paludis-eaa8266c2f938712b8c01ddbbb40387069da19df.tar.xz
After a failed fetch, wget has a tendency to leave zero byte files lying around. When checking for existing files in DISTDIR in builtin_fetch, if the file is zero bytes in size then delete and refetch it. Fixes Berlios#7163.
-rw-r--r--ebuild/builtin_fetch.bash7
1 files changed, 6 insertions, 1 deletions
diff --git a/ebuild/builtin_fetch.bash b/ebuild/builtin_fetch.bash
index c4cc58e..c368ac0 100644
--- a/ebuild/builtin_fetch.bash
+++ b/ebuild/builtin_fetch.bash
@@ -24,12 +24,17 @@ builtin_fetch()
local aa=${a##*/}
hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
- if [[ -f "${DISTDIR}/${aa}" ]] ; then
+ if [[ -f "${DISTDIR}/${aa}" ]] && [[ "0" != $(stat -c '%s' "${DISTDIR}/${aa}" ) ]] ; then
if [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Already have ${aa}"
old_aa="${aa}"
fi
else
+ if [[ -f "${DISTDIR}/${aa}" ]] ; then
+ ebuild_section "Trying to remove existing ${aa}..."
+ rm -f "${DISTDIR}/${aa}"
+ fi
+
if ! hasq fetch ${RESTRICT} ; then
if [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Need to fetch ${aa}"