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/libblockdev/, sys-libs/libblockdev/files/
Date: Tue, 28 Nov 2023 09:38:44 +0000 (UTC)	[thread overview]
Message-ID: <1701164315.1d4d1949ad2af1cc2fd32869aa8bbab832fed806.marecki@gentoo> (raw)

commit:     1d4d1949ad2af1cc2fd32869aa8bbab832fed806
Author:     Alfred Wingate <parona <AT> protonmail <DOT> com>
AuthorDate: Fri Nov 24 16:13:17 2023 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Tue Nov 28 09:38:35 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1d4d1949

sys-libs/libblockdev: enable tests

* Patch is test specific so revbump is unnesessary.

Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 ....4-add-non-systemd-method-for-distro-info.patch | 30 ++++++++++++++++++++++
 sys-libs/libblockdev/libblockdev-3.0.4.ebuild      | 17 +++++++-----
 2 files changed, 40 insertions(+), 7 deletions(-)

diff --git a/sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch b/sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch
new file mode 100644
index 000000000000..5625478c6081
--- /dev/null
+++ b/sys-libs/libblockdev/files/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch
@@ -0,0 +1,30 @@
+From ec8cab726abe60ba5c7ffcce07905b29c5376163 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Mon, 13 Nov 2023 16:21:44 +0200
+Subject: [PATCH] Add non-systemd method to get distro name and version
+
+--- a/tests/utils.py
++++ b/tests/utils.py
+@@ -514,10 +514,16 @@ def get_version():
+     """ Try to get distro and version
+     """
+ 
+-    bus = dbus.SystemBus()
++    try:
++        bus = dbus.SystemBus()
++
++        # get information about the distribution from systemd (hostname1)
++        sys_info = bus.get_object("org.freedesktop.hostname1", "/org/freedesktop/hostname1")
++    except dbus.exceptions.DBusException:
++        import platform
++        info = platform.freedesktop_os_release()
++        return (info["NAME"], info["VERSION_ID"])
+ 
+-    # get information about the distribution from systemd (hostname1)
+-    sys_info = bus.get_object("org.freedesktop.hostname1", "/org/freedesktop/hostname1")
+     cpe = str(sys_info.Get("org.freedesktop.hostname1", "OperatingSystemCPEName", dbus_interface=dbus.PROPERTIES_IFACE))
+ 
+     if cpe:
+-- 
+2.42.1
+

diff --git a/sys-libs/libblockdev/libblockdev-3.0.4.ebuild b/sys-libs/libblockdev/libblockdev-3.0.4.ebuild
index 96fa6a0cbf98..e2e216d80617 100644
--- a/sys-libs/libblockdev/libblockdev-3.0.4.ebuild
+++ b/sys-libs/libblockdev/libblockdev-3.0.4.ebuild
@@ -22,9 +22,7 @@ fi
 LICENSE="LGPL-2+"
 SLOT="0/3"	# subslot is SOVERSION
 IUSE="+cryptsetup device-mapper escrow gtk-doc introspection lvm +nvme test +tools"
-# Tests require root. In a future release, we may be able to run a smaller
-# subset with new run_tests.py arguments.
-RESTRICT="!test? ( test ) test"
+RESTRICT="!test? ( test )"
 
 RDEPEND="
 	>=dev-libs/glib-2.42.2
@@ -70,7 +68,13 @@ BDEPEND+="
 "
 
 REQUIRED_USE="${PYTHON_REQUIRED_USE}
-		escrow? ( cryptsetup )"
+		escrow? ( cryptsetup )
+		test? ( introspection lvm )
+"
+
+PATCHES=(
+	"${FILESDIR}/libblockdev-3.0.4-add-non-systemd-method-for-distro-info.patch"
+)
 
 pkg_setup() {
 	python-single-r1_pkg_setup
@@ -111,9 +115,8 @@ src_configure() {
 
 src_test() {
 	# See http://storaged.org/libblockdev/ch03.html
-	# The 'check' target just does Pylint.
-	# ... but it needs root.
-	emake test
+	# Largest subset which doesn't require root priviledges
+	${EPYTHON} tests/run_tests.py --include-tags extradeps sourceonly || die
 }
 
 src_install() {


             reply	other threads:[~2023-11-28  9:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-28  9:38 Marek Szuba [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-09  1:05 [gentoo-commits] repo/gentoo:master commit in: sys-libs/libblockdev/, sys-libs/libblockdev/files/ Marek Szuba
2023-03-01 23:12 Marek Szuba

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=1701164315.1d4d1949ad2af1cc2fd32869aa8bbab832fed806.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