aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-01 22:06:22 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-01 22:06:22 +0000
commit3edbc7781ce59eecf1d0624b0bcd9493bf096a2a (patch)
treeb7cf1c060f0d4a198c56de4e524e5733aaf24d84
parent76f0e38a98ee6da7d7b80466eebf0d1817c23858 (diff)
downloadpaludis-3edbc7781ce59eecf1d0624b0bcd9493bf096a2a.tar.gz
paludis-3edbc7781ce59eecf1d0624b0bcd9493bf096a2a.tar.xz
Make mirror:// sort of work
-rw-r--r--ebuild/builtin_fetch.bash5
-rw-r--r--paludis/portage_repository.cc20
2 files changed, 21 insertions, 4 deletions
diff --git a/ebuild/builtin_fetch.bash b/ebuild/builtin_fetch.bash
index 971c477..a7105b3 100644
--- a/ebuild/builtin_fetch.bash
+++ b/ebuild/builtin_fetch.bash
@@ -40,11 +40,14 @@ builtin_fetch()
ebuild_section "Can't fetch ${aa}"
unique_aa="${unique_aa} ${aa}"
fi
- nofetch="${nofetch:+${nofetch} }${aa}"
fi
fi
done
+ for a in ${unique_aa} ; do
+ [[ -f ${DISTDIR}/${a} ]] || nofetch="${nofetch} ${a}"
+ done
+
if [[ -n "${nofetch}" ]] ; then
local c
echo
diff --git a/paludis/portage_repository.cc b/paludis/portage_repository.cc
index 29a676c..ee8fa84 100644
--- a/paludis/portage_repository.cc
+++ b/paludis/portage_repository.cc
@@ -67,7 +67,7 @@ typedef MakeHashedSet<UseFlagName>::Type UseMaskSet;
typedef MakeHashedSet<UseFlagName>::Type UseFlagSet;
-typedef MakeHashedSet<std::string>::Type MirrorSet;
+typedef MakeHashedMap<std::string, std::list<std::string> >::Type MirrorMap;
typedef MakeHashedMap<std::pair<QualifiedPackageName, VersionSpec>, VersionMetadata::Pointer>::Type MetadataMap;
@@ -142,7 +142,7 @@ namespace paludis
/// Do we have mirrors?
mutable bool has_mirrors;
- mutable MirrorSet mirrors;
+ mutable MirrorMap mirrors;
/// Constructor.
Implementation(const Environment * const,
@@ -887,7 +887,9 @@ PortageRepository::do_is_mirror(const std::string & s) const
std::vector<std::string> entries;
tokeniser.tokenise(*line, std::back_inserter(entries));
if (! entries.empty())
- _imp->mirrors.insert(entries.at(0));
+ _imp->mirrors.insert(std::make_pair(
+ entries.at(0),
+ std::list<std::string>(next(entries.begin()), entries.end())));
}
_imp->has_mirrors = true;
}
@@ -932,6 +934,18 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
if (0 == (*ff)->text().compare(0, 9, "mirror://"))
{
+ std::string mirror((*ff)->text().substr(9));
+ std::string::size_type q(mirror.find('/'));
+ if (std::string::npos == q)
+ throw InternalError(PALUDIS_HERE, "todo"); /// \bug todo
+ if (! is_mirror(mirror.substr(0, q)))
+ throw InternalError(PALUDIS_HERE, "todo: not a mirror: '" +
+ mirror.substr(0, q) + "'"); /// \bug todo
+ for (std::list<std::string>::iterator
+ m(_imp->mirrors.find(mirror.substr(0, q))->second.begin()),
+ m_end(_imp->mirrors.find(mirror.substr(0, q))->second.end()) ;
+ m != m_end ; ++m)
+ flat_src_uri.append(*m + "/" + (*ff)->text().substr(p + 1) + " ");
}
else
flat_src_uri.append((*ff)->text());