Disable package manager installation for Tea CLI to ensure the correct Gitea tea binary is installed from GitHub releases
This commit is contained in:
@@ -329,60 +329,9 @@ download_file() {
|
||||
|
||||
# Function to install Tea CLI from package manager
|
||||
install_tea_from_package_manager() {
|
||||
# Package manager installation only works for system-wide installation
|
||||
if [[ "$INSTALL_STRATEGY" == user* ]]; then
|
||||
print_status "Skipping package manager for user installation"
|
||||
# Package manager installation is not reliable for Tea CLI, use binary instead
|
||||
print_warning "Package manager installation not supported for Tea CLI to ensure correct version, using binary instead"
|
||||
return 1
|
||||
fi
|
||||
|
||||
print_status "Attempting to install Tea CLI from package manager..."
|
||||
|
||||
case $PKG_MANAGER in
|
||||
apt)
|
||||
# Add Gitea repository if not present
|
||||
if ! grep -q "https://dl.gitea.com/gitea/gpg.key" /etc/apt/sources.list /etc/apt/sources.list.d/*.list 2>/dev/null; then
|
||||
print_status "Adding Gitea repository..."
|
||||
curl -fsSL https://dl.gitea.com/gitea/gpg.key | sudo apt-key add -
|
||||
echo "deb https://dl.gitea.com/gitea/ gitea main" | sudo tee /etc/apt/sources.list.d/gitea.list
|
||||
sudo apt update
|
||||
fi
|
||||
|
||||
sudo apt install -y tea
|
||||
return 0
|
||||
;;
|
||||
yum)
|
||||
# Add Gitea repository
|
||||
print_status "Adding Gitea repository..."
|
||||
sudo yum-config-manager --add-repo https://dl.gitea.com/gitea/RPM/GPG.KEY
|
||||
sudo yum-config-manager --add-repo https://dl.gitea.com/gitea/yum/ gitea
|
||||
sudo yum install -y tea
|
||||
return 0
|
||||
;;
|
||||
dnf)
|
||||
# Add Gitea repository
|
||||
print_status "Adding Gitea repository..."
|
||||
sudo dnf config-manager --add-repo https://dl.gitea.com/gitea/RPM/GPG.KEY
|
||||
sudo dnf config-manager --add-repo https://dl.gitea.com/gitea/yum/ gitea
|
||||
sudo dnf install -y tea
|
||||
return 0
|
||||
;;
|
||||
pacman)
|
||||
# Tea CLI is in AUR
|
||||
print_warning "Tea CLI is available in AUR. Consider using 'yay -S tea' or 'pacaur -S tea'"
|
||||
return 1
|
||||
;;
|
||||
zypper)
|
||||
print_status "Adding Gitea repository..."
|
||||
sudo zypper addrepo -G https://dl.gitea.com/gitea/RPM/GPG.KEY
|
||||
sudo zypper addrepo https://dl.gitea.com/gitea/yum/ gitea
|
||||
sudo zypper install -y tea
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
print_warning "Package manager $PKG_MANAGER not supported for automatic installation"
|
||||
return 1
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
# Function to install Tea CLI from binary
|
||||
|
||||
Reference in New Issue
Block a user