1 |
commit: af7e5e8ac24a8c425a500b441474f86c0aebf148 |
2 |
Author: Michael Seifert <mseifert <AT> error-reports <DOT> org> |
3 |
AuthorDate: Tue Mar 22 18:33:20 2016 +0000 |
4 |
Commit: Patrice Clement <monsieurp <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Mar 30 12:03:40 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=af7e5e8a |
7 |
|
8 |
dev-util/buildbot: Added pkg_config. |
9 |
|
10 |
buildbot-0.8.12-r2 supports the use of emerge --config to create instances of |
11 |
buildmaster. |
12 |
|
13 |
Closes: https://github.com/gentoo/gentoo/pull/1027 |
14 |
|
15 |
Signed-off-by: Patrice Clement <monsieurp <AT> gentoo.org> |
16 |
|
17 |
dev-util/buildbot/buildbot-0.8.12-r2.ebuild | 32 +++++++++++++++++++++++++++++ |
18 |
1 file changed, 32 insertions(+) |
19 |
|
20 |
diff --git a/dev-util/buildbot/buildbot-0.8.12-r2.ebuild b/dev-util/buildbot/buildbot-0.8.12-r2.ebuild |
21 |
index f7304091..1df4422 100644 |
22 |
--- a/dev-util/buildbot/buildbot-0.8.12-r2.ebuild |
23 |
+++ b/dev-util/buildbot/buildbot-0.8.12-r2.ebuild |
24 |
@@ -101,3 +101,35 @@ pkg_postinst() { |
25 |
elog "your old config and the new code." |
26 |
fi |
27 |
} |
28 |
+ |
29 |
+pkg_config() { |
30 |
+ local buildmaster_path="/var/lib/buildmaster" |
31 |
+ einfo "This will prepare a new buildmaster instance in ${buildmaster_path}." |
32 |
+ einfo "Press Control-C to abort." |
33 |
+ |
34 |
+ einfo "Enter the name for the new instance: " |
35 |
+ read instance_name |
36 |
+ [[ -z "${instance_name}" ]] && die "Invalid instance name" |
37 |
+ |
38 |
+ local instance_path="${buildmaster_path}/${instance_name}" |
39 |
+ if [[ -e "${instance_path}" ]]; then |
40 |
+ eerror "The instance with the specified name already exists:" |
41 |
+ eerror "${instance_path}" |
42 |
+ die "Instance already exists" |
43 |
+ fi |
44 |
+ |
45 |
+ local buildbot="/usr/bin/buildbot" |
46 |
+ if [[ ! -d "${buildmaster_path}" ]]; then |
47 |
+ mkdir --parents "${buildmaster_path}" || die "Unable to create directory ${buildmaster_path}" |
48 |
+ fi |
49 |
+ "${buildbot}" create-master "${instance_path}" &>/dev/null || die "Creating instance failed" |
50 |
+ chown --recursive buildbot "${instance_path}" || die "Setting permissions for instance failed" |
51 |
+ mv "${instance_path}/master.cfg.sample" "${instance_path}/master.cfg" \ |
52 |
+ || die "Moving sample configuration failed" |
53 |
+ ln --symbolic --relative "/etc/init.d/buildmaster" "/etc/init.d/buildmaster.${instance_name}" \ |
54 |
+ || die "Unable to create link to init file" |
55 |
+ |
56 |
+ einfo "Successfully created a buildmaster instance at ${instance_path}." |
57 |
+ einfo "To change the default settings edit the master.cfg file in this directory." |
58 |
+} |
59 |
+ |