aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2009-02-24 13:17:15 +0100
committerAvatar Bo ├śrsted Andresen <bo.andresen@zlin.dk> 2009-02-24 14:23:27 +0100
commit90fd50c8a0633a6a439e3cbd4ee19bbdbfd4d640 (patch)
treef90023d6a295b5c75dbcdaaf51091ac716955f3c
parent7fde3c02941822cdfb7e160cb244a76966ac752a (diff)
downloadpaludis-90fd50c8a0633a6a439e3cbd4ee19bbdbfd4d640.tar.gz
paludis-90fd50c8a0633a6a439e3cbd4ee19bbdbfd4d640.tar.xz
Don't let expatch get into an endless loop when --recognised-suffixes is enabled and it comes across a file with an unrecognised suffix.
More expatch tests.
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc18
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh62
-rw-r--r--paludis/repositories/e/ebuild/exheres-0/build_functions.bash1
3 files changed, 81 insertions, 0 deletions
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 4021075..2772a9d 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1836,6 +1836,15 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("expatch success-dir", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/expatch-success-dir",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("expatch die", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/expatch-die",
@@ -1845,6 +1854,15 @@ namespace test_cases
}
{
+ TestMessageSuffix suffix("expatch unrecognised", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("cat/expatch-unrecognised",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ id->perform_action(action);
+ }
+
+ {
TestMessageSuffix suffix("nonfatal expatch fail", true);
const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
PackageDepSpec(parse_user_package_dep_spec("cat/nonfatal-expatch-fail",
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 12e4292..8f60fc1 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1279,10 +1279,42 @@ WORK="${WORKBASE}"
src_unpack() {
echo foo > bar
+ echo -e 'foo\nbar\nbaz' > baz
}
src_prepare() {
expatch "${FETCHEDDIR}"/${PNV}.patch
+ diff bar baz || die "expatch failed"
+}
+END
+mkdir -p "packages/cat/expatch-success-dir/files/expatch-success-dir"
+cat <<END > packages/cat/expatch-success-dir/files/expatch-success-dir/foo.patch || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+cat <<'END' > packages/cat/expatch-success-dir/expatch-success-dir-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo foo > bar
+ echo -e 'foo\nbar\nbaz' > baz
+}
+
+src_prepare() {
+ expatch "${FILES}"/${PN}/
+ diff bar baz || die "expatch failed"
}
END
mkdir -p "packages/cat/expatch-die"
@@ -1301,6 +1333,36 @@ src_prepare() {
expatch monkey.patch
}
END
+mkdir -p "packages/cat/expatch-unrecognised/files/expatch-unrecognised"
+cat <<END > packages/cat/expatch-unrecognised/files/expatch-unrecognised/foo || exit 1
+--- a/bar
++++ b/bar
+@@ -1 +1,3 @@
+ foo
++bar
++baz
+END
+cat <<'END' > packages/cat/expatch-unrecognised/expatch-unrecognised-1.ebuild || exit 1
+DESCRIPTION="The Long Description"
+SUMMARY="The Short Description"
+HOMEPAGE="http://example.com/"
+DOWNLOADS=""
+SLOT="0"
+MYOPTIONS="spork"
+LICENCES="GPL-2"
+PLATFORMS="test"
+WORK="${WORKBASE}"
+
+src_unpack() {
+ echo foo > bar
+ echo foo > baz
+}
+
+src_prepare() {
+ expatch "${FILES}"/${PN}/
+ diff bar baz || die "expatch applied unrecognised patch"
+}
+END
mkdir -p "packages/cat/nonfatal-expatch-fail"
cat <<'END' > packages/cat/nonfatal-expatch-fail/nonfatal-expatch-fail-1.ebuild || exit 1
DESCRIPTION="The Long Description"
diff --git a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
index f422257..c1ef91c 100644
--- a/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
+++ b/paludis/repositories/e/ebuild/exheres-0/build_functions.bash
@@ -73,6 +73,7 @@ expatch()
;;
*)
if [[ -n ${recognise} ]]; then
+ shift
continue
else
cmd="cat"