Alexandros Kosiaris has submitted this change and it was merged.

Change subject: package_builder: use ${BUILDRESULT} only if it exists
......................................................................


package_builder: use ${BUILDRESULT} only if it exists

If ${BUILDRESULT} directory does not exist, bindmount will fail along
with the entire building process. Safeguard D05localsources as well
altough it should be strictly necessary

Change-Id: I0eb5d57f7b5d56a369818ac7455f2d0887517475
---
M modules/package_builder/templates/D05localsources.erb
M modules/package_builder/templates/pbuilderrc.erb
2 files changed, 2 insertions(+), 2 deletions(-)

Approvals:
  Alexandros Kosiaris: Verified; Looks good to me, approved



diff --git a/modules/package_builder/templates/D05localsources.erb 
b/modules/package_builder/templates/D05localsources.erb
index 5345891..a7147e0 100644
--- a/modules/package_builder/templates/D05localsources.erb
+++ b/modules/package_builder/templates/D05localsources.erb
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-if [ "${APT_USE_BUILT}" = "yes" ]; then
+if [ "${APT_USE_BUILT}" = "yes" -a -d ${BUILDRESULT} ]; then
     apt-get install -y apt-utils
 
     (cd $BUILDRESULT;
diff --git a/modules/package_builder/templates/pbuilderrc.erb 
b/modules/package_builder/templates/pbuilderrc.erb
index 80e1ca4..0177b03 100644
--- a/modules/package_builder/templates/pbuilderrc.erb
+++ b/modules/package_builder/templates/pbuilderrc.erb
@@ -20,7 +20,7 @@
 BASEPATH="<%= @basepath %>/base-${DIST}-${ARCH}.cow/"
 BUILDRESULT="<%= @basepath %>/result/${DIST}-${ARCH}"
 
-if [ "${APT_USE_BUILT}" = "yes" ]; then
+if [ "${APT_USE_BUILT}" = "yes" -a -d ${BUILDRESULT} ]; then
        export BUILDRESULT # .deb location needs to be passed to D05localsources
        BINDMOUNTS=${BUILDRESULT}
 fi

-- 
To view, visit https://gerrit.wikimedia.org/r/296937
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0eb5d57f7b5d56a369818ac7455f2d0887517475
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to