clean-yum-repo 621 B

1234567891011121314151617181920
  1. #!/usr/bin/env bash
  2. set -e
  3. # This script cleans the experimental pool for the yum repo.
  4. # This is useful when there are a lot of old experimental rpms and you only want to keep the most recent.
  5. #
  6. : ${DOCKER_RELEASE_DIR:=$DEST}
  7. YUMDIR=$DOCKER_RELEASE_DIR/yum/repo/experimental
  8. suites=( $(find "$YUMDIR" -mindepth 1 -maxdepth 1 -type d) )
  9. for suite in "${suites[@]}"; do
  10. echo "cleanup in: $suite"
  11. ( set -x; repomanage -k2 --old "$suite" | xargs rm -f )
  12. done
  13. echo "You will now want to: "
  14. echo " - re-sign the repo with hack/make/sign-repo"
  15. echo " - re-generate index files with hack/make/generate-index-listing"