aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-01 22:28:56 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-01 22:28:56 +0000
commita0ea048d7b8d4f0677e9a0dfc3b635fcddebeace (patch)
treec6304ccec19b0fcb3ed7ea9c4db8539060f2136d
parente270c5f0364f3bb10f3d7baab43a33b5b7ff6af3 (diff)
downloadpaludis-a0ea048d7b8d4f0677e9a0dfc3b635fcddebeace.tar.gz
paludis-a0ea048d7b8d4f0677e9a0dfc3b635fcddebeace.tar.xz
Less sucky builtin_fetch
-rw-r--r--ebuild/builtin_fetch.bash21
1 files changed, 12 insertions, 9 deletions
diff --git a/ebuild/builtin_fetch.bash b/ebuild/builtin_fetch.bash
index a7105b3..6ffe6cb 100644
--- a/ebuild/builtin_fetch.bash
+++ b/ebuild/builtin_fetch.bash
@@ -19,26 +19,29 @@
builtin_fetch()
{
- local a nofetch unique_aa
+ local a nofetch unique_aa old_aa
for a in ${FLAT_SRC_URI} ; do
local aa=${a##*/}
+ hasq "${aa}" ${unique_aa} || unique_aa="${unique_aa} ${aa}"
+
if [[ -f "${DISTDIR}/${aa}" ]] ; then
- if ! hasq ${aa} ${unique_aa} ; then
+ if [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Already have ${aa}"
- unique_aa="${unique_aa} ${aa}"
+ old_aa="${aa}"
fi
- continue
else
if ! hasq fetch ${RESTRICT} ; then
- if ! hasq ${aa} ${unique_aa} ; then
+ if [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Need to fetch ${aa}"
- unique_aa="${unique_aa} ${aa}"
+ old_aa="${aa}"
+ fi
+ if ! wget -O "${DISTDIR}/${aa}" "${a}" ; then
+ rm -f "${DISTDIR}/${aa}"
fi
- wget -O "${DISTDIR}/${aa}" "${a}"
else
- if ! hasq ${aa} ${unique_aa} ; then
+ if ! [[ "${old_aa}" != "${aa}" ]] ; then
ebuild_section "Can't fetch ${aa}"
- unique_aa="${unique_aa} ${aa}"
+ old_aa="${aa}"
fi
fi
fi