Skip to content

Commit

Permalink
Make terms and PACMAN_CACHE arrays unique
Browse files Browse the repository at this point in the history
Minor fix to make interim arrays unique to ensure packages and caches
are only visited once during the entire workflow
  • Loading branch information
atreyasha committed May 14, 2021
1 parent 908fb0d commit 33b7c19
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions downgrade
Expand Up @@ -431,6 +431,10 @@ cli() {
IFS=' ' read -r -a system_args <<< "$(read_downgrade_conf)"
parse_options "${system_args[@]}" "$@"

# make arrays unique
IFS=' ' read -r -a terms <<< "$(printf "%s\n" "${terms[@]}" | uniq | tr '\n' ' ')"
IFS=' ' read -r -a PACMAN_CACHE <<< "$(printf "%s\n" "${PACMAN_CACHE[@]}" | uniq | tr '\n' ' ')"

# proceed with rest of workflow
main "${terms[@]}"
pacman -U "${pacman_args[@]}" "${to_install[@]}"
Expand Down

0 comments on commit 33b7c19

Please sign in to comment.