olds/easy-debian-init.rb
def install_packages(packages,comment)
      aptitude = '/usr/bin/aptitude'
      no_interactive = 'export DEBIAN_FRONTEND=noninteractive'

      puts "#{Tty.blue}Updating Repositories #{Tty.reset}"
      update_repo = system "#{aptitude} update"
      sleep_time(2)

      if update_repo
        puts "#{Tty.blue}Repositories Updated! #{Tty.reset}"
      else
        puts "#{Tty.red}Repositories Not Updated! #{Tty.reset}"
      end

      puts "#{Tty.blue}Updating the System #{Tty.reset}"
      update_system = system ("#{no_interactive}; #{aptitude} safe-upgrade -y")
      sleep_time(2)

      if update_system
        puts "#{Tty.blue}System Updated! #{Tty.reset}"
      else
        puts "#{Tty.red}System Not Updated! #{Tty.reset}"
      end

      puts "#{Tty.blue}Installing Packages: #{Tty.white}#{comment} #{Tty.reset}"
      install_pkgs = system ("#{no_interactive}; #{aptitude} install #{packages} -y")
      sleep_time(2)

      if install_pkgs
        puts "#{Tty.blue}Packages: #{Tty.white}#{comment} #{Tty.blue}Installed! #{Tty.reset}"
      else
        puts "#{Tty.red}Packages Not Installed! #{Tty.reset}"
        sleep_time(2)
      end
    end
# Method to install packages
# TODO: needs to validate if the mode is interactive or not
Method to install packages
TODO: needs to validate if the mode is interactive or not
Method to install packages TODO : needs to validate if the mode is interactive or not
def install_packages(packages,comment)
      aptitude = '/usr/bin/aptitude'
      no_interactive = 'export DEBIAN_FRONTEND=noninteractive'
      puts "#{Tty.blue}Updating Repositories #{Tty.reset}"
      update_repo = system "#{aptitude} update"
      sleep_time(2)
      if update_repo
        puts "#{Tty.blue}Repositories Updated! #{Tty.reset}"
      else
        puts "#{Tty.red}Repositories Not Updated! #{Tty.reset}"
      end
      puts "#{Tty.blue}Updating the System #{Tty.reset}"
      update_system = system ("#{no_interactive}; #{aptitude} safe-upgrade -y")
      sleep_time(2)
      if update_system
        puts "#{Tty.blue}System Updated! #{Tty.reset}"
      else
        puts "#{Tty.red}System Not Updated! #{Tty.reset}"
      end
      puts "#{Tty.blue}Installing Packages: #{Tty.white}#{comment} #{Tty.reset}"
      install_pkgs = system ("#{no_interactive}; #{aptitude} install #{packages} -y")
      sleep_time(2)
      if install_pkgs
        puts "#{Tty.blue}Packages: #{Tty.white}#{comment} #{Tty.blue}Installed! #{Tty.reset}"
      else
        puts "#{Tty.red}Packages Not Installed! #{Tty.reset}"
        sleep_time(2)
      end
    end
def install_packages ( packages , comment ) aptitude = '/usr/bin/aptitude' no_interactive = 'export DEBIAN_FRONTEND=noninteractive' puts "#{Tty.blue}Updating Repositories #{Tty.reset}" update_repo = system "#{aptitude} update" sleep_time ( 2 ) if update_repo puts "#{Tty.blue}Repositories Updated! #{Tty.reset}" else puts "#{Tty.red}Repositories Not Updated! #{Tty.reset}" end puts "#{Tty.blue}Updating the System #{Tty.reset}" update_system = system ( "#{no_interactive}; #{aptitude} safe-upgrade -y" ) sleep_time ( 2 ) if update_system puts "#{Tty.blue}System Updated! #{Tty.reset}" else puts "#{Tty.red}System Not Updated! #{Tty.reset}" end puts "#{Tty.blue}Installing Packages: #{Tty.white}#{comment} #{Tty.reset}" install_pkgs = system ( "#{no_interactive}; #{aptitude} install #{packages} -y" ) sleep_time ( 2 ) if install_pkgs puts "#{Tty.blue}Packages: #{Tty.white}#{comment} #{Tty.blue}Installed! #{Tty.reset}" else puts "#{Tty.red}Packages Not Installed! #{Tty.reset}" sleep_time ( 2 ) end end
Method to install packages
TODO: needs to validate if the mode is interactive or not
Method to install packages TODO : needs to validate if the mode is interactive or not
packages
comment