Skip to content

Commit

Permalink
parallel git clone/pull backfires with SSH remotes
Browse files Browse the repository at this point in the history
remove it altogether.
  • Loading branch information
Alad Wenter committed Mar 9, 2016
1 parent b98a109 commit 5e2b0c3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
2 changes: 1 addition & 1 deletion PKGBUILD
@@ -1,5 +1,5 @@
pkgname=aurutils-git
pkgver=r155.7fde285
pkgver=r156.b98a109
pkgrel=1
pkgdesc='AUR helpers tools'
arch=('any')
Expand Down
18 changes: 4 additions & 14 deletions aursync
Expand Up @@ -2,26 +2,16 @@
export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'

readonly argv0=aursync
readonly tmp=$(mktemp) || exit 1

trap 'rm "$tmp"' EXIT
readonly pwd=$PWD

while read -r target; do
( if cd "$target" 2>/dev/null; then
if cd "$pwd/$target" 2>/dev/null; then
if ! git pull -v; then
printf '%s\n' "Failed to pull: $target" >> "$tmp"
break
fi
else
if ! git clone -v https://aur.archlinux.org/"$target".git; then
printf '%s\n' "Failed to clone: $target" >> "$tmp"
break
fi
fi
) &
done

wait

if (($(awk 'END {print NR}' "$tmp"))); then
cat "$tmp"
exit 1
fi

0 comments on commit 5e2b0c3

Please sign in to comment.