#!/bin/bash REPO=$HOME/cfo-repo/ RAWHIDE_YUM_CONF_64=$HOME/lib/repoc/conf/rawhide-x86_64.conf RAWHIDE_YUM_CONF_32=$HOME/lib/repoc/conf/rawhide-i686.conf BRANCHED_YUM_CONF_64=$HOME/lib/repoc/conf/branched-x86_64.conf BRANCHED_YUM_CONF_32=$HOME/lib/repoc/conf/branched-i686.conf ARCHLIST_64=x86_64,noarch ARCHLIST_32=i386,i686,noarch export http_proxy=http://yum.intra.city-fan.org:3128/ export ftp_proxy=http://yum.intra.city-fan.org:3128/ cd $REPO grok_build_deps () { YUM_CONF="$1" ARCHLIST="$2" REPO_TOP="$3" REQUIRED_ITEMS=/tmp/required-items.$$ REQUIRED_PKGS=/tmp/required-pkgs.$$ ( # Buildroot package list yum -c $YUM_CONF -q groupinfo buildsys-build | grep '^ ' | tr -d ' ' # SRPM buildreqs for pkg in $(cfo-srpm-list $YUM_CONF) do rpm -qp --requires $pkg done ) | sort -u > $REQUIRED_ITEMS # Figure out what packages provide these requirements repoquery -c $YUM_CONF --archlist $ARCHLIST --qf='%{NAME}' --whatprovides $(cat $REQUIRED_ITEMS) | sort -u > $REQUIRED_PKGS # Figure out what packages are pulled in by these requirements repoquery -c $YUM_CONF --archlist $ARCHLIST --output=ascii-tree --requires $(cat $REQUIRED_PKGS) | sed -e 's/\[.*//' | awk '{print $NF}' | sed -e 's/-[^-]*-[^-]*$//; s/^[0-9]*://' | sort -u | awk '{ printf "\t%s\n", $1 }' rm -f $REQUIRED_ITEMS $REQUIRED_PKGS } grok_build_deps $RAWHIDE_YUM_CONF_64 $ARCHLIST_64 $REPO > $HOME/lib/rawhide-pkgs-x86_64.conf grok_build_deps $RAWHIDE_YUM_CONF_32 $ARCHLIST_32 $REPO > $HOME/lib/rawhide-pkgs-x86_32.conf grok_build_deps $BRANCHED_YUM_CONF_64 $ARCHLIST_64 $REPO > $HOME/lib/branched-pkgs-x86_64.conf grok_build_deps $BRANCHED_YUM_CONF_32 $ARCHLIST_32 $REPO > $HOME/lib/branched-pkgs-x86_32.conf