aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 22:44:00 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-22 22:44:00 +0000
commite1e7f5f089748c8ce72446cf8f69b80fa2992400 (patch)
treebc775a91e07cc93b8b324a7c65b764504ae7aaa7
parent02ee95a91bfe16a315b1ba4383cce8d7a909a3b0 (diff)
downloadpaludis-e1e7f5f089748c8ce72446cf8f69b80fa2992400.tar.gz
paludis-e1e7f5f089748c8ce72446cf8f69b80fa2992400.tar.xz
Merge dep_string exceptions into dep_list and dep_parser. Make enum key naming more consistent on package vs name.
-rw-r--r--paludis/default_environment.cc12
-rw-r--r--paludis/dep_lexer.cc12
-rw-r--r--paludis/dep_lexer.hh36
-rw-r--r--paludis/dep_list.cc2
-rw-r--r--paludis/dep_parser.cc13
-rw-r--r--paludis/dep_parser.hh33
-rw-r--r--paludis/dep_string_error.cc28
-rw-r--r--paludis/dep_string_error.hh52
-rw-r--r--paludis/dep_string_lex_error.cc28
-rw-r--r--paludis/dep_string_lex_error.hh52
-rw-r--r--paludis/dep_string_nesting_error.cc28
-rw-r--r--paludis/dep_string_nesting_error.hh48
-rw-r--r--paludis/dep_string_parse_error.cc29
-rw-r--r--paludis/dep_string_parse_error.hh52
-rw-r--r--paludis/environment.cc4
-rw-r--r--paludis/files.m44
-rw-r--r--paludis/match_package.cc2
-rw-r--r--paludis/package_database.cc18
-rw-r--r--paludis/package_database.hh4
19 files changed, 112 insertions, 345 deletions
diff --git a/paludis/default_environment.cc b/paludis/default_environment.cc
index 62d2e28..34cfe10 100644
--- a/paludis/default_environment.cc
+++ b/paludis/default_environment.cc
@@ -130,8 +130,8 @@ DefaultEnvironment::accept_keyword(const KeywordName & keyword, const PackageDat
if (d)
for (DefaultConfig::PackageKeywordsIterator
- k(DefaultConfig::get_instance()->begin_package_keywords(d->get<pde_package>())),
- k_end(DefaultConfig::get_instance()->end_package_keywords(d->get<pde_package>())) ;
+ k(DefaultConfig::get_instance()->begin_package_keywords(d->get<pde_name>())),
+ k_end(DefaultConfig::get_instance()->end_package_keywords(d->get<pde_name>())) ;
k != k_end ; ++k)
{
if (! match_package(package_db(), k->first, d))
@@ -152,8 +152,8 @@ bool
DefaultEnvironment::query_user_masks(const PackageDatabaseEntry & d) const
{
for (DefaultConfig::UserMasksIterator
- k(DefaultConfig::get_instance()->begin_user_masks(d.get<pde_package>())),
- k_end(DefaultConfig::get_instance()->end_user_masks(d.get<pde_package>())) ;
+ k(DefaultConfig::get_instance()->begin_user_masks(d.get<pde_name>())),
+ k_end(DefaultConfig::get_instance()->end_user_masks(d.get<pde_name>())) ;
k != k_end ; ++k)
{
if (! match_package(package_db(), *k, d))
@@ -169,8 +169,8 @@ bool
DefaultEnvironment::query_user_unmasks(const PackageDatabaseEntry & d) const
{
for (DefaultConfig::UserMasksIterator
- k(DefaultConfig::get_instance()->begin_user_unmasks(d.get<pde_package>())),
- k_end(DefaultConfig::get_instance()->end_user_unmasks(d.get<pde_package>())) ;
+ k(DefaultConfig::get_instance()->begin_user_unmasks(d.get<pde_name>())),
+ k_end(DefaultConfig::get_instance()->end_user_unmasks(d.get<pde_name>())) ;
k != k_end ; ++k)
{
if (! match_package(package_db(), *k, d))
diff --git a/paludis/dep_lexer.cc b/paludis/dep_lexer.cc
index b4da333..498ed45 100644
--- a/paludis/dep_lexer.cc
+++ b/paludis/dep_lexer.cc
@@ -24,12 +24,22 @@
#include "dep_atom_visitor.hh"
#include "dep_lexer.hh"
#include "exception.hh"
-#include "dep_string_lex_error.hh"
#include "tokeniser.hh"
#include <vector>
using namespace paludis;
+DepStringLexError::DepStringLexError(const std::string & dep_string,
+ const std::string & message) throw () :
+ DepStringError(dep_string, "in lex phase: " + message)
+{
+}
+
+DepStringError::DepStringError(const std::string & d, const std::string & m) throw () :
+ Exception("Bad dependency string '" + d + "': " + m)
+{
+}
+
DepLexer::DepLexer(const std::string & s)
{
Context context("When lexing dependency string '" + s + "':");
diff --git a/paludis/dep_lexer.hh b/paludis/dep_lexer.hh
index 74eac45..2140cf7 100644
--- a/paludis/dep_lexer.hh
+++ b/paludis/dep_lexer.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_PALUDIS_DEP_PARSER_LEXER_HH 1
#include <paludis/instantiation_policy.hh>
+#include <paludis/exception.hh>
#include <list>
#include <string>
@@ -28,11 +29,46 @@
* Declarations for the DepLexer class.
*
* \ingroup DepResolver
+ * \ingroup Exception
*/
namespace paludis
{
/**
+ * A DepStringError descendent is thrown if an invalid depend string is
+ * encountered.
+ *
+ * \ingroup Exception
+ * \ingroup DepResolver
+ */
+ class DepStringError : public Exception
+ {
+ protected:
+ /**
+ * Constructor.
+ */
+ DepStringError(const std::string & dep_string,
+ const std::string & message) throw ();
+ };
+
+ /**
+ * A DepStringLexError is thrown if a lex-level error is encountered when
+ * parsing a dependency string.
+ *
+ * \ingroup Exception
+ * \ingroup DepResolver
+ */
+ class DepStringLexError : public DepStringError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DepStringLexError(const std::string & dep_string,
+ const std::string & message) throw ();
+ };
+
+ /**
* Lexemes used by DepLexer.
*/
enum DepLexerLexeme
diff --git a/paludis/dep_list.cc b/paludis/dep_list.cc
index 351a706..9fedc51 100644
--- a/paludis/dep_list.cc
+++ b/paludis/dep_list.cc
@@ -281,7 +281,7 @@ DepList::visit(const PackageDepAtom * const p)
"' -> '" + stringify(*match) + "':");
/* make merge entry */
- DepListEntry merge_entry(match->get<pde_package>(), match->get<pde_version>(),
+ DepListEntry merge_entry(match->get<pde_name>(), match->get<pde_version>(),
SlotName(metadata->get(vmk_slot)), match->get<pde_repository>());
{
diff --git a/paludis/dep_parser.cc b/paludis/dep_parser.cc
index b946aa3..ebe9095 100644
--- a/paludis/dep_parser.cc
+++ b/paludis/dep_parser.cc
@@ -19,8 +19,6 @@
#include "exception.hh"
#include "stringify.hh"
-#include "dep_string_parse_error.hh"
-#include "dep_string_nesting_error.hh"
#include "dep_parser.hh"
#include "dep_lexer.hh"
#include "all_dep_atom.hh"
@@ -33,6 +31,17 @@
using namespace paludis;
+DepStringParseError::DepStringParseError(const std::string & d,
+ const std::string & m) throw () :
+ DepStringError(d, "in parse phase: " + m)
+{
+}
+
+DepStringNestingError::DepStringNestingError(const std::string & dep_string) throw () :
+ DepStringParseError(dep_string, "improperly balanced parentheses")
+{
+}
+
enum DepParserState
{
dps_initial,
diff --git a/paludis/dep_parser.hh b/paludis/dep_parser.hh
index b8f800d..a8685c8 100644
--- a/paludis/dep_parser.hh
+++ b/paludis/dep_parser.hh
@@ -23,17 +23,50 @@
#include <paludis/composite_dep_atom.hh>
#include <paludis/counted_ptr.hh>
#include <paludis/instantiation_policy.hh>
+#include <paludis/exception.hh>
+#include <paludis/dep_lexer.hh>
#include <string>
/** \file
* Declarations for the DepParser class.
*
* \ingroup DepResolver
+ * \ingroup Exception
*/
namespace paludis
{
/**
+ * A DepStringParseError is thrown if an error is encountered when parsing
+ * a dependency string.
+ *
+ * \ingroup Exception
+ * \ingroup DepResolver
+ */
+ class DepStringParseError : public DepStringError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DepStringParseError(const std::string & dep_string,
+ const std::string & message) throw ();
+ };
+
+ /**
+ * A DepStringNestingError is thrown if a dependency string does not have
+ * properly balanced parentheses.
+ */
+ class DepStringNestingError : public DepStringParseError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ DepStringNestingError(const std::string & dep_string) throw ();
+ };
+
+ /**
* The DepParser converts string representations of a dependency
* specification into a DepAtom instance.
*/
diff --git a/paludis/dep_string_error.cc b/paludis/dep_string_error.cc
deleted file mode 100644
index 5f9e10e..0000000
--- a/paludis/dep_string_error.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "dep_string_error.hh"
-
-using namespace paludis;
-
-DepStringError::DepStringError(const std::string & d, const std::string & m) throw () :
- Exception("Bad dependency string '" + d + "': " + m)
-{
-}
-
diff --git a/paludis/dep_string_error.hh b/paludis/dep_string_error.hh
deleted file mode 100644
index a95706e..0000000
--- a/paludis/dep_string_error.hh
+++ /dev/null
@@ -1,52 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_DEP_STRING_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_DEP_STRING_ERROR_HH 1
-
-#include <paludis/exception.hh>
-
-/** \file
- * Declarations for DepStringError.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
-
-namespace paludis
-{
- /**
- * A DepStringError descendent is thrown if an invalid depend string is
- * encountered.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
- class DepStringError : public Exception
- {
- protected:
- /**
- * Constructor.
- */
- DepStringError(const std::string & dep_string,
- const std::string & message) throw ();
- };
-}
-
-#endif
diff --git a/paludis/dep_string_lex_error.cc b/paludis/dep_string_lex_error.cc
deleted file mode 100644
index 38584e1..0000000
--- a/paludis/dep_string_lex_error.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "dep_string_lex_error.hh"
-
-using namespace paludis;
-
-DepStringLexError::DepStringLexError(const std::string & dep_string,
- const std::string & message) throw () :
- DepStringError(dep_string, "in lex phase: " + message)
-{
-}
diff --git a/paludis/dep_string_lex_error.hh b/paludis/dep_string_lex_error.hh
deleted file mode 100644
index 19ba3d4..0000000
--- a/paludis/dep_string_lex_error.hh
+++ /dev/null
@@ -1,52 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_DEP_STRING_LEX_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_DEP_STRING_LEX_ERROR_HH 1
-
-#include <paludis/dep_string_error.hh>
-
-/** \file
- * Declarations for the DepStringLexError class.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
-
-namespace paludis
-{
- /**
- * A DepStringLexError is thrown if a lex-level error is encountered when
- * parsing a dependency string.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
- class DepStringLexError : public DepStringError
- {
- public:
- /**
- * Constructor.
- */
- DepStringLexError(const std::string & dep_string,
- const std::string & message) throw ();
- };
-}
-
-#endif
diff --git a/paludis/dep_string_nesting_error.cc b/paludis/dep_string_nesting_error.cc
deleted file mode 100644
index 5b16a4f..0000000
--- a/paludis/dep_string_nesting_error.cc
+++ /dev/null
@@ -1,28 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "dep_string_nesting_error.hh"
-
-using namespace paludis;
-
-DepStringNestingError::DepStringNestingError(const std::string & dep_string) throw () :
- DepStringParseError(dep_string, "improperly balanced parentheses")
-{
-}
-
diff --git a/paludis/dep_string_nesting_error.hh b/paludis/dep_string_nesting_error.hh
deleted file mode 100644
index c37e60d..0000000
--- a/paludis/dep_string_nesting_error.hh
+++ /dev/null
@@ -1,48 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_DEP_STRING_NESTING_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_DEP_STRING_NESTING_ERROR_HH 1
-
-#include <paludis/dep_string_parse_error.hh>
-
-/** \file
- * Declarations for the DepStringNestingError exception.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
-
-namespace paludis
-{
- /**
- * A DepStringNestingError is thrown if a dependency string does not have
- * properly balanced parentheses.
- */
- class DepStringNestingError : public DepStringParseError
- {
- public:
- /**
- * Constructor.
- */
- DepStringNestingError(const std::string & dep_string) throw ();
- };
-}
-
-#endif
diff --git a/paludis/dep_string_parse_error.cc b/paludis/dep_string_parse_error.cc
deleted file mode 100644
index d1aaa86..0000000
--- a/paludis/dep_string_parse_error.cc
+++ /dev/null
@@ -1,29 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#include "dep_string_parse_error.hh"
-
-using namespace paludis;
-
-DepStringParseError::DepStringParseError(const std::string & d,
- const std::string & m) throw () :
- DepStringError(d, "in parse phase: " + m)
-{
-}
-
diff --git a/paludis/dep_string_parse_error.hh b/paludis/dep_string_parse_error.hh
deleted file mode 100644
index 8a29a01..0000000
--- a/paludis/dep_string_parse_error.hh
+++ /dev/null
@@ -1,52 +0,0 @@
-/* vim: set sw=4 sts=4 et foldmethod=syntax : */
-
-/*
- * Copyright (c) 2005, 2006 Ciaran McCreesh <ciaranm@gentoo.org>
- *
- * This file is part of the Paludis package manager. Paludis is free software;
- * you can redistribute it and/or modify it under the terms of the GNU General
- * Public License version 2, as published by the Free Software Foundation.
- *
- * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
- * details.
- *
- * You should have received a copy of the GNU General Public License along with
- * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- * Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-#ifndef PALUDIS_GUARD_PALUDIS_DEP_STRING_PARSE_ERROR_HH
-#define PALUDIS_GUARD_PALUDIS_DEP_STRING_PARSE_ERROR_HH 1
-
-#include <paludis/dep_string_error.hh>
-
-/** \file
- * Declarations for the DepStringParseError class.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
-
-namespace paludis
-{
- /**
- * A DepStringParseError is thrown if an error is encountered when parsing
- * a dependency string.
- *
- * \ingroup Exception
- * \ingroup DepResolver
- */
- class DepStringParseError : public DepStringError
- {
- public:
- /**
- * Constructor.
- */
- DepStringParseError(const std::string & dep_string,
- const std::string & message) throw ();
- };
-}
-
-#endif
diff --git a/paludis/environment.cc b/paludis/environment.cc
index c58f61b..66b23d4c 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -57,11 +57,11 @@ Environment::mask_reasons(const PackageDatabaseEntry & e) const
if (query_user_masks(e))
result.set(mr_user_mask);
- if (package_db()->fetch_repository(e.get<pde_repository>())->query_profile_masks(e.get<pde_package>(),
+ if (package_db()->fetch_repository(e.get<pde_repository>())->query_profile_masks(e.get<pde_name>(),
e.get<pde_version>()))
result.set(mr_profile_mask);
- if (package_db()->fetch_repository(e.get<pde_repository>())->query_repository_masks(e.get<pde_package>(),
+ if (package_db()->fetch_repository(e.get<pde_repository>())->query_repository_masks(e.get<pde_name>(),
e.get<pde_version>()))
result.set(mr_repository_mask);
}
diff --git a/paludis/files.m4 b/paludis/files.m4
index fd72f8a..ad46036 100644
--- a/paludis/files.m4
+++ b/paludis/files.m4
@@ -31,10 +31,6 @@ add(`dep_atom_visitor', `hh', `cc')
add(`dep_lexer', `hh', `cc', `test')
add(`dep_list', `hh', `cc', `test')
add(`dep_parser', `hh', `cc', `test')
-add(`dep_string_error', `hh', `cc')
-add(`dep_string_lex_error', `hh', `cc')
-add(`dep_string_nesting_error', `hh', `cc')
-add(`dep_string_parse_error', `hh', `cc')
add(`dir_iterator', `hh', `cc')
add(`environment', `hh', `cc')
add(`exception', `hh', `cc')
diff --git a/paludis/match_package.cc b/paludis/match_package.cc
index 0775eca..d5ca191 100644
--- a/paludis/match_package.cc
+++ b/paludis/match_package.cc
@@ -10,7 +10,7 @@ match_package_internals::do_match(
const PackageDepAtom * const atom,
const PackageDatabaseEntry * const entry)
{
- if (atom->package() != entry->get<pde_package>())
+ if (atom->package() != entry->get<pde_name>())
return false;
if (atom->version_spec_ptr() && ! (((entry->get<pde_version>()).*
diff --git a/paludis/package_database.cc b/paludis/package_database.cc
index a35d902..f4d44d5 100644
--- a/paludis/package_database.cc
+++ b/paludis/package_database.cc
@@ -32,7 +32,7 @@ using namespace paludis;
std::ostream &
paludis::operator<< (std::ostream & s, const PackageDatabaseEntry & v)
{
- s << v.get<pde_package>() << "-" << v.get<pde_version>() << "::" << v.get<pde_repository>();
+ s << v.get<pde_name>() << "-" << v.get<pde_version>() << "::" << v.get<pde_repository>();
return s;
}
@@ -110,14 +110,14 @@ VersionMetadata::ConstPointer
PackageDatabase::fetch_metadata(const PackageDatabaseEntry & e) const
{
const Repository::ConstPointer rr(fetch_repository(e.get<pde_repository>()));
- if (! rr->has_category_named(e.get<pde_package>().get<qpn_category>()))
- throw NoSuchPackageError(stringify(e.get<pde_package>()));
- if (! rr->has_package_named(e.get<pde_package>()))
- throw NoSuchPackageError(stringify(e.get<pde_package>()));
- if (! rr->has_version(e.get<pde_package>(), e.get<pde_version>()))
- throw NoSuchVersionError(stringify(e.get<pde_package>()), e.get<pde_version>());
- return rr->version_metadata(e.get<pde_package>().get<qpn_category>(),
- e.get<pde_package>().get<qpn_package>(), e.get<pde_version>());
+ if (! rr->has_category_named(e.get<pde_name>().get<qpn_category>()))
+ throw NoSuchPackageError(stringify(e.get<pde_name>()));
+ if (! rr->has_package_named(e.get<pde_name>()))
+ throw NoSuchPackageError(stringify(e.get<pde_name>()));
+ if (! rr->has_version(e.get<pde_name>(), e.get<pde_version>()))
+ throw NoSuchVersionError(stringify(e.get<pde_name>()), e.get<pde_version>());
+ return rr->version_metadata(e.get<pde_name>().get<qpn_category>(),
+ e.get<pde_name>().get<qpn_package>(), e.get<pde_version>());
}
Repository::ConstPointer
diff --git a/paludis/package_database.hh b/paludis/package_database.hh
index b7634c5..557e5c0 100644
--- a/paludis/package_database.hh
+++ b/paludis/package_database.hh
@@ -44,7 +44,7 @@ namespace paludis
*/
enum PackageDatabaseEntryKeys
{
- pde_package, ///< Our package
+ pde_name, ///< Our package
pde_version, ///< Our version
pde_repository, ///< Our repository
last_pde ///< Number of items
@@ -56,7 +56,7 @@ namespace paludis
struct PackageDatabaseEntryTag :
SmartRecordTag<comparison_mode::FullComparisonTag, comparison_method::SmartRecordCompareByAllTag>,
SmartRecordKeys<PackageDatabaseEntryKeys, last_pde>,
- SmartRecordKey<pde_package, QualifiedPackageName>,
+ SmartRecordKey<pde_name, QualifiedPackageName>,
SmartRecordKey<pde_version, VersionSpec>,
SmartRecordKey<pde_repository, RepositoryName>
{