parent
714d272ce9
commit
32c353f8f5
1
.gitignore
vendored
1
.gitignore
vendored
@ -36,3 +36,4 @@ upower-0.9.5.tar.bz2
|
||||
/upower-0.99.12.tar.xz
|
||||
/upower-0.99.13.tar.xz
|
||||
/upower-v0.99.14.tar.bz2
|
||||
/upower-v0.99.19.tar.bz2
|
||||
|
||||
67
150.patch
Normal file
67
150.patch
Normal file
@ -0,0 +1,67 @@
|
||||
From a78ee6039054770b466749f8ec4bfbe4c278d697 Mon Sep 17 00:00:00 2001
|
||||
From: Benjamin Berg <bberg@redhat.com>
|
||||
Date: Thu, 9 Jun 2022 12:38:34 +0200
|
||||
Subject: [PATCH] test: Properly wait for idle handler after uevents
|
||||
|
||||
The state aggregation test requires an idle handler to run, which can be
|
||||
a bit unreliable as it may or may not run twice.
|
||||
|
||||
Force running it twice and add code to wait for it to complete. Do so
|
||||
properly by waiting for the correct log messages rather than sleeping so
|
||||
that everything is ordered nicely while not slowing down the test a lot.
|
||||
|
||||
Closes: #193
|
||||
---
|
||||
src/linux/integration-test.py | 21 +++++++++++++++------
|
||||
1 file changed, 15 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/linux/integration-test.py b/src/linux/integration-test.py
|
||||
index d60453e..9523f28 100755
|
||||
--- a/src/linux/integration-test.py
|
||||
+++ b/src/linux/integration-test.py
|
||||
@@ -649,6 +649,8 @@ class Tests(dbusmock.DBusTestCase):
|
||||
(TBD , CHARGING , DISCHARGING, TBD , TBD , P_CHARGE , ANY),
|
||||
(ANY , CHARGING , DISCHARGING, ANY , ANY , ANY , ANY),
|
||||
]
|
||||
+
|
||||
+ self.daemon_log.clear()
|
||||
for i in range(len(states)):
|
||||
for j in range(len(states)):
|
||||
# The table should be mirrored
|
||||
@@ -657,9 +659,19 @@ class Tests(dbusmock.DBusTestCase):
|
||||
self.testbed.set_attribute(bat0, 'status', states[i])
|
||||
self.testbed.set_attribute(bat1, 'status', states[j])
|
||||
self.testbed.uevent(bat0, 'change')
|
||||
+ # We can't guarantee that both uevents are processed without
|
||||
+ # the idle handler running. So, lets wait for the idle handler
|
||||
+ # to calculate the composite battery state.
|
||||
+ self.daemon_log.check_line('Calculating percentage', timeout=2.0)
|
||||
self.testbed.uevent(bat1, 'change')
|
||||
- # The uevent can race with the DBus request
|
||||
- time.sleep(0.5)
|
||||
+
|
||||
+ if display_device_state[i][j] == CONFLICT:
|
||||
+ self.daemon_log.check_line_re("Conflicting.*state", timeout=2.0)
|
||||
+ else:
|
||||
+ # TODO: Add a helper in OutputChecker to do this
|
||||
+ lines = self.daemon_log.check_line('Calculating percentage', timeout=2.0)
|
||||
+ for l in lines:
|
||||
+ self.assertNotRegex(l, b"Conflicting.*state")
|
||||
|
||||
if display_device_state[i][j] >= 0:
|
||||
self.assertEqual(self.get_dbus_display_property('State'), display_device_state[i][j],
|
||||
@@ -675,10 +687,7 @@ class Tests(dbusmock.DBusTestCase):
|
||||
UP_DEVICE_STATE_PENDING_DISCHARGE),
|
||||
msg=f"Invalid aggregate state for states {states[i]} and {states[j]}"
|
||||
)
|
||||
- if display_device_state[i][j] == CONFLICT:
|
||||
- self.daemon_log.check_line_re("Conflicting.*state")
|
||||
- else:
|
||||
- self.daemon_log.check_no_line_re("Conflicting.*state")
|
||||
+
|
||||
self.stop_daemon()
|
||||
|
||||
def test_map_pending_charge_to_fully_charged(self):
|
||||
--
|
||||
GitLab
|
||||
|
||||
@ -1,100 +0,0 @@
|
||||
From 8eb8ab1056e03b68634098b754c89c5a99f33c5c Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
||||
Date: Sat, 5 Feb 2022 02:26:48 +0000
|
||||
Subject: [PATCH 1/2] build: Fix default udevrulesdir
|
||||
|
||||
We need to append 'rules.d' to the udev_dir.
|
||||
---
|
||||
meson.build | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index f87de19..3858cbe 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -90,7 +90,7 @@ endif
|
||||
udevrulesdir = get_option('udevrulesdir')
|
||||
if udevrulesdir == 'auto'
|
||||
udev_dep = dependency('udev', required: true)
|
||||
- udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir')
|
||||
+ udevrulesdir = udev_dep.get_pkgconfig_variable('udev_dir') / 'rules.d'
|
||||
endif
|
||||
|
||||
dbusdir = get_option('datadir') / 'dbus-1'
|
||||
--
|
||||
2.34.1
|
||||
|
||||
|
||||
From 1dc74629ff24a2121f17f6e38b2c8067be0b7182 Mon Sep 17 00:00:00 2001
|
||||
From: "Jan Alexander Steffens (heftig)" <heftig@archlinux.org>
|
||||
Date: Sat, 5 Feb 2022 02:30:52 +0000
|
||||
Subject: [PATCH 2/2] build: Fix version macros
|
||||
|
||||
The project version is a string. We need to split it into an array of
|
||||
version components.
|
||||
---
|
||||
libupower-glib/meson.build | 11 ++++++++---
|
||||
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/libupower-glib/meson.build b/libupower-glib/meson.build
|
||||
index 1bab59b..2ff7baf 100644
|
||||
--- a/libupower-glib/meson.build
|
||||
+++ b/libupower-glib/meson.build
|
||||
@@ -1,7 +1,12 @@
|
||||
+version_arr = meson.project_version().split('.')
|
||||
+major_version = version_arr[0].to_int()
|
||||
+minor_version = version_arr[1].to_int()
|
||||
+micro_version = version_arr[2].to_int()
|
||||
+
|
||||
cdata = configuration_data()
|
||||
-cdata.set('UP_MAJOR_VERSION', meson.project_version()[0])
|
||||
-cdata.set('UP_MINOR_VERSION', meson.project_version()[1])
|
||||
-cdata.set('UP_MICRO_VERSION', meson.project_version()[2])
|
||||
+cdata.set('UP_MAJOR_VERSION', major_version)
|
||||
+cdata.set('UP_MINOR_VERSION', minor_version)
|
||||
+cdata.set('UP_MICRO_VERSION', micro_version)
|
||||
|
||||
up_version_h = configure_file(
|
||||
output: 'up-version.h',
|
||||
--
|
||||
2.34.1
|
||||
|
||||
From 7660d6d8850e37db8c7f0d06316a82e956e89e81 Mon Sep 17 00:00:00 2001
|
||||
From: Bastien Nocera <hadess@hadess.net>
|
||||
Date: Mon, 7 Feb 2022 11:09:21 +0100
|
||||
Subject: [PATCH] build: Fix missing libm link on some platforms
|
||||
|
||||
This should fix the PPC64 and ARMv7 builds.
|
||||
---
|
||||
meson.build | 1 +
|
||||
src/meson.build | 2 +-
|
||||
2 files changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/meson.build b/meson.build
|
||||
index c612953..be7658a 100644
|
||||
--- a/meson.build
|
||||
+++ b/meson.build
|
||||
@@ -45,6 +45,7 @@ glib_dep = dependency('glib-2.0', version: '>=' + glib_min_version)
|
||||
gobject_dep = dependency('gobject-2.0', version: '>=' + glib_min_version)
|
||||
gio_dep = dependency('gio-2.0', version: '>=' + glib_min_version)
|
||||
gio_unix_dep = dependency('gio-unix-2.0', version: '>=' + glib_min_version)
|
||||
+m_dep = cc.find_library('m', required: true)
|
||||
|
||||
xsltproc = find_program('xsltproc', required: get_option('gtk-doc') or get_option('man'))
|
||||
|
||||
diff --git a/src/meson.build b/src/meson.build
|
||||
index d0d8141..406f9cb 100644
|
||||
--- a/src/meson.build
|
||||
+++ b/src/meson.build
|
||||
@@ -6,7 +6,7 @@ upowerd_deps = declare_dependency(
|
||||
include_directories('../dbus'),
|
||||
],
|
||||
dependencies: [
|
||||
- glib_dep, gobject_dep, gio_dep, gio_unix_dep, libupower_glib_dep, upowerd_dbus_dep
|
||||
+ m_dep, glib_dep, gobject_dep, gio_dep, gio_unix_dep, libupower_glib_dep, upowerd_dbus_dep
|
||||
],
|
||||
compile_args: [
|
||||
'-DUP_COMPILATION',
|
||||
--
|
||||
2.34.1
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (upower-v0.99.14.tar.bz2) = 8682528afb2af968a34bcde718ac53596ae04d1324b4aef98592799a506e69e17aa457887a4fbf2f4950ae9ee7c6b5519f32ec01b965142b7eed6750007f7158
|
||||
SHA512 (upower-v0.99.19.tar.bz2) = 1462a64bc642bd6c5c235742f5a8fa9e3440846d90061889b568fc0a91f7b24d56d1f5a3d33bff8d6d35f78aa8bc8c15f9c4a51a2cb40f1ee3b2a822ad60ca33
|
||||
|
||||
@ -1,11 +1,13 @@
|
||||
Summary: Power Management Service
|
||||
Name: upower
|
||||
Version: 0.99.14
|
||||
Version: 0.99.19
|
||||
Release: %autorelease
|
||||
License: GPLv2+
|
||||
URL: http://upower.freedesktop.org/
|
||||
Source0: https://gitlab.freedesktop.org/upower/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.bz2
|
||||
Patch0: build-fixes.patch
|
||||
|
||||
# Pull fix for test race condition
|
||||
Patch0: https://gitlab.freedesktop.org/upower/upower/-/merge_requests/150.patch
|
||||
|
||||
BuildRequires: meson
|
||||
BuildRequires: git
|
||||
@ -81,6 +83,7 @@ Developer documentation for for libupower-glib.
|
||||
%{_libdir}/libupower-glib.so.*
|
||||
%{_datadir}/dbus-1/system.d/*.conf
|
||||
%{_udevrulesdir}/*.rules
|
||||
%{_udevhwdbdir}/*.hwdb
|
||||
%ghost %dir %{_localstatedir}/lib/upower
|
||||
%dir %{_sysconfdir}/UPower
|
||||
%config %{_sysconfdir}/UPower/UPower.conf
|
||||
|
||||
Loading…
Reference in New Issue
Block a user