aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2015-10-31 17:03:53 +0000
committerAvatar David Leverton <levertond@googlemail.com> 2015-11-05 17:37:27 +0000
commit2417d6394385efdc6ad80e310c81f05e9c8c0e6f (patch)
treea9f16de4b0035a2a9ea0602737ddf98665d42713
parent5d4398de107163d2c1b826d898a7051e6dfe1b6a (diff)
downloadpaludis-2417d6394385efdc6ad80e310c81f05e9c8c0e6f.tar.gz
paludis-2417d6394385efdc6ad80e310c81f05e9c8c0e6f.tar.xz
EAPI 6 unpack is case-insensitive
-rw-r--r--paludis/repositories/e/e_repository_TEST_5.cc9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_5_setup.sh22
-rw-r--r--paludis/repositories/e/e_repository_TEST_6.cc9
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_6_setup.sh23
-rw-r--r--paludis/repositories/e/eapi.cc1
-rw-r--r--paludis/repositories/e/eapi.hh2
-rw-r--r--paludis/repositories/e/eapis/0.conf1
-rw-r--r--paludis/repositories/e/eapis/6.conf1
-rw-r--r--paludis/repositories/e/eapis/exheres-0.conf1
-rw-r--r--paludis/repositories/e/eapis/paludis-1.conf1
-rw-r--r--paludis/repositories/e/ebuild.cc2
-rwxr-xr-xpaludis/repositories/e/ebuild/utils/unpack22
-rw-r--r--paludis/syncers/dotar.in1
13 files changed, 87 insertions, 8 deletions
diff --git a/paludis/repositories/e/e_repository_TEST_5.cc b/paludis/repositories/e/e_repository_TEST_5.cc
index db96e03..1c471e2 100644
--- a/paludis/repositories/e/e_repository_TEST_5.cc
+++ b/paludis/repositories/e/e_repository_TEST_5.cc
@@ -258,6 +258,15 @@ TEST(ERepository, InstallEAPI5)
EXPECT_EQ("5", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
EXPECT_THROW(id->perform_action(action), ActionFailedError);
}
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/unpack-case-sensitive-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 debc4d8..6c5d5ea 100755
--- a/paludis/repositories/e/e_repository_TEST_5_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_5_setup.sh
@@ -455,6 +455,28 @@ src_unpack() {
}
END
+mkdir -p "cat/unpack-case-sensitive" || exit 1
+cat << 'END' > cat/unpack-case-sensitive/unpack-case-sensitive-5.ebuild || exit 1
+EAPI="5"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+S=${WORKDIR}
+
+src_unpack() {
+ echo test5 >test5
+ tar czf test5.TAR.z test5 || die
+ rm test5
+ unpack ./test5.TAR.z
+ [[ -e test5 ]] && die
+}
+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 6c38703..1a80e6e 100644
--- a/paludis/repositories/e/e_repository_TEST_6.cc
+++ b/paludis/repositories/e/e_repository_TEST_6.cc
@@ -185,5 +185,14 @@ TEST(ERepository, InstallEAPI6)
EXPECT_EQ("6", visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->parse_value());
id->perform_action(action);
}
+
+ {
+ const std::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/unpack-case-insensitive-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 8b61d87..36c0231 100755
--- a/paludis/repositories/e/e_repository_TEST_6_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_6_setup.sh
@@ -144,5 +144,28 @@ src_unpack() {
}
END
+mkdir -p "cat/unpack-case-insensitive" || exit 1
+cat << 'END' > cat/unpack-case-insensitive/unpack-case-insensitive-6.ebuild || exit 1
+EAPI="6"
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE=""
+LICENSE="GPL-2"
+KEYWORDS="test"
+
+S=${WORKDIR}
+
+src_unpack() {
+ echo test5 >test5
+ tar czf test5.TAR.z test5 || die
+ rm test5
+ [[ -e test5 ]] && die
+ unpack ./test5.TAR.z
+ [[ $(< test5) == test5 ]] || die
+}
+END
+
cd ..
cd ..
diff --git a/paludis/repositories/e/eapi.cc b/paludis/repositories/e/eapi.cc
index 2571fba..ef14b30 100644
--- a/paludis/repositories/e/eapi.cc
+++ b/paludis/repositories/e/eapi.cc
@@ -255,6 +255,7 @@ namespace
n::failure_is_fatal() = destringify_key<bool>(k, "failure_is_fatal"),
n::new_stdin() = destringify_key<bool>(k, "new_stdin"),
n::unpack_any_path() = destringify_key<bool>(k, "unpack_any_path"),
+ n::unpack_case_insensitive() = destringify_key<bool>(k, "unpack_case_insensitive"),
n::unpack_fix_permissions() = destringify_key<bool>(k, "unpack_fix_permissions"),
n::unpack_suffixes() = k.get("unpack_suffixes"),
n::unpack_unrecognised_is_fatal() = destringify_key<bool>(k, "unpack_unrecognised_is_fatal"),
diff --git a/paludis/repositories/e/eapi.hh b/paludis/repositories/e/eapi.hh
index 9b666d1..6b06390 100644
--- a/paludis/repositories/e/eapi.hh
+++ b/paludis/repositories/e/eapi.hh
@@ -208,6 +208,7 @@ namespace paludis
typedef Name<struct name_system_implicit> system_implicit;
typedef Name<struct name_tools_options> tools_options;
typedef Name<struct name_unpack_any_path> unpack_any_path;
+ typedef Name<struct name_unpack_case_insensitive> unpack_case_insensitive;
typedef Name<struct name_unpack_fix_permissions> unpack_fix_permissions;
typedef Name<struct name_unpack_suffixes> unpack_suffixes;
typedef Name<struct name_unpack_unrecognised_is_fatal> unpack_unrecognised_is_fatal;
@@ -492,6 +493,7 @@ namespace paludis
NamedValue<n::failure_is_fatal, bool> failure_is_fatal;
NamedValue<n::new_stdin, bool> new_stdin;
NamedValue<n::unpack_any_path, bool> unpack_any_path;
+ NamedValue<n::unpack_case_insensitive, bool> unpack_case_insensitive;
NamedValue<n::unpack_fix_permissions, bool> unpack_fix_permissions;
NamedValue<n::unpack_suffixes, std::string> unpack_suffixes;
NamedValue<n::unpack_unrecognised_is_fatal, bool> unpack_unrecognised_is_fatal;
diff --git a/paludis/repositories/e/eapis/0.conf b/paludis/repositories/e/eapis/0.conf
index 7194d31..c025d4f 100644
--- a/paludis/repositories/e/eapis/0.conf
+++ b/paludis/repositories/e/eapis/0.conf
@@ -273,6 +273,7 @@ use_stable_mask_force = false
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = true
unpack_any_path = false
+unpack_case_insensitive = false
doman_lang_filenames = false
doman_lang_filenames_overrides = false
dodoc_r = false
diff --git a/paludis/repositories/e/eapis/6.conf b/paludis/repositories/e/eapis/6.conf
index 2249ec1..30e2c16 100644
--- a/paludis/repositories/e/eapis/6.conf
+++ b/paludis/repositories/e/eapis/6.conf
@@ -12,5 +12,6 @@ utility_path_suffixes = 6 5 4 3 2 1 0
shell_options_global = failglob
unpack_any_path = true
+unpack_case_insensitive = true
unpack_suffixes = ${unpack_suffixes} tar.xz,txz
diff --git a/paludis/repositories/e/eapis/exheres-0.conf b/paludis/repositories/e/eapis/exheres-0.conf
index 5073579..2aa8c93 100644
--- a/paludis/repositories/e/eapis/exheres-0.conf
+++ b/paludis/repositories/e/eapis/exheres-0.conf
@@ -350,6 +350,7 @@ use_stable_mask_force = false
unpack_unrecognised_is_fatal = true
unpack_fix_permissions = false
unpack_any_path = false
+unpack_case_insensitive = false
doman_lang_filenames = true
doman_lang_filenames_overrides = false
dodoc_r = true
diff --git a/paludis/repositories/e/eapis/paludis-1.conf b/paludis/repositories/e/eapis/paludis-1.conf
index 862fa8a..4ebe6a9 100644
--- a/paludis/repositories/e/eapis/paludis-1.conf
+++ b/paludis/repositories/e/eapis/paludis-1.conf
@@ -272,6 +272,7 @@ use_stable_mask_force = false
unpack_unrecognised_is_fatal = false
unpack_fix_permissions = false
unpack_any_path = false
+unpack_case_insensitive = false
doman_lang_filenames = true
doman_lang_filenames_overrides = false
dodoc_r = false
diff --git a/paludis/repositories/e/ebuild.cc b/paludis/repositories/e/ebuild.cc
index 0c2d775..f732ff9 100644
--- a/paludis/repositories/e/ebuild.cc
+++ b/paludis/repositories/e/ebuild.cc
@@ -245,6 +245,8 @@ EbuildCommand::operator() ()
params.package_id()->eapi()->supported()->tools_options()->unpack_fix_permissions() ? "yes" : "")
.setenv("PALUDIS_UNPACK_ANY_PATH",
params.package_id()->eapi()->supported()->tools_options()->unpack_any_path() ? "yes" : "")
+ .setenv("PALUDIS_UNPACK_CASE_INSENSITIVE",
+ params.package_id()->eapi()->supported()->tools_options()->unpack_case_insensitive() ? "yes" : "")
.setenv("PALUDIS_UNPACK_SUFFIXES",
params.package_id()->eapi()->supported()->tools_options()->unpack_suffixes())
.setenv("PALUDIS_BEST_HAS_VERSION_HOST_ROOT",
diff --git a/paludis/repositories/e/ebuild/utils/unpack b/paludis/repositories/e/ebuild/utils/unpack
index 3025685..5f154cb 100755
--- a/paludis/repositories/e/ebuild/utils/unpack
+++ b/paludis/repositories/e/ebuild/utils/unpack
@@ -111,16 +111,20 @@ unpack_xz() {
unpack_one()
{
- [[ -z ${1} ]] && die "Bad argument for unpack_one"
- [[ -e ${1} ]] || die "${1} doesn't exist"
+ local file=${1} compare=${1}
+ [[ -n ${PALUDIS_UNPACK_CASE_INSENSITIVE} ]] &&
+ compare=$(tr '[:upper:]' '[:lower:]' <<<"${compare}")
+
+ [[ -z ${file} ]] && die "Bad argument for unpack_one"
+ [[ -e ${file} ]] || die "${file} doesn't exist"
if [[ -n "${UNPACKONLY}" ]] ; then
- case ${1} in
+ case ${compare} in
*.tar.bz2|*.tbz2|*.tbz)
;;
*)
- die "Can't use --only with ${x}"
+ die "Can't use --only with ${file}"
;;
esac
fi
@@ -129,17 +133,19 @@ unpack_one()
for group in ${PALUDIS_UNPACK_SUFFIXES}; do
split=( $(IFS=,; echo ${group} ) )
for suffix in ${split[@]}; do
- if [[ ${1} == *.${suffix} ]]; then
- unpack_${split[0]} "${1}" || die "Couldn't unpack ${1}"
+ [[ -n ${PALUDIS_UNPACK_CASE_INSENSITIVE} ]] &&
+ suffix=$(tr '[:upper:]' '[:lower:]' <<<"${suffix}")
+ if [[ ${compare} == *.${suffix} ]]; then
+ unpack_${split[0]} "${file}" || die "Couldn't unpack ${file}"
return
fi
done
done
if [[ -n "${PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL}" ]] ; then
- die "Don't know how to unpack ${x}"
+ die "Don't know how to unpack ${file}"
else
- echo "Skipping unpack for ${1}"
+ echo "Skipping unpack for ${file}"
fi
}
diff --git a/paludis/syncers/dotar.in b/paludis/syncers/dotar.in
index b3cffdd..30f20bd 100644
--- a/paludis/syncers/dotar.in
+++ b/paludis/syncers/dotar.in
@@ -179,6 +179,7 @@ export PALUDIS_UNPACK_SUFFIXES="tar tar.gz,tgz,tar.Z tar.bz2,tbz2,tbz zip,ZIP,ja
export PALUDIS_UNPACK_UNRECOGNISED_IS_FATAL=yes
export PALUDIS_UNPACK_FIX_PERMISSIONS=
export PALUDIS_UNPACK_ANY_PATH=yes
+export PALUDIS_UNPACK_CASE_INSENSITIVE=yes
export PATH="${PALUDIS_EBUILD_DIR}/utils:${PATH}"
( cd "${UNPACKDIR}" && unpack "${UNPACK_OPTIONS[@]}" "${TEMP}/${TARFILE}" ) || cleanup_and_exit $?