scripts

Scripts
git clone git://git.wimdupont.com/scripts.git
Log | Files | Refs | LICENSE

auru (688B)


      1 #!/bin/bash
      2 
      3 readonly AUR_DIR="$HOME/repositories/aur"
      4 readonly AUR_LIST=($(find "${AUR_DIR}" -type d -name '.git' | sed 's/\.git//g'))
      5 
      6 for aur in "${AUR_LIST[@]}"; do
      7 	cd "${aur}"
      8 	git_result=$(git pull)
      9 
     10 	test "${git_result}" == "Already up to date." && echo "${aur} up to date." && continue;
     11 
     12 	echo "${git_result}"
     13 
     14 	makepkg -rcsi
     15 
     16 	readarray -td '' aur_files < <(
     17 		printf -- 'choice\0%s\0' "${aur}/"*
     18 	)
     19 
     20 	IFS='|' read -ra to_delete <<< $(zenity --list --checklist --multiple --width=400 --height=500 --column=Choice --column=AUR --title "Select old-version files to delete." "${aur_files[@]}")
     21 
     22 	for file_to_delete in "${to_delete[@]}"; do
     23 		rm -rfv "${file_to_delete}"
     24 	done
     25 done