diff options
author | David Naylor <dbn@FreeBSD.org> | 2017-06-18 18:09:16 +0000 |
---|---|---|
committer | David Naylor <dbn@FreeBSD.org> | 2017-06-18 18:09:16 +0000 |
commit | 9920d3ae657e820bce42911009136fc059210d0d (patch) | |
tree | 237480885bd130394dbcbc56f765540bba4416e2 /Mk/Scripts/qa.sh | |
parent | www/trac-iniadmin: remove trailing backtick from NO_ARCH (diff) |
qa: add check for NO_ARCH
If NO_ARCH is set then check that no FreeBSD elf(5) files are in $STAGEDIR.
If an elf(5) file is bundles as part of the package, but is not meant to be
run directly (i.e. the elf(5) file is a payload, and not compiled) then
those files can be added to NO_ARCH_IGNORE to avoid the check from failing,
Changes to ports:
- Ports that have NO_ARCH set, but actually compile files have had NO_ARCH
removed.
- Ports that have elf(5) payloads have had those files added to
NO_ARCH_IGNORE.
- R-cran ports that do not set USES=cran:compiles have NO_ARCH set,
PR: 218976
Reviewed by: antoine, mat
Approved by: portmgr
Diffstat (limited to 'Mk/Scripts/qa.sh')
-rw-r--r-- | Mk/Scripts/qa.sh | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index 024fce7e8fa7..ea6128b9bf8b 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -797,9 +797,35 @@ perlcore() { fi } +no_arch() { + [ -z "$NO_ARCH" ] && return + rc=0 + while read f; do + [ -z "$f" ] && continue + if [ -n "$NO_ARCH_IGNORE" ]; then + skip= + for blacklist in $NO_ARCH_IGNORE; do + case $f in + *$blacklist) skip=1; break;; + esac + done + [ "$skip" ] && continue + fi + err "'${f#.}' is a architecture specific binary file and you have set NO_ARCH. Either remove NO_ARCH or add '$(basename $f)' to NO_ARCH_IGNORE." + rc=1 + done <<-EOF + $(list_stagedir_elfs \ + | file -F $'\1' -f - -N \ + | grep -aE 'ELF .* [LM]SB .*, .*, version [0-9]+ \(FreeBSD\)' \ + | cut -f 1 -d $'\1') + EOF + return $rc +} + + checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo" checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" -checks="$checks proxydeps sonames perlcore" +checks="$checks proxydeps sonames perlcore no_arch" ret=0 cd ${STAGEDIR} |