aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-26 12:07:34 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-10-26 12:07:34 +0000
commit7f93223dfb2b3f4230affd92bfa6cb75d8abae83 (patch)
tree771389d8de1f100ad1ca29512b4e197858cff38a
parent8b31d155b1b9de15139ba7fa7d008b9ca792d548 (diff)
downloadpaludis-7f93223dfb2b3f4230affd92bfa6cb75d8abae83.tar.gz
paludis-7f93223dfb2b3f4230affd92bfa6cb75d8abae83.tar.xz
Make a SetName class
-rw-r--r--paludis/dep_tag.cc4
-rw-r--r--paludis/dep_tag.hh4
-rw-r--r--paludis/environment.cc8
-rw-r--r--paludis/environment.hh4
-rw-r--r--paludis/environment/default/default_environment.cc8
-rw-r--r--paludis/environment/default/default_environment.hh2
-rw-r--r--paludis/name.cc32
-rw-r--r--paludis/name.hh43
-rw-r--r--paludis/repositories/cran/cran_installed_repository.cc12
-rw-r--r--paludis/repositories/cran/cran_installed_repository.hh2
-rw-r--r--paludis/repositories/cran/cran_repository.cc6
-rw-r--r--paludis/repositories/cran/cran_repository.hh2
-rw-r--r--paludis/repositories/portage/portage_repository.cc4
-rw-r--r--paludis/repositories/portage/portage_repository.hh2
-rw-r--r--paludis/repositories/portage/portage_repository_profile.cc2
-rw-r--r--paludis/repositories/portage/portage_repository_sets.cc35
-rw-r--r--paludis/repositories/portage/portage_repository_sets.hh2
-rw-r--r--paludis/repositories/vdb/vdb_repository.cc16
-rw-r--r--paludis/repositories/vdb/vdb_repository.hh2
-rw-r--r--paludis/repository.hh6
-rw-r--r--paludis/tasks/install_task.cc27
-rw-r--r--src/adjutrix/Makefile.am2
-rw-r--r--src/adjutrix/display_default_system_resolution.cc2
-rw-r--r--src/adjutrix/find_insecure_packages.cc2
-rw-r--r--src/gtkpaludis/set_overview.cc4
-rw-r--r--src/gtkpaludis/sets_list.cc6
-rw-r--r--src/paludis/list.cc8
-rw-r--r--src/paludis/query.cc12
28 files changed, 175 insertions, 84 deletions
diff --git a/paludis/dep_tag.cc b/paludis/dep_tag.cc
index 58f2e48..ebf0728 100644
--- a/paludis/dep_tag.cc
+++ b/paludis/dep_tag.cc
@@ -163,7 +163,7 @@ GLSADepTag::glsa_title() const
return _glsa_title;
}
-GeneralSetDepTag::GeneralSetDepTag(const std::string & id, const std::string & r) :
+GeneralSetDepTag::GeneralSetDepTag(const SetName & id, const std::string & r) :
_id(id),
_source(r)
{
@@ -172,7 +172,7 @@ GeneralSetDepTag::GeneralSetDepTag(const std::string & id, const std::string & r
std::string
GeneralSetDepTag::short_text() const
{
- return _id;
+ return stringify(_id);
}
std::string
diff --git a/paludis/dep_tag.hh b/paludis/dep_tag.hh
index 22803d3..ce1d492 100644
--- a/paludis/dep_tag.hh
+++ b/paludis/dep_tag.hh
@@ -234,14 +234,14 @@ namespace paludis
public Visitable<GeneralSetDepTag, DepTagVisitorTypes>
{
private:
- const std::string _id;
+ const SetName _id;
const std::string _source;
public:
/**
* Constructor.
*/
- GeneralSetDepTag(const std::string & id, const std::string & source);
+ GeneralSetDepTag(const SetName & id, const std::string & source);
virtual std::string short_text() const;
diff --git a/paludis/environment.cc b/paludis/environment.cc
index ff1bf4d..aae5646 100644
--- a/paludis/environment.cc
+++ b/paludis/environment.cc
@@ -191,7 +191,7 @@ Environment::mask_reasons(const PackageDatabaseEntry & e) const
}
DepAtom::Pointer
-Environment::package_set(const std::string & s) const
+Environment::package_set(const SetName & s) const
{
/* favour local sets first */
CompositeDepAtom::Pointer result(local_package_set(s));
@@ -199,7 +199,7 @@ Environment::package_set(const std::string & s) const
return result;
/* these sets always exist, even if empty */
- if (s == "everything" || s == "system" || s == "world" || s == "security")
+ if (s.data() == "everything" || s.data() == "system" || s.data() == "world" || s.data() == "security")
result.assign(new AllDepAtom);
for (PackageDatabase::RepositoryIterator r(package_database()->begin_repositories()),
@@ -217,9 +217,9 @@ Environment::package_set(const std::string & s) const
result->add_child(add);
}
- if ("everything" == s || "world" == s)
+ if ("everything" == s.data() || "world" == s.data())
{
- add = (*r)->sets_interface->package_set("system");
+ add = (*r)->sets_interface->package_set(SetName("system"));
if (0 != add)
result->add_child(add);
}
diff --git a/paludis/environment.hh b/paludis/environment.hh
index 791c70d..9cd0224 100644
--- a/paludis/environment.hh
+++ b/paludis/environment.hh
@@ -112,7 +112,7 @@ namespace paludis
/**
* Local package set, or zero.
*/
- virtual CompositeDepAtom::Pointer local_package_set(const std::string &) const
+ virtual CompositeDepAtom::Pointer local_package_set(const SetName &) const
{
return AllDepAtom::Pointer(0);
}
@@ -233,7 +233,7 @@ namespace paludis
/**
* Fetch a named package set.
*/
- DepAtom::Pointer package_set(const std::string &) const;
+ DepAtom::Pointer package_set(const SetName &) const;
/**
* Subclass for callbacks used by add_appropriate_to_world and
diff --git a/paludis/environment/default/default_environment.cc b/paludis/environment/default/default_environment.cc
index 7733b9e..0a71981 100644
--- a/paludis/environment/default/default_environment.cc
+++ b/paludis/environment/default/default_environment.cc
@@ -433,16 +433,16 @@ DefaultEnvironment::hook_dirs() const
}
CompositeDepAtom::Pointer
-DefaultEnvironment::local_package_set(const std::string & s) const
+DefaultEnvironment::local_package_set(const SetName & s) const
{
- Context context("When looking for package set '" + s + "' in default environment:");
+ Context context("When looking for package set '" + stringify(s) + "' in default environment:");
- FSEntry ff(FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets" / (s + ".conf"));
+ FSEntry ff(FSEntry(DefaultConfig::get_instance()->config_dir()) / "sets" / (stringify(s) + ".conf"));
if (ff.exists())
{
LineConfigFile f(ff);
AllDepAtom::Pointer result(new AllDepAtom);
- GeneralSetDepTag::Pointer tag(new GeneralSetDepTag(s, s + ".conf"));
+ GeneralSetDepTag::Pointer tag(new GeneralSetDepTag(s, stringify(s) + ".conf"));
for (LineConfigFile::Iterator line(f.begin()), line_end(f.end()) ;
line != line_end ; ++line)
diff --git a/paludis/environment/default/default_environment.hh b/paludis/environment/default/default_environment.hh
index 058a246..8d4b74e 100644
--- a/paludis/environment/default/default_environment.hh
+++ b/paludis/environment/default/default_environment.hh
@@ -49,7 +49,7 @@ namespace paludis
~DefaultEnvironment();
protected:
- CompositeDepAtom::Pointer local_package_set(const std::string &) const;
+ CompositeDepAtom::Pointer local_package_set(const SetName &) const;
public:
virtual bool query_use(const UseFlagName &, const PackageDatabaseEntry *) const;
diff --git a/paludis/name.cc b/paludis/name.cc
index aca38f6..2d2736f 100644
--- a/paludis/name.cc
+++ b/paludis/name.cc
@@ -296,3 +296,35 @@ QualifiedPackageName::QualifiedPackageName(const std::string & s) :
{
}
+void
+SetNameValidator::validate(const std::string & s)
+{
+ static const std::string allowed_chars(
+ "abcdefghijklmnopqrstuvwxyz"
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ "0123456789-+_");
+
+ do
+ {
+ if (s.empty())
+ break;
+
+ if ('-' == s.at(0))
+ break;
+
+ if (std::string::npos != s.find_first_not_of(allowed_chars))
+ break;
+
+ return;
+
+ } while (false);
+
+ Context c("When validating set name '" + s + "':");
+ throw SetNameError(s);
+}
+
+SetNameError::SetNameError(const std::string & name) throw () :
+ NameError(name, "set")
+{
+}
+
diff --git a/paludis/name.hh b/paludis/name.hh
index 0f10dd8..14686e3 100644
--- a/paludis/name.hh
+++ b/paludis/name.hh
@@ -310,7 +310,7 @@ namespace paludis
/**
* A KeywordNameValidator handles validation rules for the value of a
- * UseFlagName.
+ * KeywordName.
*
* \ingroup grpnames
*/
@@ -326,7 +326,7 @@ namespace paludis
/**
* A KeywordNameError is thrown if an invalid value is assigned to
- * a KeywordNameName.
+ * a KeywordName.
*
* \ingroup grpnames
* \ingroup grpexceptions
@@ -358,6 +358,45 @@ namespace paludis
use_disabled, /// disabled
use_enabled /// enabled
};
+
+ /**
+ * A SetNameValidator handles validation rules for the value of a
+ * SetName.
+ *
+ * \ingroup grpnames
+ */
+ struct SetNameValidator :
+ private InstantiationPolicy<SetNameValidator, instantiation_method::NonInstantiableTag>
+ {
+ /**
+ * If the parameter is not a valid value for a SetName,
+ * throw a SetNameError.
+ */
+ static void validate(const std::string &);
+ };
+
+ /**
+ * A SetNameError is thrown if an invalid value is assigned to
+ * a SetName.
+ *
+ * \ingroup grpnames
+ * \ingroup grpexceptions
+ */
+ class SetNameError : public NameError
+ {
+ public:
+ /**
+ * Constructor.
+ */
+ SetNameError(const std::string & name) throw ();
+ };
+
+ /**
+ * A SetName holds a std::string that is a valid name for a set.
+ *
+ * \ingroup grpnames
+ */
+ typedef Validated<std::string, SetNameValidator> SetName;
}
#endif
diff --git a/paludis/repositories/cran/cran_installed_repository.cc b/paludis/repositories/cran/cran_installed_repository.cc
index a34a1c8..723645b 100644
--- a/paludis/repositories/cran/cran_installed_repository.cc
+++ b/paludis/repositories/cran/cran_installed_repository.cc
@@ -448,12 +448,12 @@ CRANInstalledRepository::do_uninstall(const QualifiedPackageName & q, const Vers
}
DepAtom::Pointer
-CRANInstalledRepository::do_package_set(const std::string & s) const
+CRANInstalledRepository::do_package_set(const SetName & s) const
{
- Context context("When fetching package set '" + s + "' from '" +
+ Context context("When fetching package set '" + stringify(s) + "' from '" +
stringify(name()) + "':");
- if ("everything" == s)
+ if ("everything" == s.data())
{
AllDepAtom::Pointer result(new AllDepAtom);
if (! _imp->entries_valid)
@@ -468,7 +468,7 @@ CRANInstalledRepository::do_package_set(const std::string & s) const
return result;
}
- else if ("world" == s)
+ else if ("world" == s.data())
{
AllDepAtom::Pointer result(new AllDepAtom);
@@ -499,8 +499,8 @@ CRANInstalledRepository::sets_list() const
Context context("While generating the list of sets:");
SetsCollection::Pointer result(new SetsCollection::Concrete);
- result->insert("everything");
- result->insert("world");
+ result->insert(SetName("everything"));
+ result->insert(SetName("world"));
return result;
}
diff --git a/paludis/repositories/cran/cran_installed_repository.hh b/paludis/repositories/cran/cran_installed_repository.hh
index 6f82e17..e783e04 100644
--- a/paludis/repositories/cran/cran_installed_repository.hh
+++ b/paludis/repositories/cran/cran_installed_repository.hh
@@ -80,7 +80,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual DepAtom::Pointer do_package_set(const std::string &) const;
+ virtual DepAtom::Pointer do_package_set(const SetName &) const;
virtual SetsCollection::ConstPointer sets_list() const;
diff --git a/paludis/repositories/cran/cran_repository.cc b/paludis/repositories/cran/cran_repository.cc
index 7ab4ac2..4c7dd76 100644
--- a/paludis/repositories/cran/cran_repository.cc
+++ b/paludis/repositories/cran/cran_repository.cc
@@ -572,9 +572,9 @@ CRANRepository::do_install(const QualifiedPackageName &q, const VersionSpec &vn,
}
DepAtom::Pointer
-CRANRepository::do_package_set(const std::string & s) const
+CRANRepository::do_package_set(const SetName & s) const
{
- if ("base" == s)
+ if ("base" == s.data())
{
/**
* \todo Implement system as all package which are installed
@@ -592,7 +592,7 @@ CRANRepository::sets_list() const
Context context("While generating the list of sets:");
SetsCollection::Pointer result(new SetsCollection::Concrete);
- result->insert("base");
+ result->insert(SetName("base"));
return result;
}
diff --git a/paludis/repositories/cran/cran_repository.hh b/paludis/repositories/cran/cran_repository.hh
index fcaf61b..7277016 100644
--- a/paludis/repositories/cran/cran_repository.hh
+++ b/paludis/repositories/cran/cran_repository.hh
@@ -89,7 +89,7 @@ namespace paludis
virtual void do_install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual DepAtom::Pointer do_package_set(const std::string &) const;
+ virtual DepAtom::Pointer do_package_set(const SetName &) const;
virtual SetsCollection::ConstPointer sets_list() const;
diff --git a/paludis/repositories/portage/portage_repository.cc b/paludis/repositories/portage/portage_repository.cc
index ab49256..a45e7bb 100644
--- a/paludis/repositories/portage/portage_repository.cc
+++ b/paludis/repositories/portage/portage_repository.cc
@@ -709,9 +709,9 @@ PortageRepository::do_install(const QualifiedPackageName & q, const VersionSpec
}
DepAtom::Pointer
-PortageRepository::do_package_set(const std::string & s) const
+PortageRepository::do_package_set(const SetName & s) const
{
- if (s == "system")
+ if (s.data() == "system")
{
_imp->need_profiles();
return _imp->profile_ptr->system_packages();
diff --git a/paludis/repositories/portage/portage_repository.hh b/paludis/repositories/portage/portage_repository.hh
index b2e6396..e10234e 100644
--- a/paludis/repositories/portage/portage_repository.hh
+++ b/paludis/repositories/portage/portage_repository.hh
@@ -100,7 +100,7 @@ namespace paludis
virtual void do_install(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual DepAtom::Pointer do_package_set(const std::string &) const;
+ virtual DepAtom::Pointer do_package_set(const SetName &) const;
virtual SetsCollection::ConstPointer sets_list() const;
diff --git a/paludis/repositories/portage/portage_repository_profile.cc b/paludis/repositories/portage/portage_repository_profile.cc
index 73250b0..04fde0e 100644
--- a/paludis/repositories/portage/portage_repository_profile.cc
+++ b/paludis/repositories/portage/portage_repository_profile.cc
@@ -149,7 +149,7 @@ namespace paludis
const FSEntryCollection & dirs) :
env(e),
system_packages(new AllDepAtom),
- system_tag(new GeneralSetDepTag("system", stringify(name)))
+ system_tag(new GeneralSetDepTag(SetName("system"), stringify(name)))
{
for (FSEntryCollection::Iterator d(dirs.begin()), d_end(dirs.end()) ;
d != d_end ; ++d)
diff --git a/paludis/repositories/portage/portage_repository_sets.cc b/paludis/repositories/portage/portage_repository_sets.cc
index ca0cce4..f312a5e 100644
--- a/paludis/repositories/portage/portage_repository_sets.cc
+++ b/paludis/repositories/portage/portage_repository_sets.cc
@@ -77,20 +77,20 @@ PortageRepositorySets::~PortageRepositorySets()
DepAtom::Pointer
-PortageRepositorySets::package_set(const std::string & s) const
+PortageRepositorySets::package_set(const SetName & s) const
{
- if ("system" == s)
+ if ("system" == s.data())
throw InternalError(PALUDIS_HERE, "system set should've been handled by PortageRepository");
- else if ("security" == s)
+ else if ("security" == s.data())
return security_set(false);
- else if ("insecurity" == s)
+ else if ("insecurity" == s.data())
return security_set(true);
- else if ((_imp->params.setsdir / (s + ".conf")).exists())
+ else if ((_imp->params.setsdir / (stringify(s) + ".conf")).exists())
{
GeneralSetDepTag::Pointer tag(new GeneralSetDepTag(s, stringify(_imp->portage_repository->name())));
- FSEntry ff(_imp->params.setsdir / (s + ".conf"));
- Context context("When loading package set '" + s + "' from '" + stringify(ff) + "':");
+ FSEntry ff(_imp->params.setsdir / (stringify(s) + ".conf"));
+ Context context("When loading package set '" + stringify(s) + "' from '" + stringify(ff) + "':");
AllDepAtom::Pointer result(new AllDepAtom);
LineConfigFile f(ff);
@@ -149,14 +149,10 @@ PortageRepositorySets::sets_list() const
Context context("While generating the list of sets:");
SetsCollection::Pointer result(new SetsCollection::Concrete);
- result->insert("insecurity");
- result->insert("security");
- result->insert("system");
+ result->insert(SetName("insecurity"));
+ result->insert(SetName("security"));
+ result->insert(SetName("system"));
- /*
- * TODO: get rid of unnecessary copying and just put this in a for loop
- * (need to read some doxygen pages on FSEntry first)
- */
try
{
std::list<FSEntry> repo_sets;
@@ -168,7 +164,16 @@ PortageRepositorySets::sets_list() const
f_end(repo_sets.end());
for ( ; f != f_end ; ++f)
- result->insert(stringify(*f));
+ try
+ {
+ result->insert(SetName(stringify(*f)));
+ }
+ catch (const NameError & e)
+ {
+ Log::get_instance()->message(ll_warning, lc_context, "Skipping set '"
+ + stringify(*f) + "' due to exception '" + stringify(e.message()) + "' ("
+ + stringify(e.what()) + ")");
+ }
}
catch (const paludis::DirOpenError & e)
{
diff --git a/paludis/repositories/portage/portage_repository_sets.hh b/paludis/repositories/portage/portage_repository_sets.hh
index 0f54dcd..22baf92 100644
--- a/paludis/repositories/portage/portage_repository_sets.hh
+++ b/paludis/repositories/portage/portage_repository_sets.hh
@@ -63,7 +63,7 @@ namespace paludis
/**
* Fetch a package set other than system.
*/
- DepAtom::Pointer package_set(const std::string & s) const;
+ DepAtom::Pointer package_set(const SetName & s) const;
/**
* Fetch the security or insecurity set.
diff --git a/paludis/repositories/vdb/vdb_repository.cc b/paludis/repositories/vdb/vdb_repository.cc
index 86b3459..53e667d 100644
--- a/paludis/repositories/vdb/vdb_repository.cc
+++ b/paludis/repositories/vdb/vdb_repository.cc
@@ -824,15 +824,15 @@ VDBRepository::do_uninstall(const QualifiedPackageName & q, const VersionSpec &
}
DepAtom::Pointer
-VDBRepository::do_package_set(const std::string & s) const
+VDBRepository::do_package_set(const SetName & s) const
{
- Context context("When fetching package set '" + s + "' from '" +
+ Context context("When fetching package set '" + stringify(s) + "' from '" +
stringify(name()) + "':");
- if ("everything" == s)
+ if ("everything" == s.data())
{
AllDepAtom::Pointer result(new AllDepAtom);
- GeneralSetDepTag::Pointer tag(new GeneralSetDepTag("everything", stringify(name())));
+ GeneralSetDepTag::Pointer tag(new GeneralSetDepTag(SetName("everything"), stringify(name())));
if (! _imp->entries_valid)
_imp->load_entries();
@@ -847,10 +847,10 @@ VDBRepository::do_package_set(const std::string & s) const
return result;
}
- else if ("world" == s)
+ else if ("world" == s.data())
{
AllDepAtom::Pointer result(new AllDepAtom);
- GeneralSetDepTag::Pointer tag(new GeneralSetDepTag("world", stringify(name())));
+ GeneralSetDepTag::Pointer tag(new GeneralSetDepTag(SetName("world"), stringify(name())));
if (_imp->world_file.exists())
{
@@ -881,8 +881,8 @@ VDBRepository::sets_list() const
Context context("While generating the list of sets:");
SetsCollection::Pointer result(new SetsCollection::Concrete);
- result->insert("everything");
- result->insert("world");
+ result->insert(SetName("everything"));
+ result->insert(SetName("world"));
return result;
}
diff --git a/paludis/repositories/vdb/vdb_repository.hh b/paludis/repositories/vdb/vdb_repository.hh
index a1574ed..4f2edfd 100644
--- a/paludis/repositories/vdb/vdb_repository.hh
+++ b/paludis/repositories/vdb/vdb_repository.hh
@@ -83,7 +83,7 @@ namespace paludis
virtual void do_uninstall(const QualifiedPackageName &, const VersionSpec &,
const InstallOptions &) const;
- virtual DepAtom::Pointer do_package_set(const std::string &) const;
+ virtual DepAtom::Pointer do_package_set(const SetName &) const;
/* RepositoryUseInterface */
diff --git a/paludis/repository.hh b/paludis/repository.hh
index 6782d60..0f06bbd 100644
--- a/paludis/repository.hh
+++ b/paludis/repository.hh
@@ -569,7 +569,7 @@ namespace paludis
/**
* Contains the names of all the sets provided by the repository.
*/
- typedef SortedCollection<std::string> SetsCollection;
+ typedef SortedCollection<SetName> SetsCollection;
/**
* Interface for package sets for repositories.
@@ -584,13 +584,13 @@ namespace paludis
/**
* Override in descendents: package list.
*/
- virtual DepAtom::Pointer do_package_set(const std::string & id) const = 0;
+ virtual DepAtom::Pointer do_package_set(const SetName & id) const = 0;
public:
/**
* Fetch a package set.
*/
- virtual DepAtom::Pointer package_set(const std::string & s) const
+ DepAtom::Pointer package_set(const SetName & s) const
{
return do_package_set(s);
}
diff --git a/paludis/tasks/install_task.cc b/paludis/tasks/install_task.cc
index f05e946..3d68dfb 100644
--- a/paludis/tasks/install_task.cc
+++ b/paludis/tasks/install_task.cc
@@ -86,19 +86,28 @@ InstallTask::add_target(const std::string & target)
DepAtom::Pointer s(0);
- if ((target != "insecurity") && ((s = ((_imp->env->package_set(target))))))
+ bool done(false);
+ try
{
- if (_imp->had_set_targets)
- throw MultipleSetTargetsSpecified();
+ if ((target != "insecurity") && ((s = ((_imp->env->package_set(SetName(target)))))))
+ {
+ if (_imp->had_set_targets)
+ throw MultipleSetTargetsSpecified();
- if (_imp->had_package_targets)
- throw HadBothPackageAndSetTargets();
+ if (_imp->had_package_targets)
+ throw HadBothPackageAndSetTargets();
- _imp->had_set_targets = true;
- _imp->dep_list.options.target_type = dl_target_set;
- _imp->targets->add_child(s);
+ _imp->had_set_targets = true;
+ _imp->dep_list.options.target_type = dl_target_set;
+ _imp->targets->add_child(s);
+ done = true;
+ }
}
- else
+ catch (const SetNameError &)
+ {
+ }
+
+ if (! done)
{
if (_imp->had_set_targets)
throw HadBothPackageAndSetTargets();
diff --git a/src/adjutrix/Makefile.am b/src/adjutrix/Makefile.am
index 3dfc8b3..7588766 100644
--- a/src/adjutrix/Makefile.am
+++ b/src/adjutrix/Makefile.am
@@ -38,12 +38,12 @@ adjutrix_SOURCES = \
adjutrix.cc
adjutrix_LDADD = \
- $(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la \
$(top_builddir)/paludis/tasks/libpaludistasks.a \
$(top_builddir)/paludis/libpaludis.la \
$(top_builddir)/paludis/args/libpaludisargs.la \
$(top_builddir)/paludis/util/libpaludisutil.la \
$(top_builddir)/paludis/environment/no_config/libpaludisnoconfigenvironment.la \
+ $(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la \
$(top_builddir)/src/libcolour.a \
$(DYNAMIC_LD_LIBS)
diff --git a/src/adjutrix/display_default_system_resolution.cc b/src/adjutrix/display_default_system_resolution.cc
index 7ccbf45..4ebfb5c 100644
--- a/src/adjutrix/display_default_system_resolution.cc
+++ b/src/adjutrix/display_default_system_resolution.cc
@@ -72,7 +72,7 @@ namespace
try
{
- d.add(env.package_set("system"));
+ d.add(env.package_set(SetName("system")));
for (DepList::Iterator e(d.begin()), e_end(d.end()) ; e != e_end ; ++e)
cout << " " << e->package << ":" << e->metadata->slot << endl;
diff --git a/src/adjutrix/find_insecure_packages.cc b/src/adjutrix/find_insecure_packages.cc
index 1409c69..9cb5b53 100644
--- a/src/adjutrix/find_insecure_packages.cc
+++ b/src/adjutrix/find_insecure_packages.cc
@@ -151,7 +151,7 @@ void do_find_insecure_packages(const Environment & env)
write_repository_header(r->name());
- DepAtom::ConstPointer all_insecure(r->sets_interface->package_set("insecurity"));
+ DepAtom::ConstPointer all_insecure(r->sets_interface->package_set(SetName("insecurity")));
if (! all_insecure)
continue;
ListInsecureVisitor v(env);
diff --git a/src/gtkpaludis/set_overview.cc b/src/gtkpaludis/set_overview.cc
index 671ec22..77b6ddd 100644
--- a/src/gtkpaludis/set_overview.cc
+++ b/src/gtkpaludis/set_overview.cc
@@ -185,7 +185,7 @@ namespace
{
private:
Implementation<SetOverview> * const _imp;
- std::string _set;
+ SetName _set;
public:
Populate(Implementation<SetOverview> * const imp, const std::string & set) :
@@ -206,7 +206,7 @@ namespace
DepAtom::ConstPointer set_atom(DefaultEnvironment::get_instance()->package_set(_set));
Gtk::TreeModel::Row top_row = *model->append();
- top_row[_imp->columns.col_atom] = _set;
+ top_row[_imp->columns.col_atom] = stringify(_set);
TreeFromDepAtom v(model, &_imp->columns, &top_row);
set_atom->accept(&v);
diff --git a/src/gtkpaludis/sets_list.cc b/src/gtkpaludis/sets_list.cc
index f2d06a2..8714c2d 100644
--- a/src/gtkpaludis/sets_list.cc
+++ b/src/gtkpaludis/sets_list.cc
@@ -59,9 +59,9 @@ namespace paludis
{
}
- void add_sets(const std::set<std::string> & c)
+ void add_sets(const std::set<SetName> & c)
{
- for (std::set<std::string>::const_iterator n(c.begin()), n_end(c.end()) ; n != n_end ; ++n)
+ for (std::set<SetName>::const_iterator n(c.begin()), n_end(c.end()) ; n != n_end ; ++n)
{
Gtk::TreeModel::Row row = *(model->append());
row[columns.col_set] = stringify(*n);
@@ -90,7 +90,7 @@ namespace
void
Populate::operator() ()
{
- std::set<std::string> names;
+ std::set<SetName> names;
StatusBarMessage m1(this, "Loading set names...");
diff --git a/src/paludis/list.cc b/src/paludis/list.cc
index 5b93fc1..f652639 100644
--- a/src/paludis/list.cc
+++ b/src/paludis/list.cc
@@ -186,7 +186,7 @@ do_list_sets()
p::Context context("While performing list-sets action from command line:");
p::Environment * const env(p::DefaultEnvironment::get_instance());
- std::map<std::string, std::list<p::RepositoryName> > sets;
+ std::map<p::SetName, std::list<p::RepositoryName> > sets;
for (p::IndirectIterator<p::PackageDatabase::RepositoryIterator, const p::Repository>
r(env->package_database()->begin_repositories()), r_end(env->package_database()->end_repositories()) ;
@@ -208,16 +208,16 @@ do_list_sets()
sets[*s].push_back(r->name());
}
- for (std::map<std::string, std::list<p::RepositoryName > >::const_iterator
+ for (std::map<p::SetName, std::list<p::RepositoryName > >::const_iterator
s(sets.begin()), s_end(sets.end()) ; s != s_end ; ++s)
{
if (CommandLine::get_instance()->a_set.specified())
if (CommandLine::get_instance()->a_set.args_end() == std::find(
CommandLine::get_instance()->a_set.args_begin(),
CommandLine::get_instance()->a_set.args_end(),
- s->first))
+ stringify(s->first)))
continue;
-
+
ret_code = 0;
std::cout << "* " << colour(cl_package_name, s->first) << std::endl;
diff --git a/src/paludis/query.cc b/src/paludis/query.cc
index 09b1725..96e27cd 100644
--- a/src/paludis/query.cc
+++ b/src/paludis/query.cc
@@ -309,9 +309,15 @@ void do_one_query(
DepAtom::Pointer set(0);
if (std::string::npos == q.find('/'))
{
- if (0 == ((set = env->package_set(q))))
- atom.assign(new PackageDepAtom(env->package_database()->fetch_unique_qualified_package_name(
- PackageNamePart(q))));
+ try
+ {
+ if (0 == ((set = env->package_set(SetName(q)))))
+ atom.assign(new PackageDepAtom(env->package_database()->fetch_unique_qualified_package_name(
+ PackageNamePart(q))));
+ }
+ catch (const SetNameError &)
+ {
+ }
}
else
atom.assign(new PackageDepAtom(q));