From 2230dc41eef5a4cd6ff827612cd3ece633f42422 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 10:46:19 -0700 Subject: [PATCH 1/7] updated to functions v1.3.0 --- PRbL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PRbL b/PRbL index 86c1073..f714911 160000 --- a/PRbL +++ b/PRbL @@ -1 +1 @@ -Subproject commit 86c10738ce34063d4abb2bcb037b4da7139f21e3 +Subproject commit f714911ae0c0d7c97351fae95b7f17a41b4c5b75 From f7d38594668c2d055d8145c0b00d91e524227d76 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 15:34:59 -0700 Subject: [PATCH 2/7] fixed logging output for global install --- install.sh | 65 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 27 deletions(-) diff --git a/install.sh b/install.sh index d70cd18..a2d1004 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ ################################################################### # initial vars -VERSION=2.3.0 +VERSION=2.3.1 scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION" # Bash expansions to get the name and location of this script when run @@ -175,18 +175,6 @@ check-deps(){ fi } -install-deps(){ - boxborder "Installing packages $packages" - if [[ dry_run == true ]] ; then - boxline "DryRun: spin \"for $_package in $packages ; do sudo apt-get install -y $_package ; done\"" - else - # using a spinner function block to track installation progress - spin "for $_package in $packages ; do sudo apt-get install -y $_package ; done" - fi - # Sets dependency installed flag to true - depsinstalled=true -} - install(){ # If script is run as root, run global install if [[ $runuser == root ]] ; then @@ -203,6 +191,16 @@ export prbl_functions=\"${installdir}/functions\"" fi } +install-functions(){ + # Copy functions + if [ -f ${rundir}/PRbL/functions ] ; then + install-file ${rundir}/PRbL/functions ${installdir} + else + curl -ks 'https://raw.githubusercontent.com/pyr0ball/PRbL/master/functions' > ${rundir}/functions + install-file ${rundir}/functions ${installdir}/functions + fi +} + take-backup(){ name="$1" if [[ $update_run != true ]] ; then @@ -279,6 +277,18 @@ install-dir() { done < <(find "$_source" -type f -print0) } +install-deps(){ + boxborder "Installing packages $packages" + if [[ dry_run == true ]] ; then + boxline "DryRun: spin \"for $_package in $packages ; do sudo apt-get install -y $_package ; done\"" + else + # using a spinner function block to track installation progress + spin "for $_package in $packages ; do sudo apt-get install -y $_package ; done" + fi + # Sets dependency installed flag to true + depsinstalled=true +} + install-extras(){ _extras=() extra_installs=$(ls ${escape_dir}/extras/) @@ -315,13 +325,13 @@ extras-menu(){ 0) boxborder "${grn}Installing extras...${dfl}" install-extras ;; - 1) logger boxline "Skipping extras installs" ;; + 1) boxline "Skipping extras installs" ;; esac #fi } userinstall(){ - +# TODO: modify this function to accept a user as an argument and call it from globalinstall # Create install directory under user's home directory run mkdir -p ${installdir} @@ -335,7 +345,7 @@ userinstall(){ fi # Copy functions first - install-file ${rundir}/PRbL/functions ${installdir} + install-functions # Copy bashrc scripts to home folder install-dir ${rundir}/lib/skel/ $HOME @@ -343,9 +353,9 @@ userinstall(){ # Check for dependent applications and warn user if any are missing if ! check-deps ; then warn "Some of the utilities needed by this script are missing" - echo -e "Missing utilities:" - echo -e "${bins_missing[@]}" - echo -e "After this installer completes, run:" + boxlinelog "Missing utilities:" + boxlinelog "${bins_missing[@]}" + boxlinelog "After this installer completes, run:" boxseparator echo -en "\n${lbl}sudo apt install -y ${bins_missing[@]}\n${dfl}" boxborder "Press 'Enter' key when ready to proceed" @@ -357,7 +367,7 @@ userinstall(){ # If vim is installed, add config files for colorization and expandtab if [[ $viminstall != null ]] ; then - mkdir -p ${HOME}/.vim/colors + run mkdir -p ${HOME}/.vim/colors install-file $rundir/lib/vimfiles/crystallite.vim ${HOME}/.vim/colors take-backup $HOME/.vimrc cp $rundir/lib/vimfiles/vimrc.local $rundir/lib/vimfiles/.vimrc @@ -383,7 +393,9 @@ userinstall(){ #fi #clear + # launch extra installs extras-menu + if [[ $dry_run != true ]] ; then boxborder "${grn}Please be sure to run ${lyl}sensors-detect --auto${grn} after installation completes${dfl}" fi @@ -393,23 +405,22 @@ globalinstall(){ # Create global install directory run mkdir -p ${globalinstalldir} - # Copy functions - install-file ${rundir}/PRbL/functions ${globalinstalldir}/functions + install-functions export prbl_functions="${globalinstalldir}/functions" # Check for dependent applications and offer to install if ! check-deps ; then warn "Some of the utilities needed by this script are missing" - logger "Missing utilities:" - logger "${bins_missing[@]}" - logger "Would you like to install them? (this will require root password)" + boxlinelog "Missing utilities:" + boxlinelog "${bins_missing[@]}" + boxlinelog "Would you like to install them? (this will require root password)" utilsmissing_menu=( "$(boxline "${green_check} Yes")" "$(boxline "${red_x} No")" ) case `select_opt "${utilsmissing_menu[@]}"` in - 0) boxborder "${grn}Installing dependencies...${dfl}" - spin $(install-deps) + 0) boxlinelog "${grn}Installing dependencies...${dfl}" + install-deps ;; 1) warn "Dependent Utilities missing: $bins_missing" ;; esac From 97bb764c1455a5f950b6afb82d2e6a8b85504f16 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 15:39:02 -0700 Subject: [PATCH 3/7] fixed copy syntaxfixed copy syntax --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index a2d1004..5e15332 100755 --- a/install.sh +++ b/install.sh @@ -197,7 +197,7 @@ install-functions(){ install-file ${rundir}/PRbL/functions ${installdir} else curl -ks 'https://raw.githubusercontent.com/pyr0ball/PRbL/master/functions' > ${rundir}/functions - install-file ${rundir}/functions ${installdir}/functions + install-file ${rundir}/functions ${installdir} fi } From 0df759afe6fe2a3e73e82a433f3c1387a374e429 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 15:39:35 -0700 Subject: [PATCH 4/7] iterated fix version --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 5e15332..3a07d44 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ ################################################################### # initial vars -VERSION=2.3.1 +VERSION=2.3.2 scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION" # Bash expansions to get the name and location of this script when run From 146bd34d6965cc894da390af85bd60222abe2d22 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 16:24:34 -0700 Subject: [PATCH 5/7] fixed syntax error in global installfixed syntax error in global install --- install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 3a07d44..02a104c 100755 --- a/install.sh +++ b/install.sh @@ -279,11 +279,13 @@ install-dir() { install-deps(){ boxborder "Installing packages $packages" - if [[ dry_run == true ]] ; then - boxline "DryRun: spin \"for $_package in $packages ; do sudo apt-get install -y $_package ; done\"" - else + if [[ dry_run != true ]] ; then # using a spinner function block to track installation progress - spin "for $_package in $packages ; do sudo apt-get install -y $_package ; done" + for $_package in $packages ; do + sudo apt-get install -y $_package + done + else + boxline "DryRun: spin \"for $_package in $packages ; do sudo apt-get install -y $_package ; done\"" fi # Sets dependency installed flag to true depsinstalled=true From cc1d1ccf9eeb0740e39ca2426e4ae7e34b4d1296 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 16:27:40 -0700 Subject: [PATCH 6/7] fixed syntax in depsinstall --- install.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index 02a104c..b57a872 100755 --- a/install.sh +++ b/install.sh @@ -281,7 +281,7 @@ install-deps(){ boxborder "Installing packages $packages" if [[ dry_run != true ]] ; then # using a spinner function block to track installation progress - for $_package in $packages ; do + for _package in $packages ; do sudo apt-get install -y $_package done else @@ -405,7 +405,7 @@ userinstall(){ globalinstall(){ # Create global install directory - run mkdir -p ${globalinstalldir} + run mkdir -p ${installdir} install-functions export prbl_functions="${globalinstalldir}/functions" From aab550732838d2c022c7a444cbba1fae39b65f39 Mon Sep 17 00:00:00 2001 From: alanw Date: Thu, 11 May 2023 16:28:13 -0700 Subject: [PATCH 7/7] iterated fix version --- install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install.sh b/install.sh index b57a872..3361858 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,7 @@ ################################################################### # initial vars -VERSION=2.3.2 +VERSION=2.3.3 scripttitle="Pyr0ball's Reductive Bash Library Installer - v$VERSION" # Bash expansions to get the name and location of this script when run