dirty-helpers/gen-yum

38 lines
927 B
Text
Raw Normal View History

2015-11-21 17:51:40 +01:00
#!/bin/bash
# Setup YUM/DNF repository
GPG_KEY=F77BB18D
eval BASE_DIRS=~/www_static/dnf.bl0rg.net/*/*
set -e
for base_dir in $BASE_DIRS; do
2018-11-11 00:07:33 +01:00
# Fix permissions
chcon -t container_file_t -R $base_dir
chmod -R a+r $base_dir
2016-05-19 15:17:06 +02:00
for YUM in $base_dir/{SRPMS,i386,x86_64}; do
2015-11-21 17:51:40 +01:00
if [ -d $YUM ]; then
echo "== $YUM"
cd $YUM
2015-11-21 18:04:54 +01:00
2017-08-04 10:37:15 +02:00
# Sign unsigned RPMs
unsigned=`rpm --checksig *.rpm | egrep -v ': .*(pgp|signatures OK)' | sed 's#:.*##'` || true
2015-11-21 18:04:54 +01:00
if [ ${#unsigned} != 0 ]; then
echo "Unsigned packages:"
echo "$unsigned"
2017-08-04 10:37:15 +02:00
rpmsign --addsign $unsigned
2015-11-21 18:04:54 +01:00
fi
# Create and sign repodata
2015-11-21 17:51:40 +01:00
createrepo --update --checkts .
if [ ! -e repodata/repomd.xml.asc \
-o repodata/repomd.xml.asc -ot repodata/repomd.xml ]; then
rm -f repodata/repomd.xml.asc
gpg2 -u $GPG_KEY --detach-sign --armor repodata/repomd.xml
2015-11-21 17:51:40 +01:00
fi
2015-11-21 18:04:54 +01:00
2015-11-21 17:51:40 +01:00
fi
done
done