From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1202462-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id D66F4138359
	for <garchives@archives.gentoo.org>; Thu,  3 Sep 2020 14:16:58 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 84898E08EB;
	Thu,  3 Sep 2020 14:16:56 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id 67205E08EB
	for <gentoo-commits@lists.gentoo.org>; Thu,  3 Sep 2020 14:16:56 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 36AB7340F47
	for <gentoo-commits@lists.gentoo.org>; Thu,  3 Sep 2020 14:16:54 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 94372315
	for <gentoo-commits@lists.gentoo.org>; Thu,  3 Sep 2020 14:16:52 +0000 (UTC)
From: "Thomas Deutschmann" <whissi@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" <whissi@gentoo.org>
Message-ID: <1599142598.4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583.whissi@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kmod/, sys-apps/kmod/files/
X-VCS-Repository: repo/gentoo
X-VCS-Files: sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch sys-apps/kmod/kmod-27-r1.ebuild sys-apps/kmod/kmod-27-r2.ebuild
X-VCS-Directories: sys-apps/kmod/ sys-apps/kmod/files/
X-VCS-Committer: whissi
X-VCS-Committer-Name: Thomas Deutschmann
X-VCS-Revision: 4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583
X-VCS-Branch: master
Date: Thu,  3 Sep 2020 14:16:52 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: 3411b5f7-b6f1-4a25-8568-e47f64b20d34
X-Archives-Hash: 3a136bbe568f93f2bcfc5288ce68c7e2

commit:     4e4dff82bbb63e8b5a6e97880b085c3ee2e2e583
Author:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
AuthorDate: Wed Sep  2 23:15:16 2020 +0000
Commit:     Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
CommitDate: Thu Sep  3 14:16:38 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e4dff82

sys-apps/kmod: rev bump to fix crash

Fixes

  depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.

Package-Manager: Portage-3.0.4, Repoman-3.0.1
Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org>

 ...od-27-depmod-do-not-output-.bin-to-stdout.patch | 53 ++++++++++++++++++++++
 .../kmod/{kmod-27-r1.ebuild => kmod-27-r2.ebuild}  |  2 +
 2 files changed, 55 insertions(+)

diff --git a/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
new file mode 100644
index 00000000000..dc776b515bc
--- /dev/null
+++ b/sys-apps/kmod/files/kmod-27-depmod-do-not-output-.bin-to-stdout.patch
@@ -0,0 +1,53 @@
+From 53b30aeba2dedae9f5558f560231d9462e063dfc Mon Sep 17 00:00:00 2001
+From: Lucas De Marchi <lucas.demarchi@intel.com>
+Date: Thu, 5 Mar 2020 13:33:10 -0800
+Subject: depmod: do not output .bin to stdout
+
+index_write() relies on fseek/ftell to manage the position to which we
+are write and thus needs the file stream to support it.
+
+Right now when trying to write the index to stdout we fail with:
+
+	depmod: tools/depmod.c:416: index_write: Assertion `initial_offset >= 0' failed.
+	Aborted (core dumped)
+
+We have no interest in outputting our index to stdout, so just skip it
+like is done with other indexes.
+
+While at it, add/remove some newlines to improve readability.
+
+Reported-by: Yanko Kaneti <yaneti@declera.com>
+Fix: b866b2165ae6 ("Lookup aliases in the modules.builtin.modinfo")
+---
+ tools/depmod.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/tools/depmod.c b/tools/depmod.c
+index fbbce10..875e314 100644
+--- a/tools/depmod.c
++++ b/tools/depmod.c
+@@ -2408,8 +2408,10 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
+ 	struct index_node *idx;
+ 	struct kmod_list *l, *builtin = NULL;
+ 
+-	idx = index_create();
++	if (out == stdout)
++		return 0;
+ 
++	idx = index_create();
+ 	if (idx == NULL) {
+ 		ret = -ENOMEM;
+ 		goto fail;
+@@ -2456,7 +2458,9 @@ static int output_builtin_alias_bin(struct depmod *depmod, FILE *out)
+ 
+ 	if (count)
+ 		index_write(idx, out);
++
+ 	index_destroy(idx);
++
+ fail:
+ 	if (builtin)
+ 		kmod_module_unref_list(builtin);
+-- 
+cgit 1.2.3-1.el7
+

diff --git a/sys-apps/kmod/kmod-27-r1.ebuild b/sys-apps/kmod/kmod-27-r2.ebuild
similarity index 98%
rename from sys-apps/kmod/kmod-27-r1.ebuild
rename to sys-apps/kmod/kmod-27-r2.ebuild
index c9e60cdc33f..d01054db3c4 100644
--- a/sys-apps/kmod/kmod-27-r1.ebuild
+++ b/sys-apps/kmod/kmod-27-r2.ebuild
@@ -63,6 +63,8 @@ REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
 
 DOCS="NEWS README TODO"
 
+PATCHES=( "${FILESDIR}"/${P}-depmod-do-not-output-.bin-to-stdout.patch )
+
 src_prepare() {
 	default