Update
This commit is contained in:
parent
a8b676d971
commit
06be8ab619
3 changed files with 9 additions and 17 deletions
|
|
@ -16,7 +16,8 @@ Unofficial RPM package for Discord.
|
||||||
- Creates a ready-to-use RPM package
|
- Creates a ready-to-use RPM package
|
||||||
- Discord Stable, PTB, and Canary can be installed at the same time
|
- Discord Stable, PTB, and Canary can be installed at the same time
|
||||||
- Adds Discord to the applications list with a nice HD icon
|
- Adds Discord to the applications list with a nice HD icon
|
||||||
- Supports Fedora (27, 28) and OpenSUSE (Leap).
|
- Supports Fedora (31) and OpenSUSE (Leap 15.1+).
|
||||||
|
|
||||||
## More information
|
## More information
|
||||||
|
|
||||||
### Warning - no accents
|
### Warning - no accents
|
||||||
|
|
|
||||||
|
|
@ -23,17 +23,17 @@ fi
|
||||||
if ! type 'rpmbuild' > /dev/null; then
|
if ! type 'rpmbuild' > /dev/null; then
|
||||||
echo 'You need the rpm development tools to create rpm packages.'
|
echo 'You need the rpm development tools to create rpm packages.'
|
||||||
style $bold
|
style $bold
|
||||||
read -n 1 -p '> Install the rpmdevtools package now? [y/N]: ' answer
|
read -n 1 -p '> Install the required package (rpm-build) now? [y/N]: ' answer
|
||||||
echo
|
echo
|
||||||
|
style $reset
|
||||||
case "$answer" in
|
case "$answer" in
|
||||||
y|Y)
|
y|Y)
|
||||||
sudo_install_prompt 'Enter your password to install rpmdevtools: ' rpmdevtools
|
sudo_install_prompt 'Enter your password to install rpm-build: ' rpm-build
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo "${reset}The package won't be installed. Exiting now."
|
echo "The package won't be installed. Exiting now."
|
||||||
exit
|
exit
|
||||||
esac
|
esac
|
||||||
style $reset
|
|
||||||
else
|
else
|
||||||
disp "${green}rpmbuild detected.$reset"
|
disp "${green}rpmbuild detected.$reset"
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -26,17 +26,8 @@ else
|
||||||
distrib="unknown"
|
distrib="unknown"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Initializes $downloader: checks if wget is installed and fallbacks to curl if it isn't
|
# Initializes $wget_progress: detects if the option --show-progress is available
|
||||||
hash wget 2>/dev/null && downloader='wget' || downloader='curl'
|
wget --help | grep -q '\--show-progress' && wget_progress="-q --show-progress" || wget_progress=""
|
||||||
|
|
||||||
# Initializes $progress: detects if the downloader has a progress option
|
|
||||||
if [[ "$downloader" == 'wget' ]]; then
|
|
||||||
wget --help | grep -q '\--show-progress' && \
|
|
||||||
progress='-q --show-progress' || progress=''
|
|
||||||
else
|
|
||||||
curl --help | grep -q '\--progress-bar' && \
|
|
||||||
progress='--progress-bar' || progress=''
|
|
||||||
fi
|
|
||||||
|
|
||||||
# ask_yesno question
|
# ask_yesno question
|
||||||
## Asks a yes/no question and stores the result in the 'answer' variable
|
## Asks a yes/no question and stores the result in the 'answer' variable
|
||||||
|
|
@ -67,7 +58,7 @@ ask_remove_dir() {
|
||||||
## If it doesn't exist, creates it.
|
## If it doesn't exist, creates it.
|
||||||
manage_dir() {
|
manage_dir() {
|
||||||
if [ -d "$1" ]; then
|
if [ -d "$1" ]; then
|
||||||
echo "The $2 directory already exists and may contain outdated data."
|
echo "The $2 directory already exist and may contain outdated data."
|
||||||
ask_remove_dir "$1"
|
ask_remove_dir "$1"
|
||||||
fi
|
fi
|
||||||
mkdir -p "$1"
|
mkdir -p "$1"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue