public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Marek Szuba" <marecki@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/
Date: Thu,  7 Sep 2023 10:20:55 +0000 (UTC)	[thread overview]
Message-ID: <1694082047.034e6374ee320914d8df1d27215e943a60c9dc78.marecki@gentoo> (raw)

commit:     034e6374ee320914d8df1d27215e943a60c9dc78
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Thu Sep  7 09:51:21 2023 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Thu Sep  7 10:20:47 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=034e6374

sys-libs/libsmbios: squash long-present Python deprecation warning

Closes: https://bugs.gentoo.org/913238
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 .../libsmbios-2.4.3-python-deprecations.patch      | 33 ++++++++
 sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild       | 92 ++++++++++++++++++++++
 2 files changed, 125 insertions(+)

diff --git a/sys-libs/libsmbios/files/libsmbios-2.4.3-python-deprecations.patch b/sys-libs/libsmbios/files/libsmbios-2.4.3-python-deprecations.patch
new file mode 100644
index 000000000000..c67df620e85f
--- /dev/null
+++ b/sys-libs/libsmbios/files/libsmbios-2.4.3-python-deprecations.patch
@@ -0,0 +1,33 @@
+From 99e0ac359d55d7a66d944e038ad63a7f6ef6698d Mon Sep 17 00:00:00 2001
+From: troy <70726977+troygraben@users.noreply.github.com>
+Date: Mon, 26 Jul 2021 17:05:35 -0400
+Subject: [PATCH] Fix the TokenTable generator implementation
+
+This change supports PEP 479 by changing the generator to use return
+instead of raising StopIteration.
+
+This fixes the RuntimeError exception being raised with Python 3.7 and
+newer when the iterator reaches the end of the collection. This could be
+encountered when calling smbios-token-ctl --dump-tokens
+--- a/src/bin/smbios-token-ctl
++++ b/src/bin/smbios-token-ctl
+@@ -427,8 +427,6 @@ def main():
+         verboseLog.info( _("The token library returned this error:") )
+         verboseLog.info( str(e) )
+         moduleLog.info( cli.standardFailMessage )
+-    except StopIteration:
+-        pass
+ 
+     return exit_code
+ 
+--- a/src/python/libsmbios_c/smbios_token.py
++++ b/src/python/libsmbios_c/smbios_token.py
+@@ -131,7 +131,7 @@ def __iter__(self):
+             if bool(cur):
+                 yield cur.contents
+             else:
+-                raise StopIteration
++                return
+ 
+     @traceLog()
+     def __getitem__(self, id):

diff --git a/sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild b/sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild
new file mode 100644
index 000000000000..e1bb901b8e36
--- /dev/null
+++ b/sys-libs/libsmbios/libsmbios-2.4.3-r1.ebuild
@@ -0,0 +1,92 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit autotools flag-o-matic python-single-r1
+
+DESCRIPTION="Provide access to (SM)BIOS information"
+HOMEPAGE="https://github.com/dell/libsmbios"
+SRC_URI="https://github.com/dell/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="|| ( GPL-2+ OSL-2.1 ) BSD Boost-1.0"
+SLOT="0"
+KEYWORDS="-* ~amd64 ~ia64 ~x86"
+IUSE="doc graphviz nls +python static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )
+	test? ( ${PYTHON_REQUIRED_USE} )"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="dev-libs/libxml2
+	sys-libs/zlib
+	nls? ( virtual/libintl )
+	python? ( ${PYTHON_DEPS} )"
+DEPEND="${RDEPEND}
+	virtual/pkgconfig
+	doc? ( app-doc/doxygen )
+	graphviz? ( media-gfx/graphviz )
+	nls? ( sys-devel/gettext )"
+BDEPEND="test? (
+	${PYTHON_DEPS}
+	>=dev-util/cppunit-1.9.6
+)"
+
+PATCHES=(
+	"${FILESDIR}/${PN}-2.2.28-cppunit-tests.patch"
+	"${FILESDIR}/${PN}-2.4.3-avoid_bashisms.patch" #715202
+	"${FILESDIR}/${PN}-2.4.3-insecure_rpaths.patch"
+	"${FILESDIR}"/${PN}-2.4.3-python-deprecations.patch
+)
+
+pkg_setup() {
+	if use python || use test; then
+		python-single-r1_pkg_setup
+	fi
+}
+
+src_prepare() {
+	default
+
+	# Don't build yum-plugin - we don't need it
+	sed '/yum-plugin/d' -i Makefile.am || die
+
+	if use test; then
+		python_fix_shebang src/pyunit/test*.py
+	fi
+
+	eautoreconf
+}
+
+src_configure() {
+	#Remove -O3 for bug #290097
+	replace-flags -O3 -O2
+
+	local myeconfargs=(
+		$(use_enable doc doxygen)
+		$(use_enable graphviz)
+		$(use_enable nls)
+		$(use_enable python)
+		$(use_enable static-libs static)
+	)
+	econf "${myeconfargs[@]}"
+}
+
+src_install() {
+	emake install DESTDIR="${D}"
+
+	if use python; then
+		python_scriptinto /usr/sbin
+		python_doscript "${ED}"/usr/sbin/smbios-{{battery,keyboard,thermal,token,wakeup,wireless}-ctl,lcd-brightness,passwd,sys-info}
+	fi
+
+	insinto /usr/include/
+	doins -r src/include/smbios_c
+
+	einstalldocs
+
+	if ! use static-libs ; then
+		find "${ED}" \( -name "*.a" -o -name "*.la" \) -delete || die
+	fi
+}


             reply	other threads:[~2023-09-07 10:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07 10:20 Marek Szuba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2022-09-07 14:30 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libsmbios/, sys-libs/libsmbios/files/ Marek Szuba
2021-01-04  0:07 Lars Wendler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1694082047.034e6374ee320914d8df1d27215e943a60c9dc78.marecki@gentoo \
    --to=marecki@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox