summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-24 22:24:12 -0700
committerGeorgy Yakovlev <gyakovlev@gentoo.org>2021-06-26 16:08:22 -0700
commit4cc70444a0077f9b807593ab322d05a6b3737666 (patch)
tree3fb768ade4bf1e3d9754958a13cdfc82689e998d /metadata
parentsys-kernel/installkernel-systemd-boot: strip exec bit from file (diff)
downloadgentoo-4cc70444a0077f9b807593ab322d05a6b3737666.tar.gz
gentoo-4cc70444a0077f9b807593ab322d05a6b3737666.tar.bz2
gentoo-4cc70444a0077f9b807593ab322d05a6b3737666.zip
metadata/install-qa-check.d: add virtual/libcrypt dep check
Bug: https://bugs.gentoo.org/699422 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
Diffstat (limited to 'metadata')
-rw-r--r--metadata/install-qa-check.d/60libcrypt-deps38
1 files changed, 38 insertions, 0 deletions
diff --git a/metadata/install-qa-check.d/60libcrypt-deps b/metadata/install-qa-check.d/60libcrypt-deps
new file mode 100644
index 000000000000..a822ed8c4676
--- /dev/null
+++ b/metadata/install-qa-check.d/60libcrypt-deps
@@ -0,0 +1,38 @@
+# Copyright 2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+# QA check: ensure that package specifies a dependency on virtual/libcrypt
+# Author: Georgy Yakovlev <gyakovlev@gentoo.org>
+# Maintainer Sam James <sam@gentoo.org>
+
+libcrypt_check() {
+ if ! type -P scanelf >/dev/null || has binchecks ${PORTAGE_RESTRICT}; then
+ return
+ fi
+
+ if grep -q virtual/libcrypt <<<${RDEPEND}; then
+ # nothing to do here
+ return
+ fi
+
+ local libcrypt_consumers
+ # grep outputs newline separated list of files, so it's ok to skip specifying delimiter
+ IFS= mapfile libcrypt_consumers < <(find "${ED}" -type f -executable \
+ -print0 | xargs -0 scanelf -qyRF '%F %n' | grep 'libcrypt.so' 2>/dev/null )
+
+ if [[ -n ${libcrypt_consumers[@]} ]]; then
+ eqawarn "Binary files linked to libcrypt.so found"
+ eqawarn "But dependency on virtual/libcrypt is not declared"
+ eqawarn
+ eqatag -v virtual-libcrypt.missing "${libcrypt_consumers[@]%% *}"
+ eqawarn
+ eqawarn "Please add virtual/libcrypt dependency"
+ eqawarn "Gentoo Bug: https://bugs.gentoo.org/699422"
+ fi
+
+}
+
+libcrypt_check
+: # guarantee successful exit
+
+# vim:ft=sh