aur_update.sh 489 B

1234567891011121314151617181920212223242526
  1. #!/bin/sh
  2. # fail if any commands fails
  3. #set -e
  4. # debug log
  5. #set -x
  6. #for dir in ~/aur/*; do (cd "$dir" && pwd && git pull); done
  7. for dir in ~/aur/*; do
  8. cd "$dir" || exit
  9. pwd
  10. CURRENT_DIR=$(basename "$PWD")
  11. git fetch
  12. LOCAL=$(git rev-parse HEAD)
  13. REMOTE=$(git rev-parse @{u})
  14. if [ ! $LOCAL = $REMOTE ]; then
  15. pwd
  16. echo "Need to pull"
  17. git pull
  18. makepkg -sic --noconfirm
  19. fi
  20. rm -rf ./pkg/ ./src/ ./*.tar.* ./*.zip* ./*.tgz* ./*.bz* ./"${CURRENT_DIR}"
  21. done
  22. exit 0