]> git.pld-linux.org Git - packages/rpm-build-tools.git/commitdiff
- add support for rpmspec tool for fetching buidlrequires/conflict
authorAdam Gołębiowski <adamg@pld-linux.org>
Tue, 11 May 2021 10:20:47 +0000 (10:20 +0000)
committerAdam Gołębiowski <adamg@pld-linux.org>
Tue, 11 May 2021 10:20:47 +0000 (10:20 +0000)
builder.sh

index 428071e3c1cbd41986e4d7988e09462e42f7bfbe..1f522b06b010e0bfe0eb97fc21d10c80b16e2577 100755 (executable)
@@ -151,9 +151,13 @@ REVERT_BROKEN_UPGRADE="yes"
 
 if rpm --specsrpm 2>/dev/null; then
        FETCH_BUILD_REQUIRES_RPMSPECSRPM="yes"
 
 if rpm --specsrpm 2>/dev/null; then
        FETCH_BUILD_REQUIRES_RPMSPECSRPM="yes"
+       FETCH_BUILD_REQUIRES_RPMSPEC_BINARY="no"
        FETCH_BUILD_REQUIRES_RPMGETDEPS="no"
        FETCH_BUILD_REQUIRES_RPMGETDEPS="no"
-else
+elif [ -x /usr/bin/rpmspec ]; then
        FETCH_BUILD_REQUIRES_RPMSPECSRPM="no"
        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
        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
                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)
        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"
        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
                install_build_requires_rpmdeps
                return
        fi
This page took 0.046575 seconds and 4 git commands to generate.