diff options
author | Dave Reisner <dreisner@archlinux.org> | 2018-08-18 12:28:37 -0400 |
---|---|---|
committer | Dave Reisner <dreisner@archlinux.org> | 2018-08-19 07:12:55 -0400 |
commit | bb83e6b56361906ce781a9940ab9bea537f9a0a1 (patch) | |
tree | 255e6923d94b5f1800fde8ec55ef2430997a7264 /package.inc.sh | |
parent | f3c8955cd76c6a9caadc7b45fd63137769281dae (diff) | |
download | asp32-bb83e6b56361906ce781a9940ab9bea537f9a0a1.tar.xz |
Avoid cd, references to $startdir
just set GIT_DIR appropriately and always operate from the original $PWD.
As part of this, let's cleanup our error handling in initialize() a fair
bit.
Diffstat (limited to 'package.inc.sh')
-rw-r--r-- | package.inc.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/package.inc.sh b/package.inc.sh index 3a64912..6fcf8c3 100644 --- a/package.inc.sh +++ b/package.inc.sh @@ -147,12 +147,12 @@ package_export() { if (( ! OPT_FORCE )); then # shellcheck disable=SC2154 - mkdir "$startdir/$pkgname" || return + mkdir "$pkgname" || return fi log_info 'exporting %s:%s' "$pkgname" "$subtree" git archive --format=tar "remotes/$remote/packages/$pkgname" "$subtree/" | - tar -C "$startdir" --transform "s,^$subtree,$pkgname," -xf - "$subtree/" + tar --transform "s,^$subtree,$pkgname," -xf - "$subtree/" } package_checkout() { @@ -165,9 +165,9 @@ package_checkout() { git branch -qf --no-track {,}"$remote/packages/$pkgname" quiet_git clone "$ASPROOT" --single-branch --branch "$remote/packages/$pkgname" \ - "$startdir/$pkgname" || return + "$pkgname" || return - git --git-dir="$startdir/$pkgname/.git" config pull.rebase true + git --git-dir="$pkgname/.git" config pull.rebase true } package_get_repos_with_arch() { |