build-rpms: drop any 'depends on self' from dependency calculations

Depends on self creates false loops and results in sub-optimal
compile orders.

Change-Id: I429b79fed58d0edea20df68a883caafbddf8a07c
Story: 2002835
Task: 24519
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Scott Little 2018-03-28 16:48:01 -04:00
parent 0a6896a217
commit b7e024664d
2 changed files with 12 additions and 2 deletions

View File

@ -1996,8 +1996,13 @@ if [ $CLEAN_FLAG -eq 0 ] && [ $NO_DESCENDANTS -eq 0 ] && [ -f $SRPM_DIRECT_DESCE
# Iterate over binary rpms names required by the candidate package
for r in $(grep "^$n;" "$SRPM_RPM_DIRECT_REQUIRES_FILE" | sed "s/$n;//" | sed 's/,/ /g'); do
if [ $r == $n ]; then
# Ignore self dependency
continue
fi
# find a required rpm file with the rpm name we seek, AND is newer than the produced rpm file
for rp in $(find $(echo $RPM_DIR | sed "s#/$BUILD_TYPE/#/std/#") -name "$r-[0-9]*.rpm" -cnewer $bp | grep -v '.src.rpm'); do
for rp in $(find $(echo $RPM_DIR | sed "s#/$BUILD_TYPE/#/std/#") -name "$r-[0-9]*.rpm" -newermm $bp | grep -v '.src.rpm'); do
if [ "$r" != "$(rpm_get_name $rp)" ]; then
# rpm name doesn't match
continue

View File

@ -972,8 +972,13 @@ if [ $CLEAN_FLAG -eq 0 ] && [ $NO_DESCENDANTS -eq 0 ] && [ -f $SRPM_DIRECT_DESCE
# Iterate over binary rpms names required by the candidate package
for r in $(grep "^$n;" "$SRPM_RPM_DIRECT_REQUIRES_FILE" | sed "s/$n;//" | sed 's/,/ /g'); do
if [ $r == $n ]; then
# Ignore self dependency
continue
fi
# find a required rpm file with the rpm name we seek, AND is newer than the produced rpm file
for rp in $(find $(echo $RPM_DIR | sed "s#/$BUILD_TYPE/#/std/#") -name "$r-[0-9]*.rpm" -cnewer $bp | grep -v '.src.rpm'); do
for rp in $(find $(echo $RPM_DIR | sed "s#/$BUILD_TYPE/#/std/#") -name "$r-[0-9]*.rpm" -newermm $bp | grep -v '.src.rpm'); do
if [ "$r" != "$(rpm_get_name $rp)" ]; then
# rpm name doesn't match
continue