From: Adam Gołębiowski Date: Tue, 11 May 2021 10:20:47 +0000 (+0000) Subject: - add support for rpmspec tool for fetching buidlrequires/conflict X-Git-Tag: auto/th/rpm-build-tools-4.10-1~3 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm-build-tools.git;a=commitdiff_plain;h=9439a215500ef79bd92e3c1a8f80932c8c3ee57c - add support for rpmspec tool for fetching buidlrequires/conflict --- diff --git a/builder.sh b/builder.sh index 428071e..1f522b0 100755 --- a/builder.sh +++ b/builder.sh @@ -151,9 +151,13 @@ REVERT_BROKEN_UPGRADE="yes" if rpm --specsrpm 2>/dev/null; then FETCH_BUILD_REQUIRES_RPMSPECSRPM="yes" + FETCH_BUILD_REQUIRES_RPMSPEC_BINARY="no" FETCH_BUILD_REQUIRES_RPMGETDEPS="no" -else +elif [ -x /usr/bin/rpmspec ]; then FETCH_BUILD_REQUIRES_RPMSPECSRPM="no" + FETCH_BUILD_REQUIRES_RPMSPEC_BINARY="yes" + FETCH_BUILD_REQUIRES_RPMGETDEPS="no" +else if [ -x /usr/bin/rpm-getdeps ]; then FETCH_BUILD_REQUIRES_RPMGETDEPS="yes" else @@ -2035,6 +2039,10 @@ install_build_requires_rpmdeps() { CNFL=$(eval rpm-getdeps $BCOND $RPMOPTS $SPECFILE 2> /dev/null | awk '/^\-/ { print $3 } ' | _rpm_cnfl_check | xargs) DEPS=$(eval rpm-getdeps $BCOND $RPMOPTS $SPECFILE 2> /dev/null | awk '/^\+/ { print $3 } ' | _rpm_prov_check | xargs) fi + if [ "$FETCH_BUILD_REQUIRES_RPMSPEC_BINARY" = "yes" ]; then + CNFL=$(eval rpmspec --query --conflicts $BCOND $RPMOPTS $SPECFILE 2> /dev/null | awk '{print $1}' | _rpm_cnfl_check | xargs); + DEPS=$(eval rpmspec --query --buildrequires $BCOND $RPMOPTS $SPECFILE 2> /dev/null | awk '{print $1}' | _rpm_prov_check | xargs); + fi if [ "$FETCH_BUILD_REQUIRES_RPMSPECSRPM" = "yes" ]; then CNFL=$(eval rpm -q --specsrpm --conflicts $BCOND $RPMOPTS $SPECFILE | awk '{print $1}' | _rpm_cnfl_check | xargs) DEPS=$(eval rpm -q --specsrpm --requires $BCOND $RPMOPTS $SPECFILE | awk '{print $1}' | _rpm_prov_check | xargs) @@ -2058,7 +2066,7 @@ fetch_build_requires() fi update_shell_title "fetch build requires" - if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ] || [ "$FETCH_BUILD_REQUIRES_RPMSPECSRPM" = "yes" ]; then + if [ "$FETCH_BUILD_REQUIRES_RPMGETDEPS" = "yes" ] || [ "$FETCH_BUILD_REQUIRES_RPMSPECSRPM" = "yes" ] || [ "$FETCH_BUILD_REQUIRES_RPMSPEC_BINARY" = "yes" ]; then install_build_requires_rpmdeps return fi