aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-03-23 20:21:55 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2008-03-23 20:21:55 +0000
commit77b31e5e4b3afb845c7ed32bb53168a56f828198 (patch)
tree81aca82cb6387dcc84285d644ed3db80c73d49b9
parent210abce139ba13a3c77937631a4315833ddd6213 (diff)
downloadpaludis-77b31e5e4b3afb845c7ed32bb53168a56f828198.tar.gz
paludis-77b31e5e4b3afb845c7ed32bb53168a56f828198.tar.xz
PFI
-rw-r--r--paludis/version_spec.cc20
1 files changed, 20 insertions, 0 deletions
diff --git a/paludis/version_spec.cc b/paludis/version_spec.cc
index e5e3754..fbeecff 100644
--- a/paludis/version_spec.cc
+++ b/paludis/version_spec.cc
@@ -122,6 +122,11 @@ VersionSpec::VersionSpec(const std::string & text) :
if (number_part.empty())
throw BadVersionSpecError(text, "Expected number part not found at offset " + stringify(p));
+ if (number_part.size() > 8)
+ Log::get_instance()->message(ll_qa, lc_context) <<
+ "Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
+ "(Paludis supports arbitrary lengths, but other package managers do not)";
+
_imp->parts.push_back(Part(number, number_part));
if (p < text.length() && ('.' != text.at(p) || p + 1 == text.length()))
@@ -177,6 +182,11 @@ VersionSpec::VersionSpec(const std::string & text) :
std::string number_part(std::string::npos == q ? text.substr(p) : text.substr(p, q - p));
p = std::string::npos == q ? text.length() : q;
+ if (number_part.size() > 8)
+ Log::get_instance()->message(ll_qa, lc_context) <<
+ "Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
+ "(Paludis supports arbitrary lengths, but other package managers do not)";
+
if (number_part.size() > 0)
{
number_part = strip_leading(number_part, "0");
@@ -197,6 +207,11 @@ VersionSpec::VersionSpec(const std::string & text) :
std::string number_part(std::string::npos == q ? text.substr(p) : text.substr(p, q - p));
p = std::string::npos == q ? text.length() : q;
+ if (number_part.size() > 8)
+ Log::get_instance()->message(ll_qa, lc_context) <<
+ "Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
+ "(Paludis supports arbitrary lengths, but other package managers do not)";
+
if (number_part.size() > 0)
{
number_part = strip_leading(number_part, "0");
@@ -234,6 +249,11 @@ VersionSpec::VersionSpec(const std::string & text) :
std::string number_part(std::string::npos == q ? text.substr(p) : text.substr(p, q - p));
p = std::string::npos == q ? text.length() : q;
+ if (number_part.size() > 8)
+ Log::get_instance()->message(ll_qa, lc_context) <<
+ "Number part '" << number_part << "' exceeds 8 digit limit permitted by the Package Manager Specification "
+ "(Paludis supports arbitrary lengths, but other package managers do not)";
+
/* Are we -r */
bool empty(number_part.empty());