summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5f25b73)
This removes the O(n^3) loop.
# We will require the mapping of all source packages to the
# list of binary packages they build, so work this out in advance.
# We will require the mapping of all source packages to the
# list of binary packages they build, so work this out in advance.
for p in %fedora-source-packages; do
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
- for r in $(rpmspec -q --buildrequires $specfile 2>/dev/null |
+ for b in $(rpmspec -q --buildrequires $specfile 2>/dev/null |
- # 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