mp-buildbot: cleanup after gather-archives not install-port

git-svn-id: https://svn.macports.org/repository/macports/contrib/mp-buildbot@150702 d073be05-634f-4543-b044-5fe20cf6d1d6
This commit is contained in:
Ryan Schmidt
2016-07-27 05:48:49 +00:00
parent ad2fb66cd0
commit 0159ae18c5
3 changed files with 12 additions and 8 deletions
+1 -1
View File
@@ -6,7 +6,7 @@
cleanup-help() {
echo "Clean up build remnants and leftovers caused by the build of port --port."
echo "Note that you should not have to run this explicitly, as it is automatically run after install-dependencies on error and in any case after install-port."
echo "Note that you should not have to run this explicitly, as it is automatically run after install-dependencies and install-port on error and in any case after gather-archives."
}
cleanup() {
+6 -2
View File
@@ -14,6 +14,7 @@ gather-archives() {
tclsh=${option_prefix}/bin/port-tclsh
mkdir -p "${option_staging_dir}" || return $?
status=0
for archive_path in $("${option_prefix}/bin/port" -q location active); do
archive_port=$(basename "$(dirname "${archive_path}")")
archive_basename=$(basename "${archive_path}")
@@ -21,9 +22,12 @@ gather-archives() {
if ! ${curl} -fIsL "${option_archive_site}/${archive_port}/${archive_basename}" > /dev/null; then
if "${tclsh}" "${option_workdir}/tools/port_binary_distributable.tcl" -v "${archive_port}"; then
echo "Staging archive for upload: ${archive_basename}"
mkdir -p "${option_staging_dir}/${archive_port}" || return $?
cp -p "${archive_path}" "${option_staging_dir}/${archive_port}/${archive_basename}" || return $?
mkdir -p "${option_staging_dir}/${archive_port}" || { status=$?; break; }
cp -p "${archive_path}" "${option_staging_dir}/${archive_port}/${archive_basename}" || { status=$?; break; }
fi
fi
done
cleanup
return $status
}
+5 -5
View File
@@ -15,9 +15,9 @@ install-port() {
return 1
fi
status=0
"${option_prefix}/bin/port" -d install "${option_port}" || status=$?
cleanup
return $status
if ! "${option_prefix}/bin/port" -d install "${option_port}"; then
echo "Build failed, cleaning up..."
cleanup
return 1
fi
}