mirror of
https://github.com/kuhyx/scripts.git
synced 2026-07-06 18:23:07 +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 to check if user is trying to install specific packages that require confirmation
|
||||||
function check_for_steam() {
|
function check_for_steam() {
|
||||||
# List of packages that require confirmation
|
# 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
|
# Check if the command is an installation command
|
||||||
if [[ "$1" == "-S" || "$1" == "-Sy" || "$1" == "-Syu" || "$1" == "-Syyu" || "$1" == "-U" ]]; then
|
if [[ "$1" == "-S" || "$1" == "-Sy" || "$1" == "-Syu" || "$1" == "-Syyu" || "$1" == "-U" ]]; then
|
||||||
# Check all arguments
|
# Check all arguments
|
||||||
for arg in "$@"; do
|
for arg in "$@"; do
|
||||||
|
# Strip repository prefix if present (like extra/ or community/)
|
||||||
|
local package_name="${arg##*/}"
|
||||||
|
|
||||||
# Check if argument matches any restricted package
|
# Check if argument matches any restricted package
|
||||||
for package in "${restricted_packages[@]}"; do
|
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
|
return 0 # Restricted package found
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user