dev-util/buildbot: Improve pkg_config in latest releases
authorBrian Dolbec <dolsen@gentoo.org>
Sat, 16 Sep 2017 15:23:15 +0000 (08:23 -0700)
committerBrian Dolbec <dolsen@gentoo.org>
Wed, 20 Sep 2017 20:02:42 +0000 (13:02 -0700)
Fix missed edit in previous commit.

Package-Manager: Portage-2.3.6, Repoman-2.3.3

dev-util/buildbot/buildbot-0.9.10.ebuild
dev-util/buildbot/buildbot-0.9.11.ebuild
dev-util/buildbot/buildbot-9999.ebuild

index 65f5d4a71384fdd5fc0683302439a173ce1b6be6..0f493ccb8ffcbdbebbbd2b5f531078e4453e27e0 100644 (file)
@@ -171,7 +171,7 @@ pkg_postinst() {
 
 pkg_config() {
        local buildmaster_path="/var/lib/buildmaster"
-       local log_path="/var/log/buildbot_worker"
+       local log_path="/var/log/buildmaster"
 
        einfo "This will prepare a new buildmaster instance in ${buildmaster_path}."
        einfo "Press Control-C to abort."
index dbb4358a8387fcc27ca08ce5d0884d4c5e100256..694b31c8f1160f9a10bcca1116ba847f007a2ffc 100644 (file)
@@ -162,6 +162,8 @@ pkg_postinst() {
 
 pkg_config() {
        local buildmaster_path="/var/lib/buildmaster"
+       local log_path="/var/log/buildmaster"
+
        einfo "This will prepare a new buildmaster instance in ${buildmaster_path}."
        einfo "Press Control-C to abort."
 
@@ -170,6 +172,8 @@ pkg_config() {
        [[ -z "${instance_name}" ]] && die "Invalid instance name"
 
        local instance_path="${buildmaster_path}/${instance_name}"
+       local instance_log_path="${log_path}/${instance_name}"
+
        if [[ -e "${instance_path}" ]]; then
                eerror "The instance with the specified name already exists:"
                eerror "${instance_path}"
@@ -187,6 +191,12 @@ pkg_config() {
        ln --symbolic --relative "/etc/init.d/buildmaster" "/etc/init.d/buildmaster.${instance_name}" \
                || die "Unable to create link to init file"
 
+       if [[ ! -d "${instance_log_path}" ]]; then
+               mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
+       fi
+       ln --symbolic --relative "${instance_log_path}/twistd.log" "${instance_path}/twistd.log" \
+               || die "Unable to create link to log file"
+
        einfo "Successfully created a buildmaster instance at ${instance_path}."
        einfo "To change the default settings edit the master.cfg file in this directory."
 }
index dbb4358a8387fcc27ca08ce5d0884d4c5e100256..694b31c8f1160f9a10bcca1116ba847f007a2ffc 100644 (file)
@@ -162,6 +162,8 @@ pkg_postinst() {
 
 pkg_config() {
        local buildmaster_path="/var/lib/buildmaster"
+       local log_path="/var/log/buildmaster"
+
        einfo "This will prepare a new buildmaster instance in ${buildmaster_path}."
        einfo "Press Control-C to abort."
 
@@ -170,6 +172,8 @@ pkg_config() {
        [[ -z "${instance_name}" ]] && die "Invalid instance name"
 
        local instance_path="${buildmaster_path}/${instance_name}"
+       local instance_log_path="${log_path}/${instance_name}"
+
        if [[ -e "${instance_path}" ]]; then
                eerror "The instance with the specified name already exists:"
                eerror "${instance_path}"
@@ -187,6 +191,12 @@ pkg_config() {
        ln --symbolic --relative "/etc/init.d/buildmaster" "/etc/init.d/buildmaster.${instance_name}" \
                || die "Unable to create link to init file"
 
+       if [[ ! -d "${instance_log_path}" ]]; then
+               mkdir --parents "${instance_log_path}" || die "Unable to create directory ${instance_log_path}"
+       fi
+       ln --symbolic --relative "${instance_log_path}/twistd.log" "${instance_path}/twistd.log" \
+               || die "Unable to create link to log file"
+
        einfo "Successfully created a buildmaster instance at ${instance_path}."
        einfo "To change the default settings edit the master.cfg file in this directory."
 }