aboutsummaryrefslogtreecommitdiff
path: root/libs
Commit message (Collapse)AuthorAgeFilesLines
* Remove overlooked braces from parameter expansionsAndrew Robbins2017-09-221-1/+1
| | | | | | | | | | This is a continuation of the last set of commits removing braces from parameter expressions which do not require them. The main script was overlooked when applying the previous changes, which this commit aims to correct. Also, one parameter expansion in libs/common was corrected as it was overlooked as well.
* Remove braces from parameter expansionsAndrew Robbins2017-09-211-8/+8
| | | | | | * libs/tool ditto
* Remove braces from parameter expansionsAndrew Robbins2017-09-211-59/+59
| | | | | | * libs/project ditto
* Remove braces from parameter expansionsAndrew Robbins2017-09-211-10/+10
| | | | | | * libs/git ditto
* Remove braces from parameter expansionsAndrew Robbins2017-09-211-57/+57
| | | | | | | * libs/common Makes it easier to read as well as cutting down on performance hits caused by the use of braces in parameter expansions.
* Conditionally use wget or curl in download_wrapperAndrew Robbins2017-09-201-1/+15
|
* Add support for curl in download_wrapper functionAndrew Robbins2017-09-201-2/+10
|
* Declare array wget_options with local scopeAndrew Robbins2017-09-201-1/+1
|
* Quote elements of array wget_optionsAndrew Robbins2017-09-201-5/+5
| | | | Necessary to satiate shellcheck.
* Add function 'tool_arguments_targets' to libs/toolAndrew Robbins2017-09-141-0/+19
| | | | | | | | | This is essentially the same function from libs/project with only the prefix changed from 'project_' to 'tool_' and minor formatting changes. The function had to be added in order to allow for arguments to tool scripts, which the dependencies script will require.
* Skip archive extraction if archive doesn't existAndrew Robbins2017-07-221-1/+1
|
* Remove unnecessary subshell groupingAndrew Robbins2017-07-221-5/+3
|
* Remove IFS binding masking a non-zero status codeAndrew Robbins2017-07-221-6/+3
| | | | | | | | | | | | | | In project_action_arguments_recursive(), IFS bindings needed to be reworked in order to avoid a situation where, for example, project_extract() would fail to extract source archives (because they didn't exist), returning a status code of 1 only for it to be masked by a rebinding of IFS--which would always succeed. ifs_save and IFS were made local variables in project_action_arguments_recursive() in order to avoid the need to rebind IFS after the for loop returns. This patch makes './libreboot sources <project>' functional.
* Create array PROJECT_ACTIONS_GENERIC_IGNORE_CHECKAndrew Robbins2017-07-211-0/+1
| | | | | | | 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.
* Create array TOOL_ACTIONS_GENERIC_IGNORE_CHECKAndrew Robbins2017-07-211-0/+1
| | | | | | | Located in libs/tool, this array's elements are compared with actions in TOOLS_ACTIONS_GENERIC when libreboot_setup_tool_actions() is called. This makes it simpler to add/remove actions which should/shouldn't have a corresponding check function in TOOL_ACTIONS.
* Add libreboot_setup_tool_actions()Andrew Robbins2017-07-211-5/+0
| | | | | | | | | The added function is a complement to libreboot_setup_project_actions() which moves generation of the TOOL_ACTIONS array out of libs/tool and into the main script for greater malleability. Notably, the proper elements are now included in the array.
* Rename TOOL_ACTIONS_FUNCTIONS to TOOL_ACTIONSAndrew Robbins2017-07-211-2/+2
| | | | | | Original naming did not have the '_FUNCTIONS' suffix, which made it more clear as to the variable's purpose. This change reverts a previous rename of mine made erroneously.
* Fix action 'update_check' erroring out erroneouslyAndrew Robbins2017-07-211-1/+1
|
* Add libreboot_setup_project_actions()Andrew Robbins2017-07-211-5/+0
| | | | | | | The added function is called after all files in libs/ have been sourced and provides the correct action sequence for 'test'. Importantly, this function avoids providing undefined 'usage_check' and 'clean_check' actions.
* Rename PROJECT_ACTIONS_FUNCTIONS to PROJECT_ACTIONSAndrew Robbins2017-07-201-2/+2
| | | | | | Original naming did not have the '_FUNCTIONS' suffix, which made it more clear as to the variable's purpose. This change reverts a previous rename of mine made erroneously.
* Move vars CONFIG_SHELL,EDITOR,TASKS to libs/commonAndrew Robbins2017-07-181-0/+4
|
* Change '.' to the more readable 'source' commandAndrew Robbins2017-07-171-2/+2
|
* Use "$*" instead of $@ when assigning as a stringAndrew Robbins2017-07-171-12/+12
| | | | | | The local variable 'arguments' always stores the positional parameters passed to it as a string, not an array of strings, so usage of "$*" makes more sense here instead of $@.
* Avoid checking previous exit codes indirectlyAndrew Robbins2017-07-171-7/+5
|
* Word-split PROJECTS_FORCE expansion (remove quotes)Andrew Robbins2017-07-171-1/+1
|
* Make explicit which directory 'find' should searchAndrew Robbins2017-07-171-2/+2
|
* Prevent 'read' from interpreting backslash escapesAndrew Robbins2017-07-171-11/+11
|
* Properly escape and quote regular expressionsAndrew Robbins2017-07-171-8/+8
|
* Rely less on word splitting by using arraysAndrew Robbins2017-07-142-10/+18
| | | | | | | Arrays are just a better idea for storing multiple strings than relying on word splitting. Consequently, several global variables in libs/* were switched to arrays and any references to said variables modified to expand to the arrays' elements.
* Enable 'extglob' and replace some brace expansionsAndrew Robbins2017-07-112-2/+2
| | | | | | | Replace brace expansions with extended globs in a couple of places where brace expansions were erroneously used in place of actual pattern matching. This avoids potential errors concerning nonexisting files when patching sources.
* Merge branch 'libs/project-cruft' of kragle/libreboot into masterLeah Rowe2017-07-101-25/+23
|\
| * Fix action text in './libreboot usage <project>'Andrew Robbins2017-07-091-25/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently the name used in a 'for /name/ ...' loop rebinds any local variables (with the same name) with whatever /name/ is bound to in a way that persists even after the loop returns. The crux of the issue here is that a function's children can rebind the parent(s)' local variables just by using the same name as the variable in a for loop, which is surprising--and apparently undocumented--behavior. Use of a subshell group for encapsulating the for loops (See: project_usage_actions) mitigates the aforementioned issue. Closes issue: #244
* | Suppress GNU tar's warning on filenames w/ nuls.Andrew Robbins2017-07-091-0/+2
|/
* Removed cruft & redundancy in project_action*()Andrew Robbins2017-07-071-114/+59
|
* Function call wget_wrapper wasn't renamed. Fixed.Andrew Robbins2017-06-281-1/+1
|
* Fixed bug in diff_patch_file() filename parsing.Andrew Robbins2017-06-281-3/+4
|
* Added functions for downloading/patching archivesAndrew Robbins2017-06-282-0/+78
| | | | i.e., source tarballs are (partially) supported
* Vars TAR_XZ,ASC,SHA256SUM renamed for generality.Andrew Robbins2017-06-253-13/+13
| | | | | Will help facilitate sane code when handling: archive formats, checksum file extensions, signature formats.
* Replaced '#!/bin/bash' w/ '#!/usr/bin/env bash'Andrew Robbins2017-06-234-4/+4
| | | | | This is mainly useful for being able to run these scripts on BSDs. And for users who use a Bash not installed to /bin.
* Remove unnecessary 'env' invocation from printf.Andrew Robbins2017-06-234-81/+81
| | | | | This reverts part of pull request #217 which called the 'env' binary for each printf invocation.
* Fixed printf calls & replaced 'echo' w/ printf.Andrew Robbins2017-06-234-81/+81
| | | | | | | | | All printf calls should now be properly formatted; prior, the format specifier string was erroneously used for both the format specifiers and the string to be printed. 'env' is now used to locate the printf binary so as to avoid potentially using a shell builtin. Lastly, all calls to 'echo' within the new build system have been replaced with printf for consistency/portability purposes.
* Improved handling of filenames in archive creationAndrew Robbins2017-06-222-93/+97
| | | | | | | | Filenames listed in DOTTARFILES are now NUL terminated so that any with strange characters, such as a newline, do not negatively affect archive creation. DOTRNDSEED file which stores the random seed to be used by GCC during compilation is now included in the list of files to be archived. Cleaned up functions related to archive creation.
* Added vars RANDOM_SEED, LIBFAKETIME_PATH + misc.Andrew Robbins2017-06-191-0/+1
| | | | | | | | All environment variables necessary for creating reproducible builds should now be present. If libfaketime is not linked then the only reproducibility-related variables SOURCE_DATE_EPOCH and RANDOM_SEED (gcc flag -frandom-seed) will be used. -frandom-seed will be added in a later commit.
* Patching now works. bucts can be patched & built.Andrew Robbins2017-05-313-22/+40
| | | | | | | | | Modified the function git_project_patch_recursive (in libs/git) to enable patching with diff files, which uses the new function diff_patch_file located in libs/common. A generic action script for bucts is in projects/bucts/. Install/revision/target files are in projects/bucts/configs/. bucts' merge into the new build system should be nearly, if not already, complete.
* Fixed project_check() and tool_check().Andrew Robbins2017-05-292-12/+6
|
* libs: tool: Add utility functions for filesPaul Kocialkowski2017-01-151-0/+82
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* libs: project: Only show file contents if the file existsPaul Kocialkowski2017-01-151-1/+4
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* libs: git: Check that blobs path is a valid filePaul Kocialkowski2017-01-151-1/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* libs: project: Return fully qualified blobs path when no path is foundPaul Kocialkowski2017-01-151-0/+2
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
* libs: project: Always create archive to allow forcePaul Kocialkowski2017-01-151-4/+1
| | | | Signed-off-by: Paul Kocialkowski <contact@paulk.fr>