mirror of
https://github.com/kuhyx/scripts.git
synced 2026-07-04 14:43:08 +02:00
feat: improve checking for restricted packages robustness
This commit is contained in:
parent
bf987bb63c
commit
1bb7031647
@ -55,15 +55,19 @@ function display_operation() {
|
||||
# Function to check if user is trying to install specific packages that require confirmation
|
||||
function check_for_steam() {
|
||||
# List of packages that require confirmation
|
||||
local restricted_packages=("steam" "freetube-bin" "seamonkey-bin" "seamonkey" "min-browser-bin" "min-browser" "beaker-browser" "catalyst-browser-bin" "hamsket" "min" "vieb-bin" "yt-dlp" "yt-dlp" "yt-dlp-git" "stremio" "stremio-git")
|
||||
local restricted_packages=("steam" "freetube-bin" "freetube" "seamonkey-bin" "seamonkey" "min-browser-bin" "min-browser" "beaker-browser" "catalyst-browser-bin" "hamsket" "min" "vieb-bin" "yt-dlp" "yt-dlp-git" "stremio" "stremio-git")
|
||||
|
||||
# Check if the command is an installation command
|
||||
if [[ "$1" == "-S" || "$1" == "-Sy" || "$1" == "-Syu" || "$1" == "-Syyu" || "$1" == "-U" ]]; then
|
||||
# Check all arguments
|
||||
for arg in "$@"; do
|
||||
# Strip repository prefix if present (like extra/ or community/)
|
||||
local package_name="${arg##*/}"
|
||||
|
||||
# Check if argument matches any restricted package
|
||||
for package in "${restricted_packages[@]}"; do
|
||||
if [[ "$arg" == "$package" || "$arg" == *"/$package-"* || "$arg" == *"/$package/"* ]]; then
|
||||
if [[ "$arg" == "$package" || "$arg" == *"/$package-"* || "$arg" == *"/$package/"* ||
|
||||
"$arg" == *"/$package" || "$package_name" == "$package" ]]; then
|
||||
return 0 # Restricted package found
|
||||
fi
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user