aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-13 18:39:45 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-09-13 18:39:45 +0000
commitc845a694af1295fd99b3c84465e505dbba446bfa (patch)
tree54086bb936165ca2348fd2688e333d523635726c
parentcc6ef4567cfda582014a46e5ea534d5dda7cf9cf (diff)
downloadpaludis-c845a694af1295fd99b3c84465e505dbba446bfa.tar.gz
paludis-c845a694af1295fd99b3c84465e505dbba446bfa.tar.xz
Make -* work. Really, this time
-rw-r--r--paludis/default_config.cc5
-rw-r--r--paludis/default_environment_TEST.cc33
-rwxr-xr-xpaludis/default_environment_TEST_setup.sh20
3 files changed, 55 insertions, 3 deletions
diff --git a/paludis/default_config.cc b/paludis/default_config.cc
index af25e8a..012d7b7 100644
--- a/paludis/default_config.cc
+++ b/paludis/default_config.cc
@@ -390,8 +390,7 @@ DefaultConfig::DefaultConfig() :
{
if (*t == "-*")
{
- _imp->default_use_prefixes_that_have_minus_star.push_back(prefix.empty() ? prefix :
- prefix + "_");
+ _imp->default_use_prefixes_that_have_minus_star.push_back(prefix);
if (prefix.empty())
Log::get_instance()->message(ll_warning, lc_no_context,
"Using '* -*' in use.conf is dangerous. You have been warned.");
@@ -422,7 +421,7 @@ DefaultConfig::DefaultConfig() :
{
if ("-*" == *t)
_imp->use_prefixes_that_have_minus_star[a->package()].push_back(
- std::make_pair(a, prefix.empty() ? prefix : prefix + "_"));
+ std::make_pair(a, prefix));
else
_imp->use[a->package()].push_back(UseConfigEntry(
a, UseFlagName(prefix + t->substr(1)), use_disabled));
diff --git a/paludis/default_environment_TEST.cc b/paludis/default_environment_TEST.cc
index afad951..91f97c4 100644
--- a/paludis/default_environment_TEST.cc
+++ b/paludis/default_environment_TEST.cc
@@ -94,5 +94,38 @@ namespace test_cases
TEST_CHECK(env->query_use(UseFlagName("third_exp_two"), &f));
}
} default_environment_use_test_minus_star;
+
+ struct TestDefaultEnvironmentUseMinusPartialStar : TestCase
+ {
+ TestDefaultEnvironmentUseMinusPartialStar() : TestCase("use -* partial") { }
+
+ void run()
+ {
+ setenv("PALUDIS_HOME", stringify(FSEntry::cwd() / "default_environment_TEST_dir" / "home3").c_str(), 1);
+ unsetenv("PALUDIS_SKIP_CONFIG");
+ DefaultConfig::destroy_instance();
+ DefaultEnvironment::destroy_instance();
+
+ Environment * env(DefaultEnvironment::get_instance());
+
+ TEST_CHECK(env->query_use(UseFlagName("foo"), 0));
+ TEST_CHECK(! env->query_use(UseFlagName("foofoo"), 0));
+
+ PackageDatabaseEntry e(QualifiedPackageName("cat-one/pkg-one"), VersionSpec("1"), RepositoryName("foo"));
+ TEST_CHECK(env->query_use(UseFlagName("foo"), &e));
+ TEST_CHECK(! env->query_use(UseFlagName("foofoo"), &e));
+ TEST_CHECK(env->query_use(UseFlagName("moo"), &e));
+
+ TEST_CHECK(env->query_use(UseFlagName("more_exp_one"), &e));
+ TEST_CHECK(env->query_use(UseFlagName("exp_two"), &e));
+ TEST_CHECK(! env->query_use(UseFlagName("exp_one"), &e));
+ TEST_CHECK(env->query_use(UseFlagName("third_exp_one"), &e));
+ TEST_CHECK(! env->query_use(UseFlagName("third_exp_two"), &e));
+
+ PackageDatabaseEntry f(QualifiedPackageName("cat-one/pkg-two"), VersionSpec("3"), RepositoryName("foo"));
+ TEST_CHECK(! env->query_use(UseFlagName("third_exp_one"), &f));
+ TEST_CHECK(env->query_use(UseFlagName("third_exp_two"), &f));
+ }
+ } default_environment_use_test_minus_star_partial;
}
diff --git a/paludis/default_environment_TEST_setup.sh b/paludis/default_environment_TEST_setup.sh
index e4dc625..bb19c8a 100755
--- a/paludis/default_environment_TEST_setup.sh
+++ b/paludis/default_environment_TEST_setup.sh
@@ -58,3 +58,23 @@ profiles = `pwd`/repo/profile
cache = /var/empty
END
+mkdir -p home3/.paludis/repositories
+cat <<END > home3/.paludis/use.conf
+* foo bar baz -fnord
+* EXP: -* two
+>=cat-one/pkg-two-2 THIRD_EXP: -* two
+END
+cat <<END > home3/.paludis/keywords.conf
+* keyword
+END
+cat <<END > home3/.paludis/licenses.conf
+* *
+END
+cat <<END > home3/.paludis/repositories/foo.conf
+format = portage
+location = `pwd`/repo
+profiles = `pwd`/repo/profile
+cache = /var/empty
+END
+
+