aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/exndbam_repository_TEST_setup.sh
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-08-05 21:39:12 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-08-06 20:04:09 +0100
commit608c7abbd898be86371153195c883693cd7489d7 (patch)
treee1ab08a3adb02b726d1b9920d648a3ccd601002c /paludis/repositories/e/exndbam_repository_TEST_setup.sh
parent9df9c709cca58917d2f32a1214b41d604ed81e25 (diff)
downloadpaludis-608c7abbd898be86371153195c883693cd7489d7.tar.gz
paludis-608c7abbd898be86371153195c883693cd7489d7.tar.xz
Support EAPI-dependent pkg_postinst phase ordering for up/downgrades.
This is currently determined by the EAPI of the version being installed, not the one being removed. The implementation is rather hackish; the new resolver will let us do better.
Diffstat (limited to 'paludis/repositories/e/exndbam_repository_TEST_setup.sh')
-rwxr-xr-xpaludis/repositories/e/exndbam_repository_TEST_setup.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/paludis/repositories/e/exndbam_repository_TEST_setup.sh b/paludis/repositories/e/exndbam_repository_TEST_setup.sh
index e3442ce08..4ce00c83f 100755
--- a/paludis/repositories/e/exndbam_repository_TEST_setup.sh
+++ b/paludis/repositories/e/exndbam_repository_TEST_setup.sh
@@ -4,5 +4,61 @@
mkdir -p exndbam_repository_TEST_dir || exit 1
cd exndbam_repository_TEST_dir || exit 1
+mkdir -p distdir
+mkdir -p build
+mkdir -p root/etc
+
mkdir -p repo1/ || exit 1
+mkdir -p postinsttest postinsttest_src1/{eclass,profiles/profile,cat/pkg} || exit 1
+
+cat <<END > postinsttest_src1/profiles/profile/make.defaults
+ARCH=test
+USERLAND="GNU"
+KERNEL="linux"
+CHOST="i286-badger-linux-gnu"
+END
+echo postinsttest >postinsttest_src1/profiles/repo_name
+echo cat >postinsttest_src1/profiles/categories
+
+cat <<END >postinsttest_src1/cat/pkg/pkg-0.ebuild
+if [[ \${PV} == 0* ]]; then
+ EAPI=1
+else
+ EAPI=paludis-1
+fi
+KEYWORDS="test"
+if [[ \${PV} == 2* ]]; then
+ SLOT="2"
+else
+ SLOT="1"
+fi
+pkg_preinst() {
+ OTHER=\$(best_version "\${CATEGORY}/\${PN}:\${SLOT}")
+ if [[ -n \${OTHER} ]]; then
+ if [[ \${EAPI} == paludis-1 ]] || has_version "=\${CATEGORY}/\${PF}:\${SLOT}"; then
+ COMMAND=rmdir
+ else
+ COMMAND=mkdir
+ fi
+ else
+ COMMAND=:
+ fi
+}
+pkg_postinst() {
+ \${COMMAND} "\${ROOT}"/\${OTHER##*/} || die
+}
+pkg_postrm() {
+ if has_version "=\${CATEGORY}/\${PN}-0*:\${SLOT}" &&
+ ( has_version "<\${CATEGORY}/\${PF}:\${SLOT}" || has_version ">\${CATEGORY}/\${PF}:\${SLOT}" ); then
+ rmdir "\${ROOT}"/\${PF} || die
+ else
+ mkdir "\${ROOT}"/\${PF} || die
+ fi
+}
+END
+cp postinsttest_src1/cat/pkg/pkg-{0,0.1}.ebuild
+cp postinsttest_src1/cat/pkg/pkg-{0,1}.ebuild
+cp postinsttest_src1/cat/pkg/pkg-{0,1.1}.ebuild
+cp postinsttest_src1/cat/pkg/pkg-{0,2}.ebuild
+