Browse Source

0.5*--

pull/3/head
Gustavo Adolfo Mesa Roldán 3 years ago
parent
commit
8a22e4c66c
3 changed files with 93 additions and 5 deletions
  1. +2
    -5
      lib/installer.sh
  2. +45
    -0
      lib/installers/pacman.sh
  3. +46
    -0
      lib/installers/zypper.sh

+ 2
- 5
lib/installer.sh View File

@ -53,15 +53,12 @@ function install()
elif [ -x "$(command -v dnf)" ] || [ -x "$(command -v yum)" ]
then
if [[ -e ./lib/installers/rpm.sh ]]; then . ./lib/installers/rpm.sh; else . /usr/lib/lch/installers/rpm.sh; fi
# Hasta aqui he modificado
elif [ -x "$(command -v pacman)" ]
then
echo -e "Pacman system detected"
pacman -Sqy --noconfirm tar bzip2 gzip zip unzip p7zip 1> /dev/null
if [[ -e ./lib/installers/pacman.sh ]]; then . ./lib/installers/pacman.sh; else . /usr/lib/lch/installers/pacman.sh; fi
elif [ -x "$(command -v zypper)" ]
then
echo -e "Zypper system detected"
zypper install -y tar bzip2 gzip zip unzip p7zip-full 1> /dev/null
if [[ -e ./lib/installers/zypper.sh ]]; then . ./lib/installers/zypper.sh; else . /usr/lib/lch/installers/zypper.sh; fi
else
echo -e "System installer not detected"
fi


+ 45
- 0
lib/installers/pacman.sh View File

@ -0,0 +1,45 @@
#!/usr/bin/env bash
# Function
function get_dep(){
pacman -Sqy --noconfirm $@ &> /dev/null
if [[ $? -ne 0 ]]; then
if [[ $@ == "p7zip" ]]; then failed_install 7z; else failed_install $@; fi
else
if [[ $@ == "p7zip" ]]; then complete_install 7z; else complete_install $@; fi
fi
}
# Run
echo -e "Pacman system detected"
echo "---------------------"
apt-get update 1> /dev/null
if [ $# -eq 1 ]; then
if $PRIVSOFT; then
rarInstall
fi
for installer in "tar" "bzip2" "gzip" "zip" "unzip" "p7zip"
do get_dep $installer
done
else
for i in $@
do
if [ $i -ne "-i" ]
then
case $i in
"rar" | "unrar")
rarInstall
;;
"7z" | "7zip" | "p7zip")
get_dep p7zip
;;
*)
get_dep $i
;;
esac
fi
done
fi

+ 46
- 0
lib/installers/zypper.sh View File

@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Function
function get_dep(){
zypper install -y $@ &> /dev/null
if [[ $? -ne 0 ]]; then
if [[ $@ == "p7zip-full" ]]; then failed_install 7z; else failed_install $@; fi
else
if [[ $@ == "p7zip-full" ]]; then complete_install 7z; else complete_install $@; fi
fi
}
# Run
echo -e "Zypper system detected"
echo "---------------------"
apt-get update 1> /dev/null
if [ $# -eq 1 ]; then
if $PRIVSOFT; then
rarInstall
fi
for installer in "tar" "bzip2" "gzip" "zip" "unzip" "p7zip-full"
do get_dep $installer
done
else
for i in $@
do
if [ $i -ne "-i" ]
then
case $i in
"rar" | "unrar")
rarInstall
;;
"7z" | "7zip" | "p7zip")
get_dep p7zip-full
;;
*)
get_dep $i
;;
esac
fi
done
fi

Loading…
Cancel
Save