X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=stdlib%2Ffedora.gl;h=bbc80d9697cc7418695fe788438b1ff978572724;hb=c1b0373183f3fb4757981cb57ca163034fffdb3c;hp=8bcc09ad180180ece631a1e67ec33afb0717b76c;hpb=cda1f0160b96e57a0037085f33aa2d440453a30b;p=goals.git diff --git a/stdlib/fedora.gl b/stdlib/fedora.gl index 8bcc09a..bbc80d9 100644 --- a/stdlib/fedora.gl +++ b/stdlib/fedora.gl @@ -26,7 +26,7 @@ # of dist git. You must use the fedpkg clone -B command to # create separate branches. # -# %fedora-branch: Working branch, eg. "master". +# %fedora-branch: Working branch, eg. "rawhide". # %fedora-tag: Build tag, eg. "f32-build". # # %fedora-rebuild-name: @@ -114,7 +114,7 @@ is-koji-built ("%pkg") : # If we're not building for Rawhide then we must use the rightmost # (-r) flag so there's an upgrade path to Rawhide. rightmost= - if test %fedora-branch != "master"; then rightmost=-r; fi + if test %fedora-branch != "rawhide"; then rightmost=-r; fi # If the specfile doesn't have the magic string then add # that now. @@ -143,26 +143,16 @@ pure function fedora-source-dependencies (pkg) returning strings = @{ # We will require the mapping of all source packages to the # list of binary packages they build, so work this out in advance. - declare -A binpkgs + declare -A bin2src for p in %fedora-source-packages; do - binpkgs[$p]="$( - rpmspec -q --provides %fedora-dir/$p/%fedora-branch/$p.spec 2>/dev/null | - awk '{print $1}' - )" + for b in $(rpmspec -q --provides %fedora-dir/$p/%fedora-branch/$p.spec 2>/dev/null | awk '{print $1}'); do + bin2src[$b]=$p + done done - for r in $(rpmspec -q --buildrequires $specfile 2>/dev/null | + for b in $(rpmspec -q --buildrequires $specfile 2>/dev/null | awk '{print $1}'); do - # Now we examine each *other* source package to see - # if any will create this dependency when they build. - for p in %fedora-source-packages; do - if [ "$p" != %pkg ]; then - for f in ${binpkgs[$p]}; do - if [ "$f" = "$r" ]; then - echo "$p" - fi - done - fi - done - done | sort -u + # Find the source package that produces these binary requirements. + echo ${bin2src[$b]} + done | grep -v '^$' | sort -u }