From d9278518de94c4aa4f596062403b851d53cb44f9 Mon Sep 17 00:00:00 2001 From: ale Date: Sat, 3 Oct 2020 14:21:23 +0200 Subject: [PATCH] 0.6r6 --- lch | 2 +- lib/installers/deb.sh | 4 ++++ lib/installers/pacman.sh | 6 +++++- lib/installers/rpm.sh | 4 ++++ lib/installers/zypper.sh | 6 +++++- lib/resources.sh | 9 +++++++++ 6 files changed, 28 insertions(+), 3 deletions(-) diff --git a/lch b/lch index 99a3f03..09d3ede 100755 --- a/lch +++ b/lch @@ -1,5 +1,5 @@ #!/usr/bin/env bash -VERSION=0.6r5 +VERSION=0.6r6 DEST=$1 shift 1 ORIG=$@ diff --git a/lib/installers/deb.sh b/lib/installers/deb.sh index a3adba1..959ad3a 100644 --- a/lib/installers/deb.sh +++ b/lib/installers/deb.sh @@ -3,12 +3,16 @@ # Functions function get_dep(){ + wheel true & + WPID=$! apt-get 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 + disown $WPID + kill $WPID &> /dev/null } # Run diff --git a/lib/installers/pacman.sh b/lib/installers/pacman.sh index 9188ef4..869ee70 100644 --- a/lib/installers/pacman.sh +++ b/lib/installers/pacman.sh @@ -3,19 +3,23 @@ # Function function get_dep(){ + wheel true & + WPID=$! 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 + disown $WPID + kill $WPID &> /dev/null } # Run echo -e "Pacman system detected" echo "---------------------" -apt-get update 1> /dev/null +pacman -F -y 1> /dev/null if [ $# -eq 1 ]; then if $PRIVSOFT; then diff --git a/lib/installers/rpm.sh b/lib/installers/rpm.sh index 6cdd9cd..8bc152e 100644 --- a/lib/installers/rpm.sh +++ b/lib/installers/rpm.sh @@ -3,6 +3,8 @@ # Functions function get_dep(){ + wheel true & + WPID=$! if [[ $@ == "p7zip-plugins" ]]; then yum install -y -q $@ 1> /dev/null else @@ -13,6 +15,8 @@ function get_dep(){ if [[ $@ == "p7zip" ]]; then complete_install 7z; else complete_install $@; fi fi fi + disown $WPID + kill $WPID &> /dev/null } function install_centos(){ diff --git a/lib/installers/zypper.sh b/lib/installers/zypper.sh index 5647bde..9fc9d84 100644 --- a/lib/installers/zypper.sh +++ b/lib/installers/zypper.sh @@ -4,19 +4,23 @@ # Function function get_dep(){ + wheel true & + WPID=$! 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 + disown $WPID + kill $WPID &> /dev/null } # Run echo -e "Zypper system detected" echo "---------------------" -apt-get update 1> /dev/null +zypper -q up -y 1> /dev/null if [ $# -eq 1 ]; then if $PRIVSOFT; then diff --git a/lib/resources.sh b/lib/resources.sh index 7dc0093..8c5dacd 100644 --- a/lib/resources.sh +++ b/lib/resources.sh @@ -78,4 +78,13 @@ function complete_install(){ function failed_install(){ echo -e "$@:\t\t\t\e[91mFailed\e[0m" +} + +function wheel() { + sp='/-\|' + while $1; do + printf '%.1s\b' "$sp" + sp=${sp#?}${sp%???} + sleep 0.1s + done } \ No newline at end of file