Skip to content

Instantly share code, notes, and snippets.

@mikhailnov

mikhailnov/prov-req.sh

Last active Jul 10, 2020
Embed
What would you like to do?
#!/usr/bin/env bash
LIST="${LIST:-30 31 32}"
_gen(){
set -e
trap 'echo ERROR $line' ERR
line="$1"
fc="$2"
suffix="$(echo "$line" | tr '.' '\n' | grep ^fc | tail -n1)"
#if [ -f "fedora/linux/releases/${fc}/Everything/x86_64/os/Packages-provides/${name}.${suffix}.prov" ]; then
# return 0
#fi
name="$(rpm -qp --qf '%{NAME}' "$line")"
rpm -qp --provides "$line" >> "fedora/linux/releases/${fc}/Everything/x86_64/os/Packages-provides/${name}.${suffix}.prov"
rpm -qp --requires "$line" >> "fedora/linux/releases/${fc}/Everything/x86_64/os/Packages-requires/${name}.${suffix}.req"
rpm -qpl "$line" >> "fedora/linux/releases/${fc}/Everything/x86_64/os/Packages-files/${name}.${suffix}.files"
rpm -qp --qf '%{SOURCERPM}' "$line" >> "fedora/linux/releases/${fc}/Everything/x86_64/os/Packages-srpms/${name}.${suffix}.srpm"
}
export -f _gen
for fc in ${LIST}
do
mkdir -p fedora/linux/releases/${fc}/Everything/x86_64/os/Packages-{provides,requires,files,srpms}/
find fedora/linux/releases/${fc}/Everything/x86_64/os/Packages -type f -name '*.rpm' | grep -v '\.i686\.' | sort -u | xargs -P 4 -I {} bash -c "_gen {} "$fc" 2>/dev/null"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.