aboutsummaryrefslogtreecommitdiff
path: root/include/utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Move mkdirs() into utils modulemove-mkdirsJoseph Hunkeler2024-08-131-0/+8
|
* Pass .ci_support/plat_arch_.yaml to conda-build (#8)Joseph Hunkeler2024-06-241-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Pass .ci_support/plat_arch_.yaml to conda-build * Fixes a few outstanding leaks in delivery context * Move micromamba function out of stasis_indexer.c * Adjust code in the indexer to accommodate the move. The function now expects a MicromambaInfo structure as its first argument. * Add missing warning message * User is informed when pandoc is not available for HTML page generation * Initialize workdir_template string to zero * Add micromamba program to runtime PATH * Expose storage.tools_dir to template engine * Remove dead code * Fix wording in comment * Fix conda-forge builds * Pass their .ci_support configurations to conda-build in order to fully set up their build runtime environment * Add get_cpu_count() * Exposes STASIS_CPU_COUNT and CPU_COUNT to the runtime environment * Implements conda reactivation template string * {{ workaround.conda_reactivate }} * This is useful to call after installing any conda packages within a test.script * Fix conda runtime inside of test.script * This ensures conda and mamba are fully initialized. * Previous behavior only placed the commands on the PATH but didn't provide any shell macros (i.e. undefined behavior) * Document CPU_COUNT and workaround.conda_reactivate
* Rebrand OhMyCal (OMC) as STASIS (#7)Joseph Hunkeler2024-06-211-29/+29
|
* Unit tests (#6)Joseph Hunkeler2024-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Initial commit of unit tests [WIP] * Address shortcomings and bugs flushed out by unit tests * Enable unit testing in CI workflow * Enable verbose ctests * Handle lack of __FILE_NAME__ define * Only podman support `run --arch` argument * Skip docker build testing if CI system cannot pull an image * Remove errant call to puts() * Identify local repo user * Fix missing xmllint * NULL terminate arrays * Fix filename assignment in is_url mode * Break loop when expected lines are exhausted * strcmp_array expects NULL terminated array. Iterating by size in this case passes NULL to strcmp leading to an invalid read * Remove debug printf statements * Disable a few warnings for tests * Workaround for ctest junit xml truncation * Update checkout@v4 * Prevent false-positive result * Return zero on error * Fix strlist_remove function * Value argument can be constant * Fix test to match changes to startswith and endswith * Add test_ini.c * Fix redaction code to accept NULL pointers in array * And let the caller specify the length of the array of strings to redact. * Redactions now occur directly on authentication strings rather than their command line arguments * Fix BUILD_TESTING_DEBUG * Adds missing -D argument
* Consolidate OMC_COLOR_ definesJoseph Hunkeler2024-05-211-0/+40
|
* Move listdir to utils.c and export prototypeJoseph Hunkeler2024-05-021-0/+3
|
* Move artifactory authentication redaction code into its own function: ↵Joseph Hunkeler2024-04-151-0/+43
| | | | redact_sensitive()
* Move collapse_whitespace to utils.c / utils.hJoseph Hunkeler2024-03-221-0/+2
|
* Add fix_tox_conf functionJoseph Hunkeler2024-03-141-0/+9
| | | | * If the user calls tox in a test script like so: tox {{ workaround.tox_posargs }}, then a temporary tox configuration will be generated and the appropriate arguments to use it will be injected into tox's command line arguments
* Pretty-print pytest xml results (if xmllint is present)Joseph Hunkeler2024-03-141-0/+11
| | | | | | | * Adds Delivery.storage.results_dir member * Exposes storage.results_dir to templates * This is to make the test results human-readable * xmllint is optional. If it isn't installed it isn't a big deal.
* Prototypes documentationJoseph Hunkeler2024-03-041-1/+171
| | | | | | | Includes minor changes: * Rename jfrt_upload_set_defaults to jfrt_upload_init * Move jfrt_auth_init to artifactory.c * Adds missing error handling to git_describe and git_rev_parse
* xmkstemp allow setting file modeJoseph Hunkeler2024-03-041-1/+16
| | | | * add usage comment function
* Extract git repository informationJoseph Hunkeler2024-02-181-0/+1
| | | | * First pass; this will eventually be used to rewite exact commit refs in YAML delivery files
* Add path_store functionJoseph Hunkeler2024-02-121-0/+1
|
* First pass at OS detectionJoseph Hunkeler2024-02-061-1/+1
|
* Add isempty_dir() prototypeJoseph Hunkeler2023-12-101-0/+1
|
* Fix warnings and add xmkstempJoseph Hunkeler2023-11-201-0/+9
| | | | | | * Reduce stack usage for status variable in msg() * Bugfix: write OMC_COLOR_RESET to the requested stream instead of stdout * Add helper function xmkstemp to avoid clutter when using disposable files
* Use globalsJoseph Hunkeler2023-11-201-0/+2
| | | | | | * continue_on_error set by omc config * always_update_base_environment set by omc config * Passing OMC_MSG_RESTRICT flag to msg() will print only in verbose mode
* Rebrand for the last timeJoseph Hunkeler2023-11-201-3/+3
| | | | | * Shorten OHMYCAL to OMC * Rename ohmycal.h to omc.h
* msg() function is now type voidJoseph Hunkeler2023-10-311-1/+5
| | | | * Add debug_shell() function to interactively examine the runtime environment
* Initial commitJoseph Hunkeler2023-10-261-0/+43