#!/bin/bash # # pacman menu interface # Copyright 2005 Tony Brijeski # Licensed under the GPL2 license which can be found here # http://www.gnu.org/licenses/licenses.html # # Version 1.4 - basic package removal and installation along with refresh # and updating options, by Tony Brijeski # # Version 2.0 ugraded by Markku (rasat) rasat@user-contributions.org # Date 17-June-2005 # [ `id -u` -ne 0 ] && { echo "This program must be run by the root user" echo " Login root:" echo " # su" echo " # " exit 1 } # ANSI COLORS NORMAL="\033[0;39m" # RED: Warning message RED="\033[1;31m" # GREEN: Success message GREEN="\033[1;32m" # YELLOW: Attention message YELLOW="\033[1;33m" # BLUE: System message BLUE="\033[1;34m" # LCYAN: Found devices and modules LCYAN="\033[1;36m" pmenuVER="$(cat /etc/pacmenu/version)" rm -f /etc/pacmenu/packages.txt* main () { dialog --clear --title "Pacman Package Manager Menu $pmenuVER" --menu \ "\n\n Select the function you want and press enter \n\n\n" 18 70 8 \ "INSTALL" "Install new packages menu" \ "REMOVE" "Remove installed packages menu" \ "DEPVIEW" "Pacman Dependency Viewer (-Qs)" \ "SYNCHPKG" "Synchronize packages (-Sy)" \ "UPDATESYS" "Synchronize and system update (-Syu)" \ "AREFRESH" "Refresh Arch Build System (abs)" \ "REFRESH" "Refresh the package database (sqlite)" \ "EXIT" "Quit Pacmenu" 2>/tmp/pacmenu.tmp case $? in 0) CHOICE=`cat /tmp/pacmenu.tmp` rm -f /tmp/pacmenu.tmp $CHOICE ;; *) exit 0 ;; esac } INSTALL () { if [ -f /var/lib/pacmenu/pacmenu.db ]; then dummy="" else if [ -f /etc/pacmenu/install.new ]; then dialog \ --title 'Information' \ --msgbox 'You need to refresh the package database.' \ 6 50 main fi fi dialog --clear --title "Pacman Package Manager Menu $pmenuVER" --menu \ "\n\n Select the function you want and press enter \n\n\n" 15 70 5 \ "PINSTALL" "Install new packages by alphabetical menu" \ "CINSTALL" "Install new packages by category menu" \ "GINSTALL" "Install new groups" \ "VIEWREPO" "View new in Arch repos" \ "VIEWPKG" "View installed packages" 2>/tmp/pacmenu.tmp case $? in 0) CHOICE=`cat /tmp/pacmenu.tmp` rm -f /tmp/pacmenu.tmp $CHOICE ;; *) main ;; esac } REMOVE () { if [ -f /var/lib/pacmenu/pacmenu.db ]; then dummy="" else if [ -f /etc/pacmenu/install.new ]; then dialog \ --title 'Information' \ --msgbox 'You need to refresh the package database.' \ 6 50 main fi fi dialog --clear --title "Pacman Package Manager Menu $pmenuVER" --menu \ "\n\n Select the function you want and press enter \n\n\n" 15 70 4 \ "PREMOVE" "Remove installed packages by alphabetical menu" \ "CREMOVE" "Remove installed packages by category menu" \ "GREMOVE" "Remove installed groups" \ "ROLLBAK" "Replace new with old package" 2>/tmp/pacmenu.tmp case $? in 0) CHOICE=`cat /tmp/pacmenu.tmp` rm -f /tmp/pacmenu.tmp $CHOICE ;; *) main ;; esac } PINSTALL () { dialog --infobox "Please wait...Creating Package Install Menu" 3 48 pkginstmenu=`sqlite /var/lib/pacmenu/pacmenu.db "SELECT name,category FROM pkgs WHERE yn='no'" | sed 's/|/ /g' | sed 's/$/ off /g' | sort ` dialog --clear --title "Pacman Package Install Menu" --checklist \ "\n Please select the package to install \n Package Name Package Category" 23 70 15 \ $pkginstmenu 2>/tmp/pacman.instchoice case $? in 0) pkgpick=`cat /tmp/pacman.instchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No package was selected.' \ 6 50 rm -f /tmp/pacman.instchoice INSTALL fi rm -f /tmp/pacman.instchoice echo "PLease wait..." $pacinstall $pkgpick echo "" echo "Press any key to continue.." read KEY dialog \ --title 'Information' \ --msgbox 'Finished installing package(s).' \ 6 50 echo "$pkgpick" >/tmp/install.tmp1 cat /tmp/install.tmp1 | tr ' ' '\n' | awk '{print $1}' > /tmp/install.tmp2 cat /tmp/install.tmp2 | tr ' ' '\n' | while read LINE; do pkgname=`echo $LINE | awk '{print $1}'` sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET yn='yes' WHERE name='$pkgname'"; done rm -f /tmp/install.tmp* INSTALL ;; *) rm -f /tmp/pacman.instchoice INSTALL ;; esac } CINSTALL () { if [ ! -f /etc/pacmenu/pacmenu.cat ]; then dialog --infobox "The Category Template File is missing.\n\n\ Press enter to return to the main menu." 6 44 read main fi ICATMENU () { cat /etc/pacmenu/pacmenu.cat | while read LINE; do echo -n "$LINE $LINE-category ">>/tmp/pacmenu.catlist done catlistmenu="`cat /tmp/pacmenu.catlist`" rm -f /tmp/pacmenu.catlist dialog --clear --title "Pacman Category Selection Menu" --menu \ "\n Please select the category to install packages from \n" 23 70 15 \ $catlistmenu 2>/tmp/pacman.catchoice case $? in 0) CATEGORY=`cat /tmp/pacman.catchoice` rm -f /tmp/pacman.catchoice ;; *) rm -f /tmp/pacman.catchoice INSTALL ;; esac } ICATMENU # dialog --infobox "Please wait...Creating Package Install Menu" 3 48 pkginstmenu=`sqlite /var/lib/pacmenu/pacmenu.db "select name,ver from pkgs WHERE yn='no' AND category='$CATEGORY'" | sed 's/|/ /g' | sed 's/$/ off /g' | sort ` if [ -n "$pkginstmenu" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No new packages to install.' \ 6 50 rm -f /tmp/pacman.catchoice INSTALL fi dialog --clear --title "Pacman Package Install Menu" --checklist \ "\n Please select the package to install from the $CATEGORY category \n Package Name Package Version" 23 70 15 \ $pkginstmenu 2>/tmp/pacman.instchoice case $? in 0) pkgpick=`cat /tmp/pacman.instchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No new packages to install.' \ 6 50 rm -f /tmp/pacman.instchoice INSTALL fi rm -f /tmp/pacman.instchoice echo "PLease wait..." $pacinstall $pkgpick echo "" echo "Press any key to continue.." read KEY dialog \ --title 'Information' \ --msgbox 'Finished installing package(s).' \ 6 50 echo "$pkgpick" >/tmp/install.tmp1 cat /tmp/install.tmp1 | tr ' ' '\n' | awk '{print $1}' > /tmp/install.tmp2 cat /tmp/install.tmp2 | tr ' ' '\n' | while read LINE; do pkgname=`echo $LINE | awk '{print $1}'` sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET yn='yes' WHERE name='$pkgname'"; done rm -f /tmp/install.tmp* INSTALL ;; *) # rm -f /tmp/pacman.instchoice INSTALL ;; esac } GINSTALL () { dialog --infobox "Please wait...Creating Group Install Menu" 3 48 pacman -Sg >/tmp/pacman.tmpinst sort /tmp/pacman.tmpinst > /tmp/pacman.inst rm -f /tmp/pacman.tmpinst pacman -Qg | awk '{print $1}' >/tmp/pacman.installedu uniq /tmp/pacman.installedu > /tmp/pacman.installed rm -f /tmp/pacmenu.instmenu /tmp/pacman.installedu cat /tmp/pacman.inst | while read LINE; do pkgname="$LINE" tst="" tst="`grep $pkgname /tmp/pacman.installed`" echo $tst | while read LINE2; do tst2="$tst2 `echo -n $LINE2`" done if [ "$tst" = "" ]; then echo -n "$pkgname $pkgname-group off ">>/tmp/pacmenu.instmenu else case $tst2 in $pkgname) echo -n "$pkgname $pkgname-group off ">>/tmp/pacmenu.instmenu ;; esac fi done rm -f /tmp/pacman.inst /tmp/pacman.installed pkginstmenu=`cat /tmp/pacmenu.instmenu` rm -f /tmp/pacmenu.instmenu dialog --clear --title "Pacman Group Package Install Menu" --checklist \ "\n Please select the groups to install" 23 70 15 \ $pkginstmenu 2>/tmp/pacman.instchoice case $? in 0) pkgpick=`cat /tmp/pacman.instchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No group was selected.' \ 6 50 rm -f /tmp/pacman.instchoice INSTALL fi rm -f /tmp/pacman.instchoice echo "PLease wait..." $pacinstall $pkgpick echo "" echo "Press any key to continue.." read KEY dialog \ --title 'Information' \ --msgbox 'Finished installing group packages.' \ 6 50 echo "$pkgpick" >/tmp/install.tmp1 cat /tmp/install.tmp1 | tr ' ' '\n' | awk '{print $1}' > /tmp/install.tmp2 cat /tmp/install.tmp2 | tr ' ' '\n' | while read LINE; do pkgname=`echo $LINE | awk '{print $1}'` sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET yn='yes' WHERE name='$pkgname'"; done rm -f /tmp/install.tmp* INSTALL ;; *) rm -f /tmp/pacman.instchoice INSTALL ;; esac } VIEWREPO () { dialog --clear --title "New in Arch repos" --menu \ "\n\n Select the function you want and press enter \n\n\n" 15 70 2 \ "NEWINREP" "List of new in repos" \ "NEWRESET" "Reset new repo list" 2>/tmp/pacnew.tmp case $? in 0) CHOICE=`cat /tmp/pacnew.tmp` rm -f /tmp/pacnew.tmp $CHOICE ;; *) main ;; esac } NEWINREP () { [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -r echo "List of new:" >/tmp/listing.out echo " " >>/tmp/listing.out dialog --infobox "Please wait...Creating Package List" 3 50 sqlite /var/lib/pacmenu/pacmenu.db "SELECT pkgs.name,desc.description,pkgs.category FROM pkgs,desc WHERE pkgs.status='new' AND pkgs.name = desc.name" | sort >>/tmp/listing.out dialog \ --title 'New packages in Arch repos' \ --textbox /tmp/listing.out \ 15 70 rm -f /tmp/listing.out INSTALL } NEWRESET () { dialog --infobox "Please wait...Restting" 3 50 sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET status='old'"; dialog \ --title 'Information' \ --msgbox 'Finished resetting.' \ 6 50 INSTALL } VIEWPKG () { # dialog --infobox "Please wait...Creating Installed Package View" 3 48 pkginstmenu=`sqlite /var/lib/pacmenu/pacmenu.db "select name,ver from pkgs WHERE yn='yes'" | sed 's/|/ /g' | sed 's/$/ on /g' | sort ` dialog --clear --title "Installed Package View" --checklist \ "\n Package Name Package Version" 23 70 15 \ $pkginstmenu 2>/tmp/pacman.instchoice case $? in 0) INSTALL ;; *) # rm -f /tmp/pacman.instchoice INSTALL ;; esac } ROLLBAK () { dialog --infobox "Please wait...Creating Package List Menu" 3 48 pkgremmenu=`sqlite /var/lib/pacmenu/pacmenu.db "select name,ver from pkgs WHERE yn='yes'" | sed 's/|/ /g' | sed 's/$/ off /g' | sort ` dialog --clear --title "Package Rollback Menu" --checklist \ "\n Please select the package (only one) to replace with old \n Package Name Package Version" 23 70 15 \ $pkgremmenu 2>/tmp/pacman.remchoice case $? in 0) pkgpicksql=`cat /tmp/pacman.remchoice` pkgpick=`cat /tmp/pacman.remchoice | sed 's/"//g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No package was selected.' \ 6 50 rm -f /tmp/pacman.remchoice INSTALL fi # rm -f /tmp/pacman.remchoice echo "PLease wait... checking at Arch ftp what're available." repo=`sqlite /var/lib/pacmenu/pacmenu.db "SELECT repo FROM pkgs WHERE name=$pkgpicksql"` echo "" echo -e "${GREEN}SNo Package Date Time${NORMAL}" w3m -dump http://ftp.nluug.nl/ftp/pub/os/Linux/distr/archlinux/$repo/os/i686/ | grep $pkgpick | awk '{print $3 " " $4 " " $5}' > /tmp/pkg1.tmp rm -f /tmp/pkg2.tmp cat /tmp/pkg1.tmp | while read LINE; do nu=$((nu+1)) echo -e "$nu-- $LINE" >> /tmp/pkg2.tmp done #Display cat /tmp/pkg1.tmp | while read LINE; do nu=$((nu+1)) echo -e "${YELLOW}$nu${NORMAL}-- $LINE" done another=""; answer="" while test "$answer" != "0" -a "$answer" != "0"; do echo "" echo -n "Enter SNo number or 0 to cancel: [0] " another=" another" read answer case "$answer" in [1-9]|1*|2*|3*) sed 's/--/ X/g' /tmp/pkg2.tmp | grep "$answer X" > /tmp/pkg1.tmp download=`awk '{print $3}' /tmp/pkg1.tmp` awk '{print $3}' /tmp/pkg1.tmp | sed 's/.pkg.tar.gz//g' | sed 's/[a-z]-/ /g' | awk '{print $2}' > /tmp/pkg2.tmp awk '{print $1}' /tmp/pkg2.tmp > /tmp/pkg3.tmp version=`cat /tmp/pkg3.tmp` echo -e "${YELLOW}Package:${NORMAL} $pkgpick" echo -e "${YELLOW}Version:${NORMAL} $version" echo -e "${YELLOW}Repo :${NORMAL} $repo" another=""; answer="" while test "$yesno" != "n" -a "$yesno" != "N"; do echo "" echo -n "Want to continue? [y/n]: [n] " yesno=" yesno" read yesno case "$yesno" in y*|Y*) # Remove installed package pacman -Rd $pkgpick # Download and install old package cd /tmp wget http://ftp.nluug.nl/ftp/pub/os/Linux/distr/archlinux/$repo/os/i686/$download pacman -A $download rm -f $download rm -f /tmp/*.tmp break; ;; esac # If no selected #exit done break; ;; esac # If no selected echo -e "0 selected${NORMAL}" #exit done # Updating DB sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET ver='$version' WHERE name='$pkgpick'"; dialog \ --title 'Information' \ --msgbox 'Finished rolling back.' \ 6 50 REMOVE ;; *) rm -f /tmp/pacman.remchoice REMOVE ;; esac } PREMOVE () { dialog --infobox "Please wait...Creating Package Remove Menu" 3 48 pkgremmenu=`sqlite /var/lib/pacmenu/pacmenu.db "select name,ver from pkgs WHERE yn='yes'" | sed 's/|/ /g' | sed 's/$/ off /g' | sort ` dialog --clear --title "Pacman Package Remove Menu" --checklist \ "\n Please select the package to remove \n Package Name Package Version" 23 70 15 \ $pkgremmenu 2>/tmp/pacman.remchoice case $? in 0) pkgpick=`cat /tmp/pacman.remchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No package was selected.' \ 6 50 rm -f /tmp/pacman.remchoice INSTALL fi rm -f /tmp/pacman.remchoice echo "PLease wait..." $pacremove $pkgpick echo "" echo "Press any key to continue.." read KEY dialog \ --title 'Information' \ --msgbox 'Finished removing package(s).' \ 6 50 echo "$pkgpick" >/tmp/remv.tmp1 cat /tmp/remv.tmp1 | tr ' ' '\n' > /tmp/remv.tmp2 cat /tmp/remv.tmp2 | while read LINE; do pkgname=`echo $LINE | awk '{print $1}'` sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET yn='no' WHERE name='$pkgname'"; done rm -f /tmp/remv.tmp* REMOVE ;; *) rm -f /tmp/pacman.remchoice REMOVE ;; esac } CREMOVE () { if [ ! -f /etc/pacmenu/pacmenu.cat ]; then dialog --infobox "The Category Template File is missing.\n\n\ Press enter to return to the main menu." 6 44 read main fi RCATMENU () { cat /etc/pacmenu/pacmenu.cat | while read LINE; do echo -n "$LINE $LINE-category ">>/tmp/pacmenu.catlist done catlistmenu="`cat /tmp/pacmenu.catlist`" rm -f /tmp/pacmenu.catlist dialog --clear --title "Pacman Category Selection Menu" --menu \ "\n Please select the category to remove packages from \n" 23 70 15 \ $catlistmenu 2>/tmp/pacman.catchoice case $? in 0) CATEGORY=`cat /tmp/pacman.catchoice` rm -f /tmp/pacman.catchoice ;; *) rm -f /tmp/pacman.catchoice REMOVE ;; esac } RCATMENU # dialog --infobox "Please wait...Creating Package Remove Menu" 3 48 pkgremmenu=`sqlite /var/lib/pacmenu/pacmenu.db "select name,ver from pkgs WHERE yn='yes' AND category='$CATEGORY'" | sed 's/|/ /g' | sed 's/$/ off /g' | sort ` dialog --clear --title "Pacman Package Remove Menu" --checklist \ "\nPlease select the package from $CATEGORY to remove \n Package Name Package Version" 23 70 15 \ $pkgremmenu 2>/tmp/pacman.remchoice case $? in 0) pkgpick=`cat /tmp/pacman.remchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No package was selected.' \ 6 50 rm -f /tmp/pacman.remchoice INSTALL fi rm -f /tmp/pacman.remchoice echo "PLease wait..." $pacremove $pkgpick echo "" echo "Press any key to continue.." read KEY dialog \ --title 'Information' \ --msgbox 'Finished removing package(s).' \ 6 50 echo "$pkgpick" >/tmp/remv.tmp1 cat /tmp/remv.tmp1 | tr ' ' '\n' > /tmp/remv.tmp2 cat /tmp/remv.tmp2 | while read LINE; do pkgname=`echo $LINE | awk '{print $1}'` sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET yn='no' WHERE name='$pkgname'"; done rm -f /tmp/remv.tmp* REMOVE ;; *) rm -f /tmp/pacman.remchoice RCATMENU ;; esac } GREMOVE () { rm -f /tmp/pacmenu.remove dialog --infobox "Please wait...Creating Group Remove Menu" 3 48 pacman -Qg | awk '{print $1}' >/tmp/pacman.installedu uniq /tmp/pacman.installedu > /tmp/pacman.installed rm -f /tmp/pacman/installedu cat /tmp/pacman.installed | while read LINE; do pkgname="$LINE" echo -n "$pkgname $pkgname-group off ">>/tmp/pacmenu.remove done rm -f /tmp/pacman.installed pkgremmenu=`cat /tmp/pacmenu.remove` rm -f /tmp/pacmenu.remove dialog --clear --title "Pacman Group Package Remove Menu" --checklist \ "\n Please select the groups to remove" 23 70 15 \ $pkgremmenu 2>/tmp/pacman.remchoice case $? in 0) pkgpick=`cat /tmp/pacman.remchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No group was selected.' \ 6 50 rm -f /tmp/pacman.remchoice INSTALL fi rm -f /tmp/pacman.remchoice echo "PLease wait..." $pacremove $pkgpick echo "" echo "Press any key to continue.." read KEY dialog \ --title 'Information' \ --msgbox 'Finished removing group packages.' \ 6 50 echo "$pkgpick" >/tmp/remv.tmp1 cat /tmp/remv.tmp1 | tr ' ' '\n' > /tmp/remv.tmp2 cat /tmp/remv.tmp2 | while read LINE; do pkgname=`echo $LINE | awk '{print $1}'` sqlite /var/lib/pacmenu/pacmenu.db "UPDATE pkgs SET yn='no' WHERE name='$pkgname'"; done rm -f /tmp/remv.tmp* REMOVE ;; *) rm -f /tmp/pacman.remchoice REMOVE ;; esac } DEPVIEW () { if [ -f /var/lib/pacmenu/pacmenu.db ]; then dummy="" else if [ -f /etc/pacmenu/install.new ]; then dialog \ --title 'Information' \ --msgbox 'You need to refresh the package database.' \ 6 50 main fi fi # dialog --infobox "Please wait...Creating Package List Menu" 3 48 pkginstmenu=`sqlite /var/lib/pacmenu/pacmenu.db "SELECT name,ver FROM pkgs WHERE yn='yes'" | sed 's/|/ /g' | sed 's/$/ off /g' | sort ` dialog --clear --title "Pacman Package List" --checklist \ "\n Please select the package to check dependency tree \n Package Name Package Version" 23 70 15 \ $pkginstmenu 2>/tmp/pacman.instchoice case $? in 0) pkgpick=`cat /tmp/pacman.instchoice | sed 's/"/ /g'` if [ -n "$pkgpick" ];then dummy="" else dialog \ --title 'Information' \ --msgbox 'No package was selected.' \ 6 50 rm -f /tmp/pacman.instchoice main fi rm -f /tmp/pacman.instchoice clear echo -e "${YELLOW}Please wait....${NORMAL}" /usr/sbin/pacmanDeps.sh $pkgpick echo " " echo "Press enter to continue" read main ;; *) rm -f /tmp/pacman.instchoice main ;; esac } REFRESH () { dialog \ --title "Refresh package database" \ --yesno "\nThis will generate/refresh new database. To keep it updated, its recommended to refresh only when new packages in repos. \ \n\nDepending on number of packages, may take take 60 seconds or more.\ \n\nDo you want to continue?\n\n" \ 12 70 case $? in 0) [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -n [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -r FAILED=`grep "Download failed" /tmp/listing.out` if [ "$FAILED" ]; then dialog \ --title 'Warning' \ --msgbox 'Download failed!!' \ 5 50 rm -f /tmp/listing.out main else [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -d echo "Last database refresh:" > /etc/pacmenu/refresh.last date >> /etc/pacmenu/refresh.last fi # $pacrefresh dialog \ --title 'Log list' \ --textbox /tmp/listing.out \ 18 50 rm -f /tmp/listing.out main ;; esac main } AREFRESH () { if [ -f /var/lib/pacmenu/pacmenu.db ]; then dummy="" else if [ -f /etc/pacmenu/install.new ]; then dialog \ --title 'Information' \ --msgbox 'You need to refresh the package database.' \ 6 50 main fi fi clear $absrefresh echo " " echo "Finished Refreshing the Arch Build System." echo " " echo "Press enter to continue" read } SYNCHPKG () { if [ -f /var/lib/pacmenu/pacmenu.db ]; then dummy="" else if [ -f /etc/pacmenu/install.new ]; then dialog \ --title 'Information' \ --msgbox 'You need to refresh the package database.' \ 6 50 main fi fi clear $pacrefresh echo "" echo "Updating new in repos and version numbers..." [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -r [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -u echo " " echo "Finished Updating the system" echo " " echo "Press enter to continue" read } UPDATESYS () { if [ -f /var/lib/pacmenu/pacmenu.db ]; then dummy="" else if [ -f /etc/pacmenu/install.new ]; then dialog \ --title 'Information' \ --msgbox 'You need to refresh the package database.' \ 6 50 main fi fi clear $pacupdate echo "" echo "Updating new in repos and version numbers..." [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -r [ -x /usr/sbin/pkg2db ] && /usr/sbin/pkg2db -u echo " " echo "Finished Updating the system" echo " " echo "Press enter to continue" read } EXIT () { exit 0 } #Check for a global config file if someone wants to make some changes if [ -f /etc/pacmenu.conf ]; then . /etc/pacmenu.conf else #just use the defaults below if there is no global config file pacinstall="pacman -S " pacremove="pacman -Rc " pacrefresh="pacman -Sy" pacupdate="pacman -Syu" absrefresh="abs" fi #check for the Category template file if [ ! -f /etc/pacmenu/pacmenu.cat ]; then dialog --clear --title "The Category Template File does not exist" \ --yesno "\nWithout it, the Install by Category and Remove by Category menus will not work. \n\ \nDo you want to fetch it from the Arch Linux ftp site now?" 9 70 case $? in 0) CATEGORY ;; esac fi while [ 0 ]; do main done