aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-07 05:16:43 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-04-07 05:16:43 +0000
commit8318d9615f6a84d9c67ceab7b9271a793cf94582 (patch)
tree674b652d33c9ab324de040acd4ee2411da3272b8
parentc5c4c1dac9758bf6421702aa3b818c5dd2f52b8d (diff)
downloadpaludis-8318d9615f6a84d9c67ceab7b9271a793cf94582.tar.gz
paludis-8318d9615f6a84d9c67ceab7b9271a793cf94582.tar.xz
If SLOT is empty, warn and return '0' instead
-rw-r--r--paludis/vdb_repository.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/paludis/vdb_repository.cc b/paludis/vdb_repository.cc
index 7ff6faa..9766a99 100644
--- a/paludis/vdb_repository.cc
+++ b/paludis/vdb_repository.cc
@@ -237,7 +237,6 @@ Implementation<VDBRepository>::load_entry(std::vector<VDBEntry>::iterator p) con
p->metadata = VersionMetadata::Pointer(new VersionMetadata);
p->metadata->set(vmk_depend, file_contents(location, p->name, p->version, "DEPEND"));
p->metadata->set(vmk_rdepend, file_contents(location, p->name, p->version, "RDEPEND"));
- p->metadata->set(vmk_slot, file_contents(location, p->name, p->version, "SLOT"));
p->metadata->set(vmk_license, file_contents(location, p->name, p->version, "LICENSE"));
p->metadata->set(vmk_keywords, "*");
p->metadata->set(vmk_inherited, file_contents(location, p->name, p->version, "INHERITED"));
@@ -245,6 +244,16 @@ Implementation<VDBRepository>::load_entry(std::vector<VDBEntry>::iterator p) con
p->metadata->set(vmk_pdepend, file_contents(location, p->name, p->version, "PDEPEND"));
p->metadata->set(vmk_provide, file_contents(location, p->name, p->version, "PROVIDE"));
p->metadata->set(vmk_eapi, file_contents(location, p->name, p->version, "EAPI"));
+
+ std::string slot(file_contents(location, p->name, p->version, "SLOT"));
+ if (slot.empty())
+ {
+ Log::get_instance()->message(ll_warning, "VDBRepository entry '" +
+ stringify(p->name) + "-" + stringify(p->version) + "' in '" +
+ stringify(location) + " has empty SLOT, setting to \"0\"");
+ slot = "0";
+ }
+ p->metadata->set(vmk_slot, slot);
}
VDBRepository::VDBRepository(