06-08-2021

update to M1
This commit is contained in:
2021-08-06 12:45:12 +02:00
parent c2e950d819
commit f99b2c3107
9 changed files with 160 additions and 14 deletions

View File

@@ -1,8 +1,18 @@
#!/usr/bin/env bash
# Perl plugin for KYMSU
# https://github.com/welcoMattic/kymsu
###############################################################################################
#
# Settings:
# Display info on updated pakages
display_info=true
# No distract mode (no user interaction)
[[ $@ =~ "--nodistract" ]] && no_distract=true || no_distract=false
# Also add module for prevent to update it.
declare -a do_not_update=('')
@@ -14,14 +24,14 @@ echo -e "\033[4mPerl:\033[0m $perl_app"
echo -e "\033[4mVersion:\033[0m $perl_v"
echo ""
module="App::cpanoutdate"
module="App::cpanoutdated"
if ! perl -M$module -e 1 2>/dev/null; then
echo -e "\033[4mRequierement:\033[0m module $module is not installed"
a=$(echo -e "Do you wanna run \033[1mcpan -i "$module"\033[0m ? (y/n)")
read -p "$a" choice
if [ "$choice" == "y" ]; then
#cpan -i $module
cpan -i $module
install_ok=true
else
echo "Bye"
@@ -29,7 +39,6 @@ if ! perl -M$module -e 1 2>/dev/null; then
fi
else
echo "$module installed"
install_ok=true
fi
@@ -46,10 +55,10 @@ if [ "$install_ok" == "true" ]; then
outdated=$(cpan-outdated -p)
nb=$(echo $outdated | wc -w)
a=$(echo -e "Do you wanna update\033[1m "$nb" outdated\033[0m modules ? (y/n)")
a=$(echo -e "Do you wanna update\033[1m "$nb" outdated\033[0m modules ? (y/n/a)")
read -p "$a" choice
if [ "$choice" == "y" ]; then
if [ "$choice" == "y" ] || [ "$choice" == "Y" ] || [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
for i in $outdated
do
@@ -60,7 +69,11 @@ if [ "$install_ok" == "true" ]; then
cpan -D "$i"
fi
echo -e "\033[1m"
echo "$i" | awk '{print $1}' | xargs -p -n 1 cpan -i
if [ "$choice" == "y" ] || [ "$choice" == "Y" ]; then
echo "$i" | awk '{print $1}' | xargs -p -n 1 cpan -i
elif [ "$choice" == "a" ] || [ "$choice" == "A" ]; then
echo "$i" | awk '{print $1}' | xargs -n 1 cpan -i
fi
echo -e "\033[0m"
#echo ""
fi