aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xlibreboot13
-rwxr-xr-xlibs/project19
2 files changed, 14 insertions, 18 deletions
diff --git a/libreboot b/libreboot
index 59795d09..af4c1f49 100755
--- a/libreboot
+++ b/libreboot
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# Copyright (C) 2016 Paul Kocialkowski <contact@paulk.fr>
+# Copyright (C) 2017 Andrew Robbins <contact@andrewrobbins.info>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -78,12 +79,12 @@ libreboot_project() {
case "${action}" in
'sources')
- (
- set +e
-
- project_action_arguments 'extract' "${project}" "$@" && return 0
- project_action_arguments 'download' "${project}" "$@" && return 0
- )
+ if project_action_arguments 'extract' "${project}" "$@"; then
+ return
+ else
+ printf '\n%s\n\n' 'Attempting to download instead...'
+ project_action_arguments 'download' "${project}" "$@"
+ fi
;;
'produce')
for action in 'build' 'install' 'release'; do
diff --git a/libs/project b/libs/project
index 8eaf0d2d..ab56feba 100755
--- a/libs/project
+++ b/libs/project
@@ -187,28 +187,23 @@ project_action_arguments_recursive() {
local action_helper_arguments
local argument
- local ifs_save
action_helper_arguments="$(project_action_helper 'arguments' "${project}" "$@" || true)"
if [[ -z "${action_helper_arguments}" ]]; then
project_action "${action}" "${project}" "$@"
else
- # This it to allow space characters in arguments.
- ifs_save="${IFS}"
- IFS=$'\n'
+ # This is to allow space characters in arguments.
+ local ifs_save="${IFS}"
+ local IFS=$'\n'
for argument in $(printf '%s\n' "${action_helper_arguments}")
do
- (
- IFS="${ifs_save}"
+ IFS="${ifs_save}"
- # Only a single argument at a time is returned by the helper.
- project_action_arguments_recursive "${action}" "${project}" "$@" "${argument}"
- )
+ # Only a single argument at a time is returned by the helper.
+ project_action_arguments_recursive "${action}" "${project}" "$@" "${argument}"
done
-
- IFS="${ifs_save}"
fi
}
@@ -685,7 +680,7 @@ project_extract() {
if ! project_sources_directory_filled_check "$project" "$repository" "$@"
then
- project_sources_archive_missing_error "$project" "$@"
+ project_sources_archive_missing_error "$project" "$@" || return 1
project_sources_archive_extract "$project" "$@"
fi
}