Advertisement
HiImTye

pacman installer functions

May 11th, 2019
124
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.06 KB | None | 0 0
  1. # check if pacsrv installed and set it as our installer
  2. if [ -a /usr/bin/pacsrv ]; then
  3.  export installer=pacsrv
  4. else
  5.  export installer=pacman
  6. fi
  7.  
  8. # use pacman to do a full system update
  9. function update {
  10.  sudo $installer -Syu
  11.  sudo /storage/Launchers/updateCount # update our count of available packages
  12.  checkUpdates | head -n 1
  13. }
  14.  
  15. function aur {
  16.  git clone https://aur.archlinux.org/"$1".git
  17. }
  18.  
  19. function mkpkg {
  20.  makepkg -s "$@"
  21.  if [ "$?" = 0 ]; then
  22.   mv *.pkg.tar.xz ..
  23.   cd ..
  24.  fi
  25. }
  26.  
  27. # use pacman to install compiled packages and update our number of available updates
  28. function install {
  29.  # check if we're supplied anything
  30.  if [ -n "$1" ]; then
  31.   # install specific packages
  32.   echo installing "$@"
  33.   sudo $installer -U "$@"
  34.  else
  35.   # install all packages in current working directory
  36.   echo installing all packages
  37.   echo Package list:
  38.   l *.pkg.tar.xz
  39.   sudo $installer -U *.pkg.tar.xz
  40.  fi
  41.  if [ "$?" = 0 ]; then
  42.   cd ..
  43.  fi
  44.  
  45.  sudo /storage/Launchers/updateCount # update our count of available packages
  46.  checkUpdates | head -n 1
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement