1
0

clean-distfiles_googlecode.sh 966 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #!/bin/sh
  2. # clean-distfiles_googlecode.sh
  3. googleproject="rion-overlay"
  4. manifests="$(find -type f -name Manifest)"
  5. if [ "x$manifests" = "x" ];
  6. then
  7. echo "No Manifests in current directory"
  8. exit 1
  9. fi
  10. # list of distfiles
  11. grep -e DIST \
  12. $manifests |\
  13. awk '{print $2}'|\
  14. sort -u > /tmp/distfiles_overlay
  15. # list of downloads
  16. wget -O- \
  17. "http://code.google.com/p/${googleproject}/downloads/list?can=1&q=&colspec=Filename" |\
  18. grep \
  19. -e "http://${googleproject}.googlecode.com/files/" |\
  20. sed \
  21. -e "s#^ <a href=\"http://${googleproject}.googlecode.com/files/\([^\"]*\)\".*#\1#" |\
  22. sort > /tmp/distfiles_googlecode
  23. # removed from overlay
  24. diff --unchanged-line-format='' --old-line-format='' --new-line-format='%L' \
  25. /tmp/distfiles_overlay \
  26. /tmp/distfiles_googlecode \
  27. |sort > /tmp/distfiles_remove
  28. #cat /tmp/distfiles_remove
  29. while read f
  30. do
  31. xdg-open "http://code.google.com/p/${googleproject}/downloads/delete?name=${f}" &
  32. done < /tmp/distfiles_remove