diff options
author | Leah Rowe <leah@libreboot.org> | 2025-04-11 20:04:53 +0100 |
---|---|---|
committer | Leah Rowe <leah@libreboot.org> | 2025-04-11 20:04:53 +0100 |
commit | 5a0a24f555985c772b8414fe88a5862d23491956 (patch) | |
tree | 17a636d738385a1fc3a9adc6db8d0899901e6f23 /include/git.sh | |
parent | a25a29cfbb7578ed44e862cc6a4ff019c340f499 (diff) |
lbmk: unified PWD handling (work directory)
instead of running pwd all the time, run it once in lib.sh,
and export PWD.
for lbmk-specific use of PWD, use xbmkpwd, which contains
the value of PWD as was set by the pwd utility in lib.sh.
many parts of lbmk rely on pwd, and it *must* be correct.
this change adds basic error handling, since pwd can in
fact return errors in some cases.
Signed-off-by: Leah Rowe <leah@libreboot.org>
Diffstat (limited to 'include/git.sh')
-rw-r--r-- | include/git.sh | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/git.sh b/include/git.sh index 31f8562d..30f9729a 100644 --- a/include/git.sh +++ b/include/git.sh @@ -5,6 +5,8 @@ eval "`setvars "" loc url bkup_url subfile subhash subrepo subrepo_bkup \ depend subfile_bkup repofail`" +tmpgit="$xbmkpwd/tmp/gitclone" + fetch_targets() { [ -n "$tree_depend" ] && [ "$tree_depend" != "$tree" ] && \ @@ -12,7 +14,7 @@ fetch_targets() e "src/$project/$tree" d && return 0 printf "Creating %s tree %s\n" "$project" "$tree" - git_prep "$loc" "$loc" "`pwd`/$configdir/$tree/patches" \ + git_prep "$loc" "$loc" "$xbmkpwd/$configdir/$tree/patches" \ "src/$project/$tree" u nuke "$project/$tree" "$project/$tree" } @@ -43,7 +45,7 @@ clone_project() printf "Downloading project '%s' to '%s'\n" "$project" "$loc" e "$loc" d missing && remkdir "${tmpgit%/*}" && git_prep \ - "$url" "$bkup_url" "`pwd`/config/$project/patches" "$loc"; : + "$url" "$bkup_url" "$xbmkpwd/config/$project/patches" "$loc"; : } git_prep() |