Skip to content

Instantly share code, notes, and snippets.

@lmacken
Created March 28, 2014 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lmacken/9826113 to your computer and use it in GitHub Desktop.
Save lmacken/9826113 to your computer and use it in GitHub Desktop.
rehash yum repo metadata
#!/bin/bash -x
# Re-hash yum repodata objects
# Pulls pieces of metadata out of the repodata and re-injects them, in order to
# use a different hash algorithm.
arch=x86_64
repo=/mnt/koji/mash/updates/el5-epel/$arch/repodata
cp -Rv $repo repodata
cp -R repodata repodata.$arch
function rehashmd {
cp repodata/*$1.gz .
gunzip *$1.gz
mv *$1 $1
modifyrepo --remove `echo $1 | cut -d. -f1` $(pwd)/repodata
python /usr/lib/python2.6/site-packages/bodhi/modifyrepo.py $1 $(pwd)/repodata
rm $1
}
rehashmd updateinfo.xml
rehashmd pkgtags.sqlite
sudo rsync -avr --delete repodata/ $repo/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment