mpbb-install-*: Fetch in separate command first

This makes it easier to identify fetch failures. Do not write to
failcache when fetching failed as this is likely a temporary problem.
This commit is contained in:
Rainer Müller
2018-04-04 18:05:57 +02:00
parent 190764eb33
commit 639def5ad9
2 changed files with 20 additions and 0 deletions
+10
View File
@@ -113,6 +113,16 @@ install-dependencies() {
echo "[OK]" >> "$log_status_dependencies"
dependencies_counter=$((dependencies_counter + 1))
else
# $deprequestedvariants isn't quoted on purpose
# shellcheck disable=SC2154,SC2086
if ! "${option_prefix}/bin/port" -d fetch "$depname" $deprequestedvariants; then
echo "Fetch of dependency '${depname}' with variants '${deprequestedvariants}' failed, aborting." >&2
echo "[FAIL] (fetch)" >> "$log_status_dependencies"
echo "Building '$port' ... [ERROR] (failed to fetch dependency '${depname}') maintainers: $(get-maintainers "$port" "${depname}")." >> "$log_subports_progress"
# Do not add to failcache. This could be a temporary problem that will
# be resolved once the file appears on mirrors.
return 1
fi
# $deprequestedvariants isn't quoted on purpose
# shellcheck disable=SC2154,SC2086
if ! "${option_prefix}/bin/port" -dn install --unrequested "$depname" $deprequestedvariants; then
+10
View File
@@ -50,6 +50,16 @@ install-port() {
time_start=$(date +%s)
# $option_prefix is set in mpbb
# shellcheck disable=SC2154
if ! "${option_prefix}/bin/port" -dk fetch "$@"; then
echo "Fetch of '$port' failed."
# log: summary for the portwatcher
echo "Fetching '$port' ... [ERROR] maintainers: $(get-maintainers "$port")." >> "$log_subports_progress"
# Do not add to failcache. This could be a temporary problem that will
# be resolved once the file appears on mirrors.
return 1
fi
# $option_prefix is set in mpbb
# shellcheck disable=SC2154
if "${option_prefix}/bin/port" -dkn install "$@"; then
# Remove failcache if it exists
failcache_success "$@"