aboutsummaryrefslogtreecommitdiff
path: root/paludis/repositories/e/e_repository_TEST_replacing_setup.sh
blob: c6d7e588a7709560ca14e77c6639c26d16b5fc25 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#!/usr/bin/env bash
# vim: set ft=sh sw=4 sts=4 et :

mkdir e_repository_TEST_replacing_dir || exit 1
cd e_repository_TEST_replacing_dir || exit 1

mkdir -p root/etc

mkdir -p build
ln -s build symlinked_build

mkdir -p distdir

mkdir -p repo1/{profiles/profile,metadata,eclass} || exit 1
cd repo1 || exit 1
echo "test-repo-1" >> profiles/repo_name || exit 1
echo "cat" >> metadata/categories.conf || exit 1
cat <<END > profiles/profile/make.defaults
CHOST="i286-badger-linux-gnu"
SUBOPTIONS="LINGUAS"
LINGUAS="en en_GB en_GB@UTF-8"
USERLAND="GNU"
OPTIONS="weasel spinach"
END
mkdir -p "packages/cat/replace-none"
cat <<'END' > packages/cat/replace-none/replace-none-1.exheres-0 || exit 1
WORK="${WORKBASE}"
PLATFORMS="test"
FOO=true
SLOT="0"

pkg_setup() {
    [[ -z "${REPLACING_IDS}" ]] || die "REPLACING_IDS is ${REPLACING_IDS}"
}
END
mkdir -p "packages/cat/replace-one"
cat <<'END' > packages/cat/replace-one/replace-one-1.exheres-0 || exit 1
WORK="${WORKBASE}"
PLATFORMS="test"
FOO=true
SLOT="0"

pkg_setup() {
    [[ "${REPLACING_IDS}" == "cat/pkg-1:1::installed" ]] || die "REPLACING_IDS is ${REPLACING_IDS}"
}
END
mkdir -p "packages/cat/replace-many"
cat <<'END' > packages/cat/replace-many/replace-many-1.exheres-0 || exit 1
WORK="${WORKBASE}"
PLATFORMS="test"
FOO=true
SLOT="0"

pkg_setup() {
    [[ "${REPLACING_IDS}" == \
        "cat/pkg-1:1::installed cat/pkg-2:2::installed cat/pkg-3:3::installed" ]] \
        || die "REPLACING_IDS is ${REPLACING_IDS}"
}
END
cd ..

mkdir -p repo2/{profiles/profile,metadata,eclass} || exit 1
cd repo2 || exit 1
echo "test-repo-1" >> profiles/repo_name || exit 1
echo "cat" >> metadata/categories.conf || exit 1
cat <<END > profiles/profile/make.defaults
CHOST="i286-badger-linux-gnu"
SUBOPTIONS="LINGUAS"
LINGUAS="en en_GB en_GB@UTF-8"
USERLAND="GNU"
OPTIONS="weasel spinach"
ARCH="dead-badger"
KERNEL="linux"
END
mkdir -p "packages/cat/replace-none"
cat <<'END' > packages/cat/replace-none/replace-none-1.ebuild || exit 1
S="${WORKDIR}"
KEYWORDS="test"
SLOT="0"
EAPI="4"

pkg_setup() {
    [[ -z "${REPLACING_VERSIONS}" ]] || die "REPLACING_VERSIONS is ${REPLACING_VERSIONS}"
}
END
mkdir -p "packages/cat/replace-one"
cat <<'END' > packages/cat/replace-one/replace-one-1.ebuild || exit 1
S="${WORKDIR}"
KEYWORDS="test"
SLOT="0"
EAPI="4"

pkg_setup() {
    [[ "${REPLACING_VERSIONS}" == "1" ]] || die "REPLACING_VERSIONS is ${REPLACING_VERSIONS}"
}
END
mkdir -p "packages/cat/replace-many"
cat <<'END' > packages/cat/replace-many/replace-many-1.ebuild || exit 1
S="${WORKDIR}"
KEYWORDS="test"
SLOT="0"
EAPI="4"

pkg_setup() {
    [[ "${REPLACING_VERSIONS}" == "1 2 3" ]] || die "REPLACING_VERSIONS is ${REPLACING_VERSIONS}"
}
END
cd ..
cd ..