Skip to content

Commit

Permalink
Avoid cleaning aurutils cache when aurto add is running
Browse files Browse the repository at this point in the history
  • Loading branch information
alexheretic committed Feb 26, 2019
1 parent 1777d18 commit c706831
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions bin/aurto
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ $(echo "$i" | aur depends 2>/dev/null | cut -f2 | sort | comm -12 - <(aur pkglis
done
# shellcheck disable=SC2086
check_new_package_trust $packages_and_deps

## Create aurto-add.xxx marker file to indicate `aurto add` is running
mkdir -p ~/.cache/aurto
aurto_add_temp=$(mktemp ~/.cache/aurto/aurto-add.XXXXXXXX)
trap 'rm -f "$aurto_add_temp"' EXIT

aurto_sync
echo "aurto: Running: $(dim aur sync --no-view --no-confirm ${chroot_arg:---no-ver} --database=aurto --makepkg-conf=/etc/aurto/makepkg-chroot.conf) $(cyan "${*:2}")" >&2
"$lib_dir"/summerize-build aur sync --no-view --no-confirm ${chroot_arg:---no-ver} \
Expand Down
4 changes: 2 additions & 2 deletions lib/aurto/update-aurto
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ if [ "${after_modify:-0}" != "${modify:-0}" ]; then
touch /var/lib/pacman/local/aurto-arch-update
fi

## Clean aurutils cache
## Clean aurutils cache, if no aurto-add sessions are running
user_home=$(getent passwd "$user" | cut -d: -f6)
aurutils_cache=$user_home/.cache/aurutils/sync/
if [ -d "$aurutils_cache" ]; then
if [ -d "$aurutils_cache" ] && ! compgen -G "$user_home/.cache/aurto/aurto-add.*" >/dev/null; then
rm -rf "$aurutils_cache"
fi

0 comments on commit c706831

Please sign in to comment.