aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-27 00:43:26 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-02-27 00:43:26 +0000
commit6965266ab259f19e64840586c3d45babc8117888 (patch)
tree70ed2c45866c9f1e0fed9a5e5ab3209ba9eff255
parent9f06751cfa50d7ec739346645c01702825412fb9 (diff)
downloadpaludis-6965266ab259f19e64840586c3d45babc8117888.tar.gz
paludis-6965266ab259f19e64840586c3d45babc8117888.tar.xz
More graceful handling for mirror://no-slash in SRC_URI
-rw-r--r--paludis/qa/src_uri_check.cc14
1 files changed, 10 insertions, 4 deletions
diff --git a/paludis/qa/src_uri_check.cc b/paludis/qa/src_uri_check.cc
index 43cab8f..2bcce80 100644
--- a/paludis/qa/src_uri_check.cc
+++ b/paludis/qa/src_uri_check.cc
@@ -71,10 +71,16 @@ namespace
if (0 == a->text().compare(0, 9, "mirror://"))
{
std::string mirror_host(a->text().substr(9));
- mirror_host.erase(mirror_host.find('/'));
- if (! env->package_database()->fetch_repository(
- env->package_database()->favourite_repository())->is_mirror(mirror_host))
- result << Message(qal_major, "Unknown mirror for '" + a->text() + "'");
+ std::string::size_type p(mirror_host.find('/'));
+ if (std::string::npos == p)
+ result << Message(qal_major, "Malformed SRC_URI component '" + a->text() + "'");
+ else
+ {
+ mirror_host.erase(p);
+ if (! env->package_database()->fetch_repository(
+ env->package_database()->favourite_repository())->is_mirror(mirror_host))
+ result << Message(qal_major, "Unknown mirror for '" + a->text() + "'");
+ }
}
}
}