aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Robbins <contact@andrewrobbins.info>2017-07-20 23:30:42 -0400
committerAndrew Robbins <contact@andrewrobbins.info>2017-07-21 02:10:50 -0400
commit38472cfdca9f6c61c84cbd84d5206e02716becfd (patch)
tree587ef44d5fb6b1f1564384f1d89117c078d86ec1
parent656823d295a2740118428490099a33e09f76fe68 (diff)
downloadlibrebootfr-38472cfdca9f6c61c84cbd84d5206e02716becfd.tar.gz
librebootfr-38472cfdca9f6c61c84cbd84d5206e02716becfd.zip
Create array PROJECT_ACTIONS_GENERIC_IGNORE_CHECK
Located in libs/project, this array's elements are compared with actions in PROJECTS_ACTIONS_GENERIC when libreboot_setup_project_actions() is called. This makes it simpler to add/remove actions which should/shouldn't have a corresponding check function in PROJECT_ACTIONS.
-rwxr-xr-xlibreboot4
-rwxr-xr-xlibs/project1
2 files changed, 4 insertions, 1 deletions
diff --git a/libreboot b/libreboot
index 94eba109..59795d09 100755
--- a/libreboot
+++ b/libreboot
@@ -172,12 +172,14 @@ libreboot_setup_tool_actions() {
libreboot_setup_project_actions() {
local -i project_actions_count="${#PROJECT_ACTIONS_GENERIC[@]}"
+ local ignore="${PROJECT_ACTIONS_GENERIC_IGNORE_CHECK[*]}"
+
local -a project_actions
for ((i=0; i<"${project_actions_count}"; i++)); do
project_actions+=("${PROJECT_ACTIONS_GENERIC[i]}")
- if [[ "${PROJECT_ACTIONS_GENERIC[i]}" == !(usage|clean) ]]; then
+ if [[ "${PROJECT_ACTIONS_GENERIC[i]}" == !(${ignore// /|}) ]]; then
project_actions+=("${PROJECT_ACTIONS_GENERIC[i]/%/_check}")
fi
done
diff --git a/libs/project b/libs/project
index 7729c485..8eaf0d2d 100755
--- a/libs/project
+++ b/libs/project
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
PROJECT_ACTIONS_GENERIC=(usage download extract update build install release clean)
+PROJECT_ACTIONS_GENERIC_IGNORE_CHECK=(usage clean)
PROJECT_ACTIONS_HELPERS=(arguments)
INSTALL_REGEX='\([^:]*\):\(.*\)'