Version 0.1.6

This commit is contained in:
Cyrille L 2022-08-25 11:44:41 +02:00
parent df4fe68228
commit ead5328065
7 changed files with 82 additions and 39 deletions

14
CHANGELOG.md Normal file
View File

@ -0,0 +1,14 @@
# Changelog
UPD: Little tool to check and show system updates (archlinux, debian)
- Repository: https://git.a-lec.org/echolib/upd
- Issues: https://git.a-lec.org/echolib/upd/-/issues
- Changelog: https://git.a-lec.org/echolib/upd/-/blob/main/CHANGELOG.md
- License: https://git.a-lec.org/echolib/upd/-/blob/main/LICENSE
## [0.1.6]
### Fix
- exit after checking for available new upd, stopping other jobs
### add
- Settings colors in conf file

View File

@ -24,3 +24,17 @@ upd_script_upgrader="/var/lib/upd/scripts/upgrader"
# Onlinde Repo # Onlinde Repo
repo="https://git.a-lec.org/echolib/upd/-/raw/main/usr/local/bin/upd" repo="https://git.a-lec.org/echolib/upd/-/raw/main/usr/local/bin/upd"
repo_tar="https://git.a-lec.org/echolib/upd/-/archive/main/upd-main.tar.gz" repo_tar="https://git.a-lec.org/echolib/upd/-/archive/main/upd-main.tar.gz"
#======================================================================
# Set Colors
#======================================================================
NC="\e[0m"
C_Blue="\e[34m"
C_Cyan="\e[36m"
C_Green="\e[32m"
C_Grey="\e[2m"
C_Pink="\e[35m"
C_Red="\e[31m"
C_White="\e[1m"
C_Yellow="\e[33m"

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
# version: 0.1.5 # version: 0.1.6
# file: upd # file: upd
# Folder: /usr/local/bin # Folder: /usr/local/bin
# By echolib # By echolib
@ -43,6 +43,7 @@ if ! [[ -d "$1" ]];then
make) make)
mkdir -p "$1" mkdir -p "$1"
if__folder "$1" check if__folder "$1" check
exit
;; ;;
check) check)
@ -66,7 +67,7 @@ elif [[ `command -v pacman` ]];then
arch="pacman" arch="pacman"
if__command "checkupdates" if__command "checkupdates"
[[ `command -v yay` ]] \ [[ `command -v yay` ]] \
&& aur=yay && aur="yay"
else else
echo "! upd is not yet ready for this System" echo "! upd is not yet ready for this System"
@ -101,7 +102,8 @@ case "$1" in
clean|-C) clean__OPTIONS ;; clean|-C) clean__OPTIONS ;;
-cr) upd_cr=true;upd__check_reboot ;; -cr) upd_cr=true;upd__check_reboot ;;
list|-l) upd__list ;; list|-l) upd__list ;;
version|-v) awk 'NR==2 {print "# Installed:",$3}' "/usr/local/bin/upd" ;; version|-v) awk 'NR==2 {print "# Installed:",$3}' \
"/usr/local/bin/upd" ;;
-vv) script__versions ;; -vv) script__versions ;;
-vvv) verbose=true;script__versions ;; -vvv) verbose=true;script__versions ;;
-U) Updater ;; -U) Updater ;;
@ -112,3 +114,5 @@ case "$1" in
-A) sysup="aur";upg__main ;; -A) sysup="aur";upg__main ;;
*) echo "! Bad argument '$1' : see upd --help" ;; *) echo "! Bad argument '$1' : see upd --help" ;;
esac esac
exit

14
var/lib/upd/CHANGELOG.md Normal file
View File

@ -0,0 +1,14 @@
# Changelog
UPD: Little tool to check and show system updates (archlinux, debian)
- Repository: https://git.a-lec.org/echolib/upd
- Issues: https://git.a-lec.org/echolib/upd/-/issues
- Changelog: https://git.a-lec.org/echolib/upd/-/blob/main/CHANGELOG.md
- License: https://git.a-lec.org/echolib/upd/-/blob/main/LICENSE
## [0.1.6]
### Fix
- exit after checking for available new upd, stopping other jobs
### add
- Settings colors in conf file

View File

@ -35,7 +35,6 @@ upd__prepare_show
# Check for updates from {deb]ian # Check for updates from {deb]ian
#====================================================================== #======================================================================
upd__check_deb() { upd__check_deb() {
echo
sudo apt-get update -qq sudo apt-get update -qq
upd_file_tmp_apt=`mktemp` upd_file_tmp_apt=`mktemp`
@ -67,7 +66,7 @@ upd__prepare_show
upd__check_reboot() { upd__check_reboot() {
upd__reboot_set() { upd__reboot_set() {
upd_reboot="$Pp_Grey ${C_Red}Reboot$NC required ; $upd_uname > $upd_vmlin" upd_reboot="$P_Grey ${C_Red}Reboot$NC required ; $upd_uname > $upd_vmlin"
upd_inf="$I_Red" upd_inf="$I_Red"
} }
@ -87,14 +86,13 @@ case "$arch" in
esac esac
# Reboot message only: if called from option -cr # Reboot message only: if called from option -cr
[[ $upd_cr ]] || exit [[ $upd_cr ]] || return
! [[ $upd_reboot ]] \ ! [[ $upd_reboot ]] \
&& echo "# No need to reboot" \ && echo "# No need to reboot" \
&& exit && exit
echo -e "$upd_reboot" echo -e "$upd_reboot"
exit 137 exit 137
} }
@ -103,7 +101,7 @@ exit 137
#====================================================================== #======================================================================
upd__prepare_show() { upd__prepare_show() {
echo -ne "\r\033[2K" echo -ne "\r\033[2K"
upd -vv script__versions
echo echo
upd__check_reboot upd__check_reboot

View File

@ -25,7 +25,8 @@ if [[ `sort -V <<< "$versions" | tail -1` == $v_cur ]];then
&& s_onl=" > online: $v_onl" && s_onl=" > online: $v_onl"
echo "# $app_name is up to date (version: $v_cur$s_onl)" echo "# $app_name is up to date (version: $v_cur$s_onl)"
upd_err=true upd_err=true
return 0 return
else else
echo -e "- $app_name $C_Yellow$v_cur$NC -> $C_Green$v_onl$NC" echo -e "- $app_name $C_Yellow$v_cur$NC -> $C_Green$v_onl$NC"
fi fi

View File

@ -13,7 +13,6 @@ case "$sysup" in
system) system)
case "$arch" in case "$arch" in
pacman) pacman)
clear
upd__check_arch upd__check_arch
(( $upd_nbr == 0 )) \ (( $upd_nbr == 0 )) \
&& exit && exit
@ -22,7 +21,6 @@ case "$sysup" in
;; ;;
apt) apt)
clear
upd__check_deb upd__check_deb
(( $upd_nbr == 0 )) \ (( $upd_nbr == 0 )) \
&& exit && exit