aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2015-10-31 15:32:18 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2015-11-05 17:37:26 +0000
commitea0ee08da746e4d924031bafca3e96e60b7599bd (patch)
tree5997f4dc2998bcc54d476b651a50de46272aa54a
parentdfc9acb9553cb661eb69c4fd7127e2d54f5c6104 (diff)
downloadpaludis-ea0ee08da746e4d924031bafca3e96e60b7599bd.tar.gz
paludis-ea0ee08da746e4d924031bafca3e96e60b7599bd.tar.xz
EAPI 6 sets failglob in global scope
-rw-r--r--paludis/repositories/e/e_repository_TEST_5.cc9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_5_setup.sh14
-rw-r--r--paludis/repositories/e/e_repository_TEST_6.cc16
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_6_setup.sh30
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/6.conf2
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rwxr-xr-xpaludis/repositories/e/ebuild/ebuild.bash5
9 files changed, 81 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_repository_TEST_5.cc b/paludis/repositories/e/e_repository_TEST_5.cc
index dcb86c6..8d8581c 100644
--- a/paludis/repositories/e/e_repository_TEST_5.cc
+++ b/paludis/repositories/e/e_repository_TEST_5.cc
@@ -213,6 +213,15 @@ TEST(ERepository, InstallEAPI5)
id->perform_action(pretend_action);
ASSERT_TRUE(! pretend_action.failed());
}
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/global-no-failglob-5",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ EXPECT_EQ("5", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
+ id->perform_action(action);
+ }
}
TEST(ERepository, RequiredUse)
diff --git a/paludis/repositories/e/e_repository_TEST_5_setup.sh b/paludis/repositories/e/e_repository_TEST_5_setup.sh
index 880c7d7..53b9f84 100755
--- a/paludis/repositories/e/e_repository_TEST_5_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_5_setup.sh
@@ -360,6 +360,20 @@ pkg_pretend() {
}
END
+mkdir -p "cat/global-no-failglob" || exit 1
+cat << 'END' > cat/global-no-failglob/global-no-failglob-5.ebuild || exit 1
+EAPI="5"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+fail=( does/not/exist/* )
+END
+
mkdir -p "cat/subslots" || exit 1
cat << 'END' > cat/subslots/subslots-5.ebuild || exit 1
EAPI="5"
diff --git a/paludis/repositories/e/e_repository_TEST_6.cc b/paludis/repositories/e/e_repository_TEST_6.cc
index 467a7f7..99fb43d 100644
--- a/paludis/repositories/e/e_repository_TEST_6.cc
+++ b/paludis/repositories/e/e_repository_TEST_6.cc
@@ -133,5 +133,21 @@ TEST(ERepository, InstallEAPI6)
n::replacing() = std::make_shared<PackageIDSequence>()
));
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/global-failglob-6",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ EXPECT_EQ("UNKNOWN", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
+ }
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/nonglobal-no-failglob-6",
+ &env, { })), nullptr, { }))]->last());
+ ASSERT_TRUE(bool(id));
+ EXPECT_EQ("6", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
+ id->perform_action(action);
+ }
}
diff --git a/paludis/repositories/e/e_repository_TEST_6_setup.sh b/paludis/repositories/e/e_repository_TEST_6_setup.sh
index e91dd1b..ef6e212 100755
--- a/paludis/repositories/e/e_repository_TEST_6_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_6_setup.sh
@@ -33,5 +33,35 @@ USE_EXPAND_VALUES_ARCH="cheese otherarch"
IUSE_IMPLICIT="build"
END
+mkdir -p "cat/global-failglob" || exit 1
+cat << 'END' > cat/global-failglob/global-failglob-6.ebuild || exit 1
+EAPI="6"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+fail=( does/not/exist/* )
+END
+
+mkdir -p "cat/nonglobal-no-failglob" || exit 1
+cat << 'END' > cat/nonglobal-no-failglob/nonglobal-no-failglob-6.ebuild || exit 1
+EAPI="6"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+pkg_setup() {
+ fail=( does/not/exist/* )
+}
+END
+
cd ..
cd ..
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 51e2363..609225b 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -199,6 +199,7 @@ namespace
n::save_unmodifiable_variables() = check_get(k, "save_unmodifiable_variables"),
n::save_variables() = check_get(k, "save_variables"),
n::shell_options() = check_get(k, "shell_options"),
+ n::shell_options_global() = check_get(k, "shell_options_global"),
n::source_merged_variables() = check_get(k, "source_merged_variables"),
n::support_eclasses() = destringify_key<bool>(k, "support_eclasses"),
n::support_exlibs() = destringify_key<bool>(k, "support_exlibs"),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 73aefe7..dd31460 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -196,6 +196,7 @@ namespace paludis
typedef Name<struct name_save_variables> save_variables;
typedef Name<struct name_scm_revision> scm_revision;
typedef Name<struct name_shell_options> shell_options;
+ typedef Name<struct name_shell_options_global> shell_options_global;
typedef Name<struct name_short_description> short_description;
typedef Name<struct name_slot> slot;
typedef Name<struct name_source_merged_variables> source_merged_variables;
@@ -447,6 +448,7 @@ namespace paludis
NamedValue<n::save_unmodifiable_variables, std::string> save_unmodifiable_variables;
NamedValue<n::save_variables, std::string> save_variables;
NamedValue<n::shell_options, std::string> shell_options;
+ NamedValue<n::shell_options_global, std::string> shell_options_global;
NamedValue<n::source_merged_variables, std::string> source_merged_variables;
NamedValue<n::support_eclasses, bool> support_eclasses;
NamedValue<n::support_exlibs, bool> support_exlibs;
diff --git a/paludis/repositories/e/eapis/6.conf b/paludis/repositories/e/eapis/6.conf
index 9408cbb..f1ec505 100644
--- a/paludis/repositories/e/eapis/6.conf
+++ b/paludis/repositories/e/eapis/6.conf
@@ -9,3 +9,5 @@ is_pbin = false
ebuild_module_suffixes = 6 5 4 3 2 1 0
utility_path_suffixes = 6 5 4 3 2 1 0
+shell_options_global = failglob
+
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index dfb8a3d..593580e 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -280,6 +280,8 @@ EbuildCommand::operator() ()
.setenv("PALUDIS_PIPE_COMMAND_DELIM", "\2")
.setenv("PALUDIS_SHELL_OPTIONS",
params.package_id()->eapi()->supported()->ebuild_options()->shell_options())
+ .setenv("PALUDIS_SHELL_OPTIONS_GLOBAL",
+ params.package_id()->eapi()->supported()->ebuild_options()->shell_options_global())
.setenv("SLOT", "")
.setenv("PALUDIS_PROFILE_DIR", "")
.setenv("PALUDIS_PROFILE_DIRS", "")
diff --git a/paludis/repositories/e/ebuild/ebuild.bash b/paludis/repositories/e/ebuild/ebuild.bash
index b856bad..2aaded1 100755
--- a/paludis/repositories/e/ebuild/ebuild.bash
+++ b/paludis/repositories/e/ebuild/ebuild.bash
@@ -392,12 +392,17 @@ ebuild_load_ebuild()
eval paludis_saved_${paludis_v}='${!paludis_v}'
done
+ local paludis_shopts=$(shopt -p)
+ [[ -n ${PALUDIS_SHELL_OPTIONS_GLOBAL} ]] && shopt -s ${PALUDIS_SHELL_OPTIONS_GLOBAL}
+
if [[ ! -f ${1} ]]; then
[[ -r ${1} ]] || die "Ebuild '${1}' cannot be read"
die "Ebuild '${1}' is not a file"
fi
source ${1} || die "Error sourcing ebuild '${1}'"
+ eval "${paludis_shopts}"
+
# we may or may not use this later
PALUDIS_EBUILD_RDEPEND_WAS_SET=
PALUDIS_EBUILD_DEPEND="${DEPEND}"