You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
940 B
Bash

#!/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
restorecon -Rv $base_dir
for YUM in $base_dir/{SRPMS,i386,x86_64}; do
if [ -d $YUM ]; then
echo "== $YUM"
cd $YUM
# Fix permissions
chmod a+r *.rpm
chcon -t svirt_sandbox_file_t *.rpm
# Sign unsigned RPMs
unsigned=`rpm --checksig *.rpm | egrep -v ': .*pgp' | sed 's#:.*##'` || true
if [ ${#unsigned} != 0 ]; then
echo "Unsigned packages:"
echo "$unsigned"
rpmsign --addsign $unsigned
fi
# Create and sign repodata
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
fi
fi
done
done