Fedora CI: Test that no unexpected dependency was added

This commit is contained in:
Miro Hrončok 2021-11-16 19:27:26 +01:00
parent 09b13a3ec4
commit f895eeaa56
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,11 @@
coreutils
dwz
rpm
zip
/usr/bin/bash
/usr/bin/file
/usr/bin/find
/usr/bin/grep
/usr/bin/sed
/usr/bin/sh
/usr/bin/xargs

View File

@ -0,0 +1,11 @@
#!/bin/bash -ex
# we diff most of the dependencies against our list in requires.txt
# generally, a new dependency is bad, for exceptional cases, we can add it to the list together with the change
# we intentionally grep out:
# -srpm-macros and -rpm-macros
# rpmlib(...)
# conditional dependencies (they contain if)
# at the end, we strip the versions with cut
diff -u <(cat $(dirname $0)/requires.txt | sort | uniq) \
<(rpm -q --requires redhat-rpm-config | grep -Ev -- '-s?rpm-macros(\s|$)|^rpmlib\(|\sif\s' | cut -d' ' -f1 | sort | uniq)

View File

@ -31,6 +31,9 @@
- gcc
- gcc-c++
- annobin-annocheck
# no-new-dependency
- diffutils
- grep
repositories:
- repo: https://src.fedoraproject.org/tests/clang.git
dest: clang
@ -40,3 +43,4 @@
run: "dnf -y build-dep {{ tenv_workdir }}/redhat-rpm-config.spec && rpmbuild --define '_sourcedir {{ tenv_workdir }}' -ba {{ tenv_workdir }}/redhat-rpm-config.spec"
- clang/fedora-flags
- gcc-fedora-flags
- no-new-dependency