aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-07 20:40:11 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2009-05-11 14:58:00 +0100
commit753d5b7573190d742e64a2ac41531b900018db0f (patch)
tree3200b513f55b1bc63dbec8508c604d128b1f7609
parente33b42581b34c05351abf817d2b7c9cca3075865 (diff)
downloadpaludis-753d5b7573190d742e64a2ac41531b900018db0f.tar.gz
paludis-753d5b7573190d742e64a2ac41531b900018db0f.tar.xz
banned in EAPI 3
-rw-r--r--.gitignore2
-rw-r--r--paludis/repositories/e/e_repository_TEST.cc10
-rwxr-xr-xpaludis/repositories/e/e_repository_TEST_setup.sh17
-rw-r--r--paludis/repositories/e/ebuild/utils/3/Makefile.am13
-rw-r--r--paludis/repositories/e/ebuild/utils/3/banned_in_eapi_328
5 files changed, 67 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 3b0d4e8..03f0dbc 100644
--- a/.gitignore
+++ b/.gitignore
@@ -227,6 +227,8 @@ paludis-*.*.*.tar.bz2
/paludis/repositories/e/e_repository_TEST_replacing
/paludis/repositories/e/e_repository_sets_TEST
/paludis/repositories/e/ebuild_flat_metadata_cache_TEST
+/paludis/repositories/e/ebuild/utils/3/dohard
+/paludis/repositories/e/ebuild/utils/3/dosed
/paludis/repositories/e/ebuild/utils/exheres-0/dohard
/paludis/repositories/e/ebuild/utils/exheres-0/dohtml
/paludis/repositories/e/ebuild/utils/exheres-0/donewins
diff --git a/paludis/repositories/e/e_repository_TEST.cc b/paludis/repositories/e/e_repository_TEST.cc
index 6f531de..23b9dbb 100644
--- a/paludis/repositories/e/e_repository_TEST.cc
+++ b/paludis/repositories/e/e_repository_TEST.cc
@@ -1677,6 +1677,16 @@ namespace test_cases
TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
id->perform_action(action);
}
+
+ {
+ TestMessageSuffix suffix("banned functions 3", true);
+ const std::tr1::shared_ptr<const PackageID> id(*env[selection::RequireExactlyOne(generator::Matches(
+ PackageDepSpec(parse_user_package_dep_spec("=cat/banned-functions-3",
+ &env, UserPackageDepSpecOptions())), MatchPackageOptions()))]->last());
+ TEST_CHECK(id);
+ TEST_CHECK_EQUAL(simple_visitor_cast<const MetadataValueKey<std::string> >(**id->find_metadata("EAPI"))->value(), "3");
+ TEST_CHECK_THROWS(id->perform_action(action), InstallActionError);
+ }
}
} test_e_repository_install_eapi_3;
diff --git a/paludis/repositories/e/e_repository_TEST_setup.sh b/paludis/repositories/e/e_repository_TEST_setup.sh
index 1bcb3c5..213a96a 100755
--- a/paludis/repositories/e/e_repository_TEST_setup.sh
+++ b/paludis/repositories/e/e_repository_TEST_setup.sh
@@ -1358,12 +1358,27 @@ src_install() {
}
pkg_preinst() {
- find ${D} | xargs -n1 ls -ldh
[[ -f ${D}/foo/foo ]] || die foo
[[ -L ${D}/foo/bar ]] || die bar
[[ $(readlink ${D}/foo/bar ) == foo ]] || die sym
}
END
+mkdir -p "cat/banned-functions"
+cat <<END > cat/banned-functions/banned-functions-3.ebuild || exit 1
+DESCRIPTION="The Description"
+HOMEPAGE="http://example.com/"
+SRC_URI=""
+SLOT="0"
+IUSE="spork"
+LICENSE="GPL-2"
+KEYWORDS="test"
+EAPI="3"
+
+src_install() {
+ touch foo
+ dohard foo bar
+}
+END
cd ..
mkdir -p repo14/{profiles/profile,metadata,eclass} || exit 1
diff --git a/paludis/repositories/e/ebuild/utils/3/Makefile.am b/paludis/repositories/e/ebuild/utils/3/Makefile.am
index e77c545..6bbb79a 100644
--- a/paludis/repositories/e/ebuild/utils/3/Makefile.am
+++ b/paludis/repositories/e/ebuild/utils/3/Makefile.am
@@ -4,7 +4,10 @@ SUBDIRS = .
libexecprog3dir = $(libexecdir)/paludis/utils/3/
libexecprog3_SCRIPTS = \
- docompress
+ docompress \
+ dohard \
+ dosed \
+ banned_in_eapi_3
TESTS_ENVIRONMENT = env \
PALUDIS_EBUILD_DIR="`$(top_srcdir)/paludis/repositories/e/ebuild/utils/canonicalise \
@@ -22,7 +25,13 @@ TESTS_ENVIRONMENT = env \
TESTS =
EXTRA_DIST = $(TESTS)
-CLEANFILES = *~ *.epicfail
+bannedscripts = dohard dosed
+
+$(bannedscripts) : banned_in_eapi_3
+ cat $? > $@
+ chmod +x $@
+
+CLEANFILES = *~ $(bannedscripts) *.epicfail
built-sources : $(BUILT_SOURCES)
for s in `echo $(SUBDIRS) | tr -d .` ; do $(MAKE) -C $$s built-sources || exit 1 ; done
diff --git a/paludis/repositories/e/ebuild/utils/3/banned_in_eapi_3 b/paludis/repositories/e/ebuild/utils/3/banned_in_eapi_3
new file mode 100644
index 0000000..4d824ad
--- /dev/null
+++ b/paludis/repositories/e/ebuild/utils/3/banned_in_eapi_3
@@ -0,0 +1,28 @@
+#!/usr/bin/env bash
+# vim: set sw=4 sts=4 et :
+
+# Copyright (c) 2007, 2008, 2009 Ciaran McCreesh
+#
+# This file is part of the Paludis package manager. Paludis is free software;
+# you can redistribute it and/or modify it under the terms of the GNU General
+# Public License as published by the Free Software Foundation; either version
+# 2 of the License, or (at your option) any later version.
+#
+# Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+
+COLOUR_RED=$'\e[31;01m'
+COLOUR_NORMAL=$'\e[0m'
+
+echo "${COLOUR_RED}!!! Ebuild bug: '$(basename ${0} )' banned in EAPI 3${COLOUR_NORMAL}"
+echo "$(basename ${0} ): making ebuild PID ${EBUILD_KILL_PID} exit with error" 1>&2
+kill -s SIGUSR1 "${EBUILD_KILL_PID}"
+
+exit 123
+