summaryrefslogtreecommitdiff
path: root/include/get.sh
AgeCommit message (Collapse)Author
2025-11-15get.sh: reduce indendation in fetch_targetsLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-11-15get.sh: reduce indentation in clone_projectLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17get.sh: return clone_project if multi-treeLeah Rowe
this is the true fix, replacing the fixes previously reverted. the problem with the old fix was that it was a hack, and could result in the archived backup of a code repo being the wrong one; the destination was the one for the main repo, but what if we were cloning the backup? Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17Revert "get.sh: don't frivolously copy tmp git clones"Leah Rowe
This reverts commit b840cf3a832de815a87d9d10b698eec97aceb342.
2025-10-17Revert "get.sh: remove a redundant check"Leah Rowe
This reverts commit e2a97455cc25921dcb9f5e3a4bf06cdfb3e34b49.
2025-10-17get.sh: remove a redundant checkLeah Rowe
loc is never empty. if it is, it's a bug. don't hide bugs. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17get.sh: don't frivolously copy tmp git clonesLeah Rowe
this fixes a regression in a previous patch, this time also taking account for the different cache locations. all of get.sh needs to be purged, and re-written clean. it looks clean. but it's years of hacks. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-17Revert "get.sh: make forcepull a macro"Leah Rowe
This reverts commit b3232a7c4a6466381d798d7beda56fd020d86d54.
2025-10-17get.sh: make forcepull a macroLeah Rowe
: Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-16xbmk: sort global variables alphabeticallyLeah Rowe
also separate some of the special ones. this makes the variables easier to read/find. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-16get.sh: use the same directory map as --mirrorLeah Rowe
Don't hardcode the cache directory, and don't store remotes anymore. This change retains compatibility in practice, with the older directory location, because it's extremely unlikely that newly generated locations would conflict with old ones. With this new change, non-mirror git clone caches are now done twice; one directory per remote, rather than one directory with two remotes. This is just inherently much more reliable. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-16get.sh: use --keep-cr on git-amLeah Rowe
Some repositories might use CR-LF line endings. This option keeps Git from mangling patches when merging. Repositories that don't do this, such as ALL repositories currently used by xbmk, will be unaffected by this change. This is being done in preparation for importing MrChromebox edk2, as Intel's own edk2 repository on GitHub uses these. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-16get.sh: More reliable git remote cachingLeah Rowe
Don't do one repository for all remotes. Do one *clone* per remote. This also means that users no longer download information twice, in practice, because the backup repository will only be downloaded if the main one didn't work. Theoretically, this change is makes the process less efficient, but in practise it's more reliable now. We do now use --mirror on the git clone command for caches, but we already did git pull --all before. This just ensures that we absolutely have all local code. NOTE: The new code isn't used by default. To use it, you must do: export XBMK_CACHE_MIRROR="y" Otherwise, the old behaviour will continue to be used. This is because the new code, while correct, puts more strain on upstream servers (more code being downloaded), and can result in higher amounts of disk space being used. The old behaviour wasn't broken, so we'll also support that method. TODO: perhaps also have a check in place to re-use both caches, where available, regardless of XBMK_CACHE_MIRROR? Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-07get.sh: use git-show instead, for rev checksLeah Rowe
whatchanged is deprecated, and results in an error on modern git versions, prompting you to include the --i-still-use-this argument what absolute, utter fucking arrogance. i use the whatchanged feature every fucking day. i will be complaining to git-scm.com about this. but that's what we do in libreboot. we adapt. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: don't call mkdir. use xbmkdir (new function)Leah Rowe
xbmkdir checks if a directory exists, before running mkdir, and then still uses -p i was testing xbmk on arch linux today, and noticed that it errored out when a directory already exists. i'm mitigating against buggy or differently behaving mkdir implementations this way, by wrapping around it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: use sbase sha512sum, not host sha512sumLeah Rowe
the --status flag seems to be a GNUism as stated in the previous commit, i import sbase suckless now, so as to have a consistent implementation of sha512sum. this ensures that its output is reliable, when i'm using the output of this command within backticks. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04tree.sh: rename xtree to xgcctree, for clarityLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04get.sh: delete tmp patch list when doneLeah Rowe
yet another oversight Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04get.sh: sort patches when applyingLeah Rowe
this was an oversight in my recent patch unrolling the condensed code lines, to remove eval statements. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: remove even more eval statementsLeah Rowe
in one or two cases, the use of eval is retained, but modified so as to be safer. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: remove the setcfg functionLeah Rowe
this allows me to remove several eval calls, and the errors relating to configs can now show exactly which function they occured in, allowing for easier debugging. once again, eval should be used sparingly if at all. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: remove more eval statementsLeah Rowe
i will eventually find a way to remove them all, while still leaving the code completely clean. in practise, i never use the contents of a file for eval and the inputs are carefully checked. however, over-use of eval is always a bad idea in shell scripting. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-04xbmk: general cleanup: unroll condensed code linesLeah Rowe
i overlooked a number of lines, during previous cleanup Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-02get.sh: reduce the number of eval statementsLeah Rowe
also split up try_fetch() Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-01get.sh: allow force-pull via -F instead of -fLeah Rowe
use of ./mk -F behaves the same as -f before the previous commit. this can be useful, during development when we want to update revisions. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-10-01get.sh: only pull if the local revision is missingLeah Rowe
we pull from upstream in cached git repos, before performing an operation, and we run from the cache, but we do this every time, even if a local revision exists, defeating the purpose of the caching; on unreliable/intermittent internet connections, this can cause a problem. this also causes us problems with gnulib.git and grub.cfg, which for *some reason* are really slow, even when doing a pull. this change improves the efficiency of the build system, during release builds, on a development repository where we already have lots of caches. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26get.sh: remove unnecessary check in try_copyLeah Rowe
the check for whether a file is present is unnecessary, because the following cp command would also print the file name if it doesn't exist, and exit with the same non-zero status. let cp do the work. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26get.sh: rename try_file to try_fetchLeah Rowe
the previous function name was misleading, because this tries multiple methods including git and curl. therefore, this was renamed to match what it dose. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-26xbmk: tidy up some if statementsLeah Rowe
this is an extension of the previous work to unroll most of the condensed code lines. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24make notices a bit more readableLeah Rowe
add line breaks, so that the license and author are visually separated. this makes it easier to read. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-24get.sh: unroll condensed code linesLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-18Revert "xbmk: don't use backticks for command substitution"Leah Rowe
This reverts commit 4999a49de39667b3239fc2010d0e99c958b29417.
2025-09-13xbmk: much more verbose error messagesLeah Rowe
use the new functionality in err(), whereby a given function name and arguments can be provided, for debugging purposes. something similar was already done in a few places, and replaced with this unified functionality. this patch will make xbmk much easier to debug, under fault conditions. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-11xbmk: don't use backticks for command substitutionLeah Rowe
the newer way handles escaped characters better, and it can be nested more easily. it's also more readable. personally, i prefer the old way, because it's more minimalist, but it occurs to me that a lot of people nowadays don't know about backticks, but they do know of the modern way. to make the code more readable, i have modernised it. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-05get.sh: put tmpgit in xbtmpLeah Rowe
similar to the previous failed patch, which tried to also generate it each time, but that led to issues. this version of the same change merely maintains the current hardcoding logic, while putting it in xbtmp. that way, it's more robustly cleared upon exit from the parent instance of xbmk. this also reduces the chance of race conditions, since it's in a unique place each time, rather than going in XBMK_CACHE. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-04Revert "get.sh: put tmpclone dirs in xbtmp"Leah Rowe
This reverts commit 01a779d4ebcdfc7df406263aeb1dffb800eb0220. This commit broke ./mk -d coreboot for vendor files in lbmk.
2025-09-02get.sh: put tmpclone dirs in xbtmpLeah Rowe
and generate them, don't hardcode them - this reduces the chance of race conditions, which we have seen in the past and which current execution flow in xbmk even mitigates in a few places, by doing things in a certain order. this change makes the code more robust and easier to maintain. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-02xbmk: remove xbloc, re-use xbtmp insteadLeah Rowe
we no longer separate them. xbloc was the on-disk tmp directory, whereas xbtmp used to be in /tmp which we assumed to be tmpfs (it may not be, but often is on many workstation setups - and our documentation recommended doing this). as mentioned in the previous commit, benchmarking shows little speed difference using tmpfs /tmp versus on-disk /tmp, for our purposes at least. therefore, the handling of tmp files is being greatly simplified. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-02get.sh: remove unnecessary variable, repofailLeah Rowe
it is entirely unused Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-09-02get.sh xbget: don't use eval for file/dir checksLeah Rowe
the actual code works fine, but it's quite hacky. there are times when use of eval is acceptable; this is not one of those times, but i'd used it in this instance when i was being a bit crazy about code size reductions during my audits. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: simplify fetch_project()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: simplify try_copy()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: tidy up bad_checksum()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: simplify fetch_targets()Leah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26general cleanup in get.sh and vendor.shLeah Rowe
Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26xbmk: rename xbmklocal/xbmktmp variablesLeah Rowe
shorten them Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: consolidate printf statementsLeah Rowe
stick it in git_prep, which both single- and multi-tree projects will use, when downloading git repositories. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: remove redundant printf in fetch_projectLeah Rowe
The following execution will result in another printf that says exactly what is being downloaded. There is no need to inform the user twice about what is being downloaded. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-26get.sh: remove superfluous command in try_git()Leah Rowe
A git-pull is performed immediately after git-fetch. Git-pull already performs git-fetch as a prerequisite. Signed-off-by: Leah Rowe <leah@libreboot.org>
2025-05-25get.sh: Properly error out if tmpclone failsLeah Rowe
We rely on a non-zero exit on other try_ commands, which works fine there because we then check the file afterward and error out accordingly. For git repositories, we assume that both mirrors are identical and therefore once we get to the first clone attempt, we assume that it must succeed. Therefore, if it does not succeed, we must fail. This fixes a regression I found in testing, where sometimes a failed patching attempt would not result in an error exit, and would therefore result in broken sources being present. In practise, I always very closely watch the terminal when testing xbmk, especially when updating project patches, so we probably didn't introduce any broken sources in practice. Signed-off-by: Leah Rowe <leah@libreboot.org>