Update cache only when needed

This commit is contained in:
Juno Takano 2024-07-12 08:28:21 -03:00
parent 5b31e8f60f
commit 7769565a21
2 changed files with 14 additions and 12 deletions

View file

@ -12,6 +12,9 @@ validate_input_packages() {
log user "Invalid package: $package (contains invalid characters)" log user "Invalid package: $package (contains invalid characters)"
return 1 return 1
fi fi
update_package_cache
if grep -qw "$package" "$PACKAGE_CACHE"; then if grep -qw "$package" "$PACKAGE_CACHE"; then
log debug "Found in package cache: $package" log debug "Found in package cache: $package"
else else

1
tori
View file

@ -34,7 +34,6 @@ main() {
# startup checks # startup checks
prepare_directories prepare_directories
update_package_cache
# entry point # entry point