Created
March 28, 2014 05:42
-
-
Save lmacken/9826113 to your computer and use it in GitHub Desktop.
rehash yum repo metadata
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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