aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-12 01:57:18 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-12 01:57:18 +0000
commit53ff949fb238d1a861abaef0171ac00fef1f5eb6 (patch)
tree9604b6ca1bc1ffaf94e075139669d6eac803167c
parent86d64baa4ffff0ea3eb9c5d0ed0fc6c5c02e34df (diff)
downloadpaludis-53ff949fb238d1a861abaef0171ac00fef1f5eb6.tar.gz
paludis-53ff949fb238d1a861abaef0171ac00fef1f5eb6.tar.xz
Add --unstable option for adjutrix, mainly for --display-default-system-resolution
-rw-r--r--src/adjutrix/adjutrix_environment.cc16
-rw-r--r--src/adjutrix/command_line.cc4
-rw-r--r--src/adjutrix/command_line.hh1
3 files changed, 15 insertions, 6 deletions
diff --git a/src/adjutrix/adjutrix_environment.cc b/src/adjutrix/adjutrix_environment.cc
index e0a48b2..a78f1eb 100644
--- a/src/adjutrix/adjutrix_environment.cc
+++ b/src/adjutrix/adjutrix_environment.cc
@@ -18,8 +18,10 @@
*/
#include "adjutrix_environment.hh"
+#include "command_line.hh"
#include <paludis/util/collection_concrete.hh>
#include <paludis/repositories/portage/portage_repository.hh>
+#include <set>
using namespace paludis;
@@ -31,12 +33,11 @@ namespace paludis
{
const FSEntry top_level_dir;
PackageDatabase::Pointer db;
- KeywordName accepted_keyword;
+ std::set<KeywordName> accepted_keywords;
Implementation(Environment * const env, const FSEntry & d) :
top_level_dir(d),
- db(new PackageDatabase(env)),
- accepted_keyword("fnord")
+ db(new PackageDatabase(env))
{
}
};
@@ -92,17 +93,22 @@ AdjutrixEnvironment::set_profile(const FSEntry & location)
PortageRepository::Pointer p(RepositoryMaker::get_instance()->find_maker("portage")(this,
_imp->db.raw_pointer(), keys));
- _imp->accepted_keyword = KeywordName(p->profile_variable("ARCH"));
db->add_repository(RepositoryMaker::get_instance()->find_maker("virtuals")(this,
db.raw_pointer(), AssociativeCollection<std::string, std::string>::Pointer(0)));
db->add_repository(p);
+ _imp->accepted_keywords.clear();
+ _imp->accepted_keywords.insert(KeywordName("*"));
+ _imp->accepted_keywords.insert(KeywordName(p->profile_variable("ARCH")));
+ if (CommandLine::get_instance()->a_unstable.specified())
+ _imp->accepted_keywords.insert(KeywordName("~" + p->profile_variable("ARCH")));
+
change_package_database(db);
}
bool
AdjutrixEnvironment::accept_keyword(const KeywordName & k, const PackageDatabaseEntry * const) const
{
- return (k.data() == "*") || (k == _imp->accepted_keyword);
+ return _imp->accepted_keywords.end() != _imp->accepted_keywords.find(k);
}
diff --git a/src/adjutrix/command_line.cc b/src/adjutrix/command_line.cc
index 2712558..f2ec58d 100644
--- a/src/adjutrix/command_line.cc
+++ b/src/adjutrix/command_line.cc
@@ -76,7 +76,9 @@ CommandLine::CommandLine() :
profile_args(this, "Profile action options",
"Options which are relevant for profile actions."),
a_profile(&profile_args, "profile", 'p',
- "Display results for this profile path, rather than all profiles (may be specified multiple times)")
+ "Display results for this profile path, rather than all profiles (may be specified multiple times)"),
+ a_unstable(&profile_args, "unstable", 'U',
+ "Accept ~arch as well as arch")
{
add_usage_line("--find-stable-candidates arch [ --repository-dir /path ] "
"[ --category app-misc --category sys-apps ... ] "
diff --git a/src/adjutrix/command_line.hh b/src/adjutrix/command_line.hh
index 7845a27..7401777 100644
--- a/src/adjutrix/command_line.hh
+++ b/src/adjutrix/command_line.hh
@@ -102,6 +102,7 @@ class CommandLine :
paludis::args::ArgsGroup profile_args;
paludis::args::StringSetArg a_profile;
+ paludis::args::SwitchArg a_unstable;
///\}