RUN touch /var/lib/rpm/* && \
- yum upgrade -y && yum install -y python3
+ if $(grep -q 'release 7' /etc/redhat-release); then \
+ yum upgrade -y && yum install -y python2 python2-dnf; \
+ else \
+ yum upgrade -y && yum install -y python3 python3-dnf; \
+ fi
ADD builder-support/helpers/ /pdns/builder-support/helpers/
@IF [ -n "$M_recursor$M_all" ]
-RUN cd /pdns/builder-support/helpers/ && python3 generate-sbom-dnf.py /dist/pdns-recursor-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json pdns-recursor rust.json
+RUN cd /pdns/builder-support/helpers/ && \
+ if ! $(grep -q 'release 7' /etc/redhat-release); then \
+ python3 generate-sbom-dnf.py /dist/pdns-recursor-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json pdns-recursor rust.json; \
+ else \
+ python2 generate-sbom-dnf.py /dist/pdns-recursor-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json pdns-recursor rust.json; \
+ fi
@ENDIF
@IF [ -n "$M_dnsdist$M_all" ]
RUN cd /pdns/builder-support/helpers/; \
if ! $(grep -q 'release 7' /etc/redhat-release); then \
- python3 generate-sbom-dnf.py /dist/dnsdist-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json dnsdist rust.json quiche.json h2o.json ; \
+ python3 generate-sbom-dnf.py /dist/dnsdist-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json dnsdist rust.json quiche.json h2o.json; \
else \
- python3 generate-sbom-dnf.py /dist/dnsdist-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json dnsdist h2o.json ; \
+ python2 generate-sbom-dnf.py /dist/dnsdist-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json dnsdist h2o.json; \
fi
@ENDIF
@IF [ -n "$M_authoritative$M_all" ]
RUN cd /pdns/builder-support/helpers/ && \
for pkg in pdns pdns-backend-geoip pdns-backend-ldap pdns-backend-lmdb pdns-backend-lua2 pdns-backend-mysql pdns-backend-odbc pdns-backend-postgresql pdns-backend-remote pdns-backend-sqlite pdns-backend-tinydns pdns-backend-ixfrdist pdns-tools; do \
- python3 generate-sbom-dnf.py /dist/${pkg}-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json ${pkg}; \
+ if ! $(grep -q 'release 7' /etc/redhat-release); then \
+ python3 generate-sbom-dnf.py /dist/${pkg}-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json ${pkg}; \
+ else \
+ python2 generate-sbom-dnf.py /dist/${pkg}-${BUILDER_VERSION}-${BUILDER_TARGET}.cyclonedx.json ${pkg}; \
+ fi \
done
@ENDIF