github.com/sijibomii/docker@v0.0.0-20231230191044-5cf6ca554647/hack/make/clean-yum-repo (about)

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