public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] metadata/install-qa-check.d: add virtual/libcrypt dep check
@ 2021-06-25  5:25 Georgy Yakovlev
  2021-06-26 22:54 ` Georgy Yakovlev
  0 siblings, 1 reply; 2+ messages in thread
From: Georgy Yakovlev @ 2021-06-25  5:25 UTC (permalink / raw
  To: gentoo-dev; +Cc: Georgy Yakovlev

Bug: https://bugs.gentoo.org/699422
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
---
 metadata/install-qa-check.d/60libcrypt-deps | 38 +++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 metadata/install-qa-check.d/60libcrypt-deps

diff --git a/metadata/install-qa-check.d/60libcrypt-deps b/metadata/install-qa-check.d/60libcrypt-deps
new file mode 100644
index 000000000000..bc7b8d3dced2
--- /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	
+
+	# nothing to do here
+	if grep -q virtual/libcrypt <<<${RDEPEND}; then
+		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
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-dev] [PATCH] metadata/install-qa-check.d: add virtual/libcrypt dep check
  2021-06-25  5:25 [gentoo-dev] [PATCH] metadata/install-qa-check.d: add virtual/libcrypt dep check Georgy Yakovlev
@ 2021-06-26 22:54 ` Georgy Yakovlev
  0 siblings, 0 replies; 2+ messages in thread
From: Georgy Yakovlev @ 2021-06-26 22:54 UTC (permalink / raw
  To: gentoo-dev; +Cc: Georgy Yakovlev

Bug: https://bugs.gentoo.org/699422
Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org>
---
 metadata/install-qa-check.d/60libcrypt-deps | 38 +++++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 metadata/install-qa-check.d/60libcrypt-deps

diff --git a/metadata/install-qa-check.d/60libcrypt-deps b/metadata/install-qa-check.d/60libcrypt-deps
new file mode 100644
index 000000000000..fd915fb852d7
--- /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	
+
+	# nothing to do here
+	if grep -q virtual/libcrypt <<<${RDEPEND}; then
+		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
-- 
2.32.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-06-26 22:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-25  5:25 [gentoo-dev] [PATCH] metadata/install-qa-check.d: add virtual/libcrypt dep check Georgy Yakovlev
2021-06-26 22:54 ` Georgy Yakovlev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox