repo-clean 367 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. root="$(readlink -f $(dirname $BASH_SOURCE)/..)";
  3. . $root/etc/packages.conf
  4. _clean(){
  5. echo -e "\t$1";
  6. cd $root/src/$1;
  7. rm -f *.pkg.tar.xz;
  8. }
  9. echo "Cleaning...";
  10. if [[ "$1" == "" ]];then
  11. for val in "${packages[@]}"; do
  12. unset package;
  13. declare -A package;
  14. eval "package=($val)";
  15. _clean "${package[name]}";
  16. done;
  17. else
  18. _clean $1;
  19. fi;
  20. echo "Done";