aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2007-10-26 21:29:31 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2007-10-26 21:29:31 +0000
commit7e0051297d6ae82607edb1279c38b26a74d500de (patch)
tree260a9ce6785b338d7fd7822e7f48219d86c4207f
parentdd3867b46e28d020a2bb8ae5513d826abfedf958 (diff)
downloadpaludis-7e0051297d6ae82607edb1279c38b26a74d500de.tar.gz
paludis-7e0051297d6ae82607edb1279c38b26a74d500de.tar.xz
Don't crash when checking foreign arch flags.
-rw-r--r--paludis/repositories/e/e_repository.cc3
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc4
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh4
3 files changed, 10 insertions, 1 deletions
diff --git a/paludis/repositories/e/e_repository.cc b/paludis/repositories/e/e_repository.cc
index c3cff5f..1123ae2 100644
--- a/paludis/repositories/e/e_repository.cc
+++ b/paludis/repositories/e/e_repository.cc
@@ -457,7 +457,8 @@ ERepository::query_use_mask(const UseFlagName & u, const PackageID & e) const
{
_imp->need_profiles();
return _imp->profile_ptr->use_masked(u, e) ||
- (arch_flags()->end() != arch_flags()->find(u) && use_enabled != query_use(u, e));
+ (arch_flags()->end() != arch_flags()->find(u) &&
+ use_enabled != _imp->profile_ptr->use_state_ignoring_masks(u, e));
}
bool
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 413ea89..bf75604 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -690,6 +690,10 @@ namespace test_cases
TEST_CHECK(repo->query_use(UseFlagName("flag3"), *p1) == use_enabled);
TEST_CHECK(repo->query_use(UseFlagName("flag5"), *p2) == use_enabled);
TEST_CHECK(repo->query_use(UseFlagName("flag5"), *p1) == use_unspecified);
+ TEST_CHECK(repo->query_use(UseFlagName("test"), *p1) == use_enabled);
+ TEST_CHECK(repo->query_use(UseFlagName("test2"), *p1) == use_disabled);
+ TEST_CHECK(! repo->query_use_mask(UseFlagName("test"), *p1));
+ TEST_CHECK(repo->query_use_mask(UseFlagName("test2"), *p1));
}
}
} test_e_repository_query_use;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index ad8311d..60f5c84 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -263,6 +263,10 @@ cat <<END >profiles/categories || exit 1
cat-one
cat-two
END
+cat <<END > profiles/arch.list || exit 1
+test
+test2
+END
cat <<END >profiles/profile/make.defaults || exit 1
ARCH=test
USE="flag1 flag2 flag3 -flag4 -flag5"