[neon/backports-jammy/power-profiles-daemon/Neon/unstable] debian: 0.20-3 (patches unapplied)

git-ubuntu importer null at kde.org
Tue Sep 24 23:21:42 BST 2024


Git commit 9afa83fcee0ef4bd1e95a8063211bab96c49c5ea by git-ubuntu importer, on behalf of Marco Trevisan (Treviño).
Committed on 15/02/2024 at 22:34.
Pushed by carlosdem into branch 'Neon/unstable'.

0.20-3 (patches unapplied)

Imported using git-ubuntu import.

M  +34   -0    debian/changelog
M  +4    -1    debian/control
A  +128  -0    debian/patches/Generate-bash-completion-and-zsh-completion-using-shtab.patch
A  +26   -0    debian/patches/build-Bump-dependency-on-polkit-gobject-1-0.99.patch
M  +1    -1    debian/patches/build-Expose-powerprofilesctl-script-and-load-it-using-fi.patch
A  +21   -0    debian/patches/fix-typo-in-meson_options.txt.patch
M  +13   -16   debian/patches/powerprofilectl-Generate-manpage-using-argparse-manpage.patch
A  +112  -0    debian/patches/powerprofilesctl-Avoid-uneeded-raise-this-will-happen-any.patch
D  +0    -26   debian/patches/remove_tlp_conflict.patch
M  +6    -1    debian/patches/series
A  +21   -0    debian/patches/tests-Ensure-daemon-is-ready-before-launching-the-test-cl.patch
A  +41   -0    debian/patches/tests-Fix-failing-messages-to-use-f-strings-as-was-intend.patch
M  +12   -5    debian/rules

https://invent.kde.org/neon/backports-jammy/power-profiles-daemon/-/commit/9afa83fcee0ef4bd1e95a8063211bab96c49c5ea

diff --git a/debian/changelog b/debian/changelog
index b8094bf..cb44d2e 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,37 @@
+power-profiles-daemon (0.20-3) unstable; urgency=medium
+
+  * debian/control: Build-depend on systemd-dev instead of systemd
+    (Closes: #1060563)
+  * debian/patches: Upstream fix on test failing messages
+
+ -- Marco Trevisan (Treviño) <marco at ubuntu.com>  Thu, 15 Feb 2024 18:53:27 +0100
+
+power-profiles-daemon (0.20-2) unstable; urgency=medium
+
+  * debian/rules: Only fix generated makefile for old argparse-manpage versions
+  * debian/patches: Restore systemd conflict with tlp.
+    Tlp is just too much, it can do too many things to be sure it's not
+    conflicting with p-p-d, so let's just enable the conflict again.
+    If someone wants TLP, then it should have only that one running.
+    Not to mention that tlp debian package already conflicts with
+    power-profiles-daemon.
+  * debian/control: Add conflict with laptop-mode-tools and tlp.
+    This is already handled by systemd, but makes it clearer that it's
+    better not having both installed at the same time at all.
+    Tlp is already conflicting with us, so enforce this from our side too.
+  * debian/patches: Refresh patch for generating manpage with upstream ones
+  * debian/patches: Cherry-pick upstream post-releases fixes
+  * debian/patches: Get upstream patches to generate bash/zsh-completions
+  * debian/control: Add build dependencies for generating bash-completions
+  * debian/rules: Explicitly enable bash-completions generation
+  * debian/rules: Enable generating and installing zsh completions in debian
+    There's not a default path for zsh completions defined, as it depends on
+    user configuration or distributions, however as per
+    /usr/share/doc/zsh-common/README.Debian in debian we can use
+    /usr/share/zsh/vendor-completions.
+
+ -- Marco Trevisan (Treviño) <marco at ubuntu.com>  Thu, 15 Feb 2024 17:13:20 +0100
+
 power-profiles-daemon (0.20-1) unstable; urgency=medium
 
   * New upstream release:
diff --git a/debian/control b/debian/control
index 6e0008f..47793fc 100644
--- a/debian/control
+++ b/debian/control
@@ -5,6 +5,7 @@ Maintainer: Debian freedesktop.org maintainers <pkg-freedesktop-maintainers at list
 Uploaders: Sebastien Bacher <seb128 at ubuntu.com>, Marco Trevisan (Treviño) <marco at ubuntu.com>
 Build-Depends: debhelper-compat (= 13),
                dh-python,
+               bash-completion,
                libglib2.0-dev,
                libgudev-1.0-dev,
                libpolkit-gobject-1-dev,
@@ -18,7 +19,8 @@ Build-Depends: debhelper-compat (= 13),
                python3-dbus <!nocheck>,
                python3-dbusmock <!nocheck>,
                python3-gi,
-               systemd,
+               python3-shtab,
+               systemd-dev,
                umockdev <!nocheck>,
 Standards-Version: 4.6.2
 Vcs-Browser: https://salsa.debian.org/freedesktop-team/power-profiles-daemon
@@ -28,6 +30,7 @@ X-Python3-Version: >= 3.11
 
 Package: power-profiles-daemon
 Architecture: linux-any
+Conflicts: laptop-mode-tools, tlp
 Depends: ${misc:Depends}, ${shlibs:Depends}, ${python3:Depends}, python3-gi
 Description: Makes power profiles handling available over D-Bus.
  power-profiles-daemon offers to modify system behaviour based upon
diff --git a/debian/patches/Generate-bash-completion-and-zsh-completion-using-shtab.patch b/debian/patches/Generate-bash-completion-and-zsh-completion-using-shtab.patch
new file mode 100644
index 0000000..8e68e58
--- /dev/null
+++ b/debian/patches/Generate-bash-completion-and-zsh-completion-using-shtab.patch
@@ -0,0 +1,128 @@
+From: Mario Limonciello <superm1 at gmail.com>
+Date: Wed, 14 Feb 2024 22:39:55 -0600
+Subject: Generate bash-completion and zsh-completion using shtab
+
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/commit/3d509fa
+---
+ meson.build          | 17 +++++++++++++++--
+ meson_options.txt    |  8 ++++++++
+ src/meson.build      | 32 ++++++++++++++++++++++++++++++++
+ src/powerprofilesctl |  7 +++++++
+ 4 files changed, 62 insertions(+), 2 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index 05571c4..3a31aac 100644
+--- a/meson.build
++++ b/meson.build
+@@ -67,6 +67,18 @@ address_sanitizer = get_option('b_sanitize') == 'address' or \
+   get_option('b_sanitize') == 'address,undefined' or \
+   get_option('b_sanitize') == 'leak'
+ 
++python = import('python')
++python3 = python.find_installation('python3')
++
++have_shtab = run_command(
++  [python3, '-c', 'import shtab'], check: false).returncode() == 0
++if not have_shtab
++  warning('''python3-shtab not found''')
++endif
++
++bashcomp = dependency('bash-completion', required: get_option('bashcomp').disable_auto_if(not have_shtab))
++zshcomp = have_shtab and get_option('zshcomp') != ''
++
+ subdir('src')
+ subdir('data')
+ 
+@@ -80,6 +92,9 @@ if get_option('gtk_doc')
+   subdir('docs')
+ endif
+ 
++python = import('python')
++python3 = python.find_installation('python3')
++
+ if get_option('tests')
+   # Python 3 required modules
+   python3_required_modules = ['dbusmock', 'gi']
+@@ -89,8 +104,6 @@ if get_option('tests')
+     'UMockdev': '1.0',
+   }
+ 
+-  python = import('python')
+-  python3 = python.find_installation('python3')
+   foreach p : python3_required_modules
+     # Source: https://docs.python.org/3/library/importlib.html#checking-if-a-module-can-be-imported
+     script = 'import importlib.util; import sys; exit(1) if importlib.util.find_spec(\''+ p +'\') is None else exit(0)'
+diff --git a/meson_options.txt b/meson_options.txt
+index 5f3252f..e5a31fd 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -18,3 +18,11 @@ option('manpage',
+        description: 'generate powerprofilesctl man page',
+        type: 'feature',
+        value: 'auto')
++option('bashcomp',
++       description: 'generate bash completion',
++       type: 'feature',
++       value: 'auto')
++option('zshcomp',
++       description: 'path for zsh completion file',
++       type: 'string',
++       value: '')
+diff --git a/src/meson.build b/src/meson.build
+index 49d62a9..bf00f2d 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -146,3 +146,35 @@ if argparse_manpage.found()
+     output: 'powerprofilesctl.1',
+   ))
+ endif
++
++generate_completion = [python3, powerprofilesctl, '--print-completion']
++if bashcomp.found()
++  completions_dir = bashcomp.get_variable(pkgconfig: 'completionsdir',
++    pkgconfig_define: bashcomp.version().version_compare('>= 2.10') ?
++      ['datadir', get_option('datadir')] : ['prefix', prefix],
++  )
++
++  custom_target('bash-completion',
++    output: 'powerprofilesctl',
++    command: [
++      generate_completion,
++      'bash',
++    ],
++    capture: true,
++    install: true,
++    install_dir: completions_dir,
++  )
++endif
++
++if zshcomp
++  custom_target('zsh-completion',
++    output: '_powerprofilesctl',
++    command: [
++      generate_completion,
++      'zsh',
++    ],
++    capture: true,
++    install: true,
++    install_dir: get_option('zshcomp'),
++  )
++endif
+diff --git a/src/powerprofilesctl b/src/powerprofilesctl
+index a363bbc..768c658 100755
+--- a/src/powerprofilesctl
++++ b/src/powerprofilesctl
+@@ -190,6 +190,13 @@ def get_parser():
+     )
+     parser_version.set_defaults(func=_version)
+ 
++    try:
++        import shtab  # pylint: disable=import-outside-toplevel
++
++        shtab.add_argument_to(parser, ["-s", "--print-completion"])  # magic!
++    except ImportError:
++        pass
++
+     return parser
+ 
+ 
diff --git a/debian/patches/build-Bump-dependency-on-polkit-gobject-1-0.99.patch b/debian/patches/build-Bump-dependency-on-polkit-gobject-1-0.99.patch
new file mode 100644
index 0000000..40ca271
--- /dev/null
+++ b/debian/patches/build-Bump-dependency-on-polkit-gobject-1-0.99.patch
@@ -0,0 +1,26 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail at 3v1n0.net>
+Date: Thu, 15 Feb 2024 06:10:18 +0100
+Subject: build: Bump dependency on polkit-gobject-1 0.99
+
+It's still old enough to work on old distros, but it's what debian's
+automatic dependencies system (based on library exported symbols) tells
+us, so we should trust it!
+
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/d225c19
+---
+ meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+index 1a40c22..05571c4 100644
+--- a/meson.build
++++ b/meson.build
+@@ -41,7 +41,7 @@ gio_unix_dep = dependency('gio-unix-2.0')
+ gio_dep = dependency('gio-2.0')
+ gudev_dep = dependency('gudev-1.0', version: '>= 234')
+ upower_dep = dependency('upower-glib')
+-polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.91')
++polkit_gobject_dep = dependency('polkit-gobject-1', version: '>= 0.99')
+ polkit_policy_directory = polkit_gobject_dep.get_variable('policydir')
+ 
+ gnome = import('gnome')
diff --git a/debian/patches/build-Expose-powerprofilesctl-script-and-load-it-using-fi.patch b/debian/patches/build-Expose-powerprofilesctl-script-and-load-it-using-fi.patch
index 36ceed9..ec50360 100644
--- a/debian/patches/build-Expose-powerprofilesctl-script-and-load-it-using-fi.patch
+++ b/debian/patches/build-Expose-powerprofilesctl-script-and-load-it-using-fi.patch
@@ -2,7 +2,7 @@ From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail at 3v1n0.net>
 Date: Thu, 15 Feb 2024 03:22:52 +0100
 Subject: build: Expose powerprofilesctl script and load it using files
 
-Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/163
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/7cd764c
 ---
  src/meson.build | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/debian/patches/fix-typo-in-meson_options.txt.patch b/debian/patches/fix-typo-in-meson_options.txt.patch
new file mode 100644
index 0000000..bd9beb3
--- /dev/null
+++ b/debian/patches/fix-typo-in-meson_options.txt.patch
@@ -0,0 +1,21 @@
+From: Mario Limonciello <superm1 at gmail.com>
+Date: Wed, 14 Feb 2024 22:50:30 -0600
+Subject: fix typo in meson_options.txt
+
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/9a3b379
+---
+ meson_options.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/meson_options.txt b/meson_options.txt
+index 0de978c..5f3252f 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -15,6 +15,6 @@ option('tests',
+        type: 'boolean',
+        value: true)
+ option('manpage',
+-       description: 'gemerate powerprofilesctl man page',
++       description: 'generate powerprofilesctl man page',
+        type: 'feature',
+        value: 'auto')
diff --git a/debian/patches/powerprofilectl-Generate-manpage-using-argparse-manpage.patch b/debian/patches/powerprofilectl-Generate-manpage-using-argparse-manpage.patch
index fdd0858..eab23c2 100644
--- a/debian/patches/powerprofilectl-Generate-manpage-using-argparse-manpage.patch
+++ b/debian/patches/powerprofilectl-Generate-manpage-using-argparse-manpage.patch
@@ -5,26 +5,23 @@ Subject: powerprofilectl: Generate manpage using argparse-manpage
 Add an option to toggle this feature so that it can be either
 required or not
 
-Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/merge_requests/163
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/7858623
 ---
- meson.build          |  5 +++++
+ meson.build          |  2 ++
  meson_options.txt    |  4 ++++
  src/meson.build      | 31 +++++++++++++++++++++++++++++++
  src/powerprofilesctl |  8 ++++++--
- 4 files changed, 46 insertions(+), 2 deletions(-)
+ 4 files changed, 43 insertions(+), 2 deletions(-)
 
 diff --git a/meson.build b/meson.build
-index cd35078..1a4d116 100644
+index cd35078..1a40c22 100644
 --- a/meson.build
 +++ b/meson.build
-@@ -56,6 +56,11 @@ if get_option('pylint')
+@@ -56,6 +56,8 @@ if get_option('pylint')
  endif
  xmllint = find_program('xmllint', required: false)
  
-+manpage = get_option('manpage')
-+if not manpage.disabled()
-+  argparse_manpage = find_program('argparse-manpage', required: manpage.enabled())
-+endif
++argparse_manpage = find_program('argparse-manpage', required: get_option('manpage'))
 +
  bus_names = {
    'org.freedesktop.UPower.PowerProfiles': '/org/freedesktop/UPower/PowerProfiles',
@@ -42,7 +39,7 @@ index 5e9a7ce..0de978c 100644
 +       type: 'feature',
 +       value: 'auto')
 diff --git a/src/meson.build b/src/meson.build
-index 3f59dd3..65ddcc4 100644
+index 3f59dd3..49d62a9 100644
 --- a/src/meson.build
 +++ b/src/meson.build
 @@ -115,3 +115,34 @@ if get_option('pylint')
@@ -50,7 +47,7 @@ index 3f59dd3..65ddcc4 100644
         )
  endif
 +
-+if not manpage.disabled() and argparse_manpage.found()
++if argparse_manpage.found()
 +  argparse_features = run_command(argparse_manpage, '--help',
 +    check: true).stdout().strip()
 +
@@ -60,9 +57,9 @@ index 3f59dd3..65ddcc4 100644
 +      '--pyfile', powerprofilesctl,
 +      '--function', 'get_parser',
 +      argparse_features.contains('--author') ?
-+        ['--author', 'Bastien Nocera'] : [],
++        ['--author', 'Bastien Nocera', '--author', 'Mario Limonciello'] : [],
 +      argparse_features.contains('--author-email') ?
-+        ['--author-email', 'hadess at hadess.net'] : [],
++        ['--author-email', 'hadess at hadess.net', '--author-email', 'mario.limonciello at amd.com'] : [],
 +      argparse_features.contains('--project-name') ?
 +        ['--project-name', meson.project_name()] : [],
 +      argparse_features.contains('--version') ?
@@ -81,10 +78,10 @@ index 3f59dd3..65ddcc4 100644
 +  ))
 +endif
 diff --git a/src/powerprofilesctl b/src/powerprofilesctl
-index af4dfe1..051538d 100755
+index acc0509..a363bbc 100755
 --- a/src/powerprofilesctl
 +++ b/src/powerprofilesctl
-@@ -164,7 +164,7 @@ def _launch(args):
+@@ -138,7 +138,7 @@ def _launch(args):
      return ret
  
  
@@ -93,7 +90,7 @@ index af4dfe1..051538d 100755
      parser = argparse.ArgumentParser(
          epilog="Use “powerprofilesctl COMMAND --help” to get detailed help for individual commands",
      )
-@@ -216,7 +216,11 @@ def main():
+@@ -190,7 +190,11 @@ def main():
      )
      parser_version.set_defaults(func=_version)
  
diff --git a/debian/patches/powerprofilesctl-Avoid-uneeded-raise-this-will-happen-any.patch b/debian/patches/powerprofilesctl-Avoid-uneeded-raise-this-will-happen-any.patch
new file mode 100644
index 0000000..a98af83
--- /dev/null
+++ b/debian/patches/powerprofilesctl-Avoid-uneeded-raise-this-will-happen-any.patch
@@ -0,0 +1,112 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail at 3v1n0.net>
+Date: Thu, 15 Feb 2024 01:22:17 +0100
+Subject: powerprofilesctl: Avoid uneeded raise, this will happen anyways
+
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/fce98c6
+---
+ src/powerprofilesctl | 64 ++++++++++++++++------------------------------------
+ 1 file changed, 19 insertions(+), 45 deletions(-)
+
+diff --git a/src/powerprofilesctl b/src/powerprofilesctl
+index af4dfe1..acc0509 100755
+--- a/src/powerprofilesctl
++++ b/src/powerprofilesctl
+@@ -13,14 +13,10 @@ PROPERTIES_IFACE = "org.freedesktop.DBus.Properties"
+ 
+ 
+ def get_proxy():
+-    try:
+-        bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
+-        proxy = Gio.DBusProxy.new_sync(
+-            bus, Gio.DBusProxyFlags.NONE, None, PP_NAME, PP_PATH, PROPERTIES_IFACE, None
+-        )
+-    except:
+-        raise
+-    return proxy
++    bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
++    return Gio.DBusProxy.new_sync(
++        bus, Gio.DBusProxyFlags.NONE, None, PP_NAME, PP_PATH, PROPERTIES_IFACE, None
++    )
+ 
+ 
+ def command(func):
+@@ -55,38 +51,23 @@ def _get(args):  # pylint: disable=unused-argument
+ 
+ @command
+ def _set(args):
+-    try:
+-        proxy = get_proxy()
+-        proxy.Set(
+-            "(ssv)", PP_IFACE, "ActiveProfile", GLib.Variant.new_string(args.profile[0])
+-        )
+-    except:
+-        raise
++    proxy = get_proxy()
++    proxy.Set(
++        "(ssv)", PP_IFACE, "ActiveProfile", GLib.Variant.new_string(args.profile[0])
++    )
+ 
+ 
+ def get_profiles_property(prop):
+-    try:
+-        proxy = get_proxy()
+-    except:
+-        raise
+-
+-    profiles = None
+-    try:
+-        profiles = proxy.Get("(ss)", PP_IFACE, prop)
+-    except:
+-        raise
+-    return profiles
++    proxy = get_proxy()
++    return proxy.Get("(ss)", PP_IFACE, prop)
+ 
+ 
+ @command
+ def _list(args):  # pylint: disable=unused-argument
+-    try:
+-        profiles = get_profiles_property("Profiles")
+-        reason = get_proxy().Get("(ss)", PP_IFACE, "PerformanceDegraded")
+-        degraded = reason != ""
+-        active = get_proxy().Get("(ss)", PP_IFACE, "ActiveProfile")
+-    except:
+-        raise
++    profiles = get_profiles_property("Profiles")
++    reason = get_proxy().Get("(ss)", PP_IFACE, "PerformanceDegraded")
++    degraded = reason != ""
++    active = get_proxy().Get("(ss)", PP_IFACE, "ActiveProfile")
+ 
+     index = 0
+     for profile in reversed(profiles):
+@@ -106,10 +87,7 @@ def _list(args):  # pylint: disable=unused-argument
+ 
+ @command
+ def _list_holds(args):  # pylint: disable=unused-argument
+-    try:
+-        holds = get_profiles_property("ActiveProfileHolds")
+-    except:
+-        raise
++    holds = get_profiles_property("ActiveProfileHolds")
+ 
+     index = 0
+     for hold in holds:
+@@ -136,14 +114,10 @@ def _launch(args):
+     if not reason:
+         reason = f"Running {args.appid}"
+     ret = 0
+-    try:
+-        bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
+-        proxy = Gio.DBusProxy.new_sync(
+-            bus, Gio.DBusProxyFlags.NONE, None, PP_NAME, PP_PATH, PP_IFACE, None
+-        )
+-    except:
+-        raise
+-
++    bus = Gio.bus_get_sync(Gio.BusType.SYSTEM, None)
++    proxy = Gio.DBusProxy.new_sync(
++        bus, Gio.DBusProxyFlags.NONE, None, PP_NAME, PP_PATH, PP_IFACE, None
++    )
+     cookie = proxy.HoldProfile("(sss)", profile, reason, appid)
+ 
+     # Kill child when we go away
diff --git a/debian/patches/remove_tlp_conflict.patch b/debian/patches/remove_tlp_conflict.patch
deleted file mode 100644
index 5aced1f..0000000
--- a/debian/patches/remove_tlp_conflict.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: "Debian freedesktop.org maintainers"
- <pkg-freedesktop-maintainers at lists.alioth.debian.org>
-Date: Thu, 15 Feb 2024 04:23:10 +0100
-Subject: remove the systemd unit conflict on tlp.service
-
-we don't want that in Ubuntu since we patch tlp to not do performance modes
-changes when power-profiles-daemon is active but the change can be
-included in Debian also since the tlp maintainer made the packages conflict
-which means we can't end up installed together
-forwarded: not-needed
----
- data/power-profiles-daemon.service.in | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/data/power-profiles-daemon.service.in b/data/power-profiles-daemon.service.in
-index 17ec1d2..2b913fa 100644
---- a/data/power-profiles-daemon.service.in
-+++ b/data/power-profiles-daemon.service.in
-@@ -1,6 +1,6 @@
- [Unit]
- Description=Power Profiles daemon
--Conflicts=tuned.service tlp.service auto-cpufreq.service system76-power.service
-+Conflicts=tuned.service auto-cpufreq.service system76-power.service
- Before=multi-user.target display-manager.target
- 
- [Service]
diff --git a/debian/patches/series b/debian/patches/series
index ee18d0d..0e11528 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,8 @@
-remove_tlp_conflict.patch
+powerprofilesctl-Avoid-uneeded-raise-this-will-happen-any.patch
+tests-Ensure-daemon-is-ready-before-launching-the-test-cl.patch
 build-Expose-powerprofilesctl-script-and-load-it-using-fi.patch
 powerprofilectl-Generate-manpage-using-argparse-manpage.patch
+build-Bump-dependency-on-polkit-gobject-1-0.99.patch
+fix-typo-in-meson_options.txt.patch
+Generate-bash-completion-and-zsh-completion-using-shtab.patch
+tests-Fix-failing-messages-to-use-f-strings-as-was-intend.patch
diff --git a/debian/patches/tests-Ensure-daemon-is-ready-before-launching-the-test-cl.patch b/debian/patches/tests-Ensure-daemon-is-ready-before-launching-the-test-cl.patch
new file mode 100644
index 0000000..6431164
--- /dev/null
+++ b/debian/patches/tests-Ensure-daemon-is-ready-before-launching-the-test-cl.patch
@@ -0,0 +1,21 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail at 3v1n0.net>
+Date: Thu, 15 Feb 2024 01:30:26 +0100
+Subject: tests: Ensure daemon is ready before launching the test client
+
+Origin: https://gitlab.freedesktop.org/upower/power-profiles-daemon/-/commit/1ca4696
+---
+ tests/integration_test.py | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/tests/integration_test.py b/tests/integration_test.py
+index f31d6c5..6ffe547 100644
+--- a/tests/integration_test.py
++++ b/tests/integration_test.py
+@@ -1626,6 +1626,7 @@ class Tests(dbusmock.DBusTestCase):
+     def test_vanishing_hold(self):
+         self.create_platform_profile()
+         self.start_daemon()
++        self.assert_eventually(lambda: self.get_dbus_property("ActiveProfile"))
+ 
+         sourcedir = os.getenv("top_srcdir", ".")
+         tool_path = os.path.join(sourcedir, "src", "powerprofilesctl")
diff --git a/debian/patches/tests-Fix-failing-messages-to-use-f-strings-as-was-intend.patch b/debian/patches/tests-Fix-failing-messages-to-use-f-strings-as-was-intend.patch
new file mode 100644
index 0000000..fe374b6
--- /dev/null
+++ b/debian/patches/tests-Fix-failing-messages-to-use-f-strings-as-was-intend.patch
@@ -0,0 +1,41 @@
+From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail at 3v1n0.net>
+Date: Thu, 15 Feb 2024 18:04:42 +0100
+Subject: tests: Fix failing messages to use f'strings as was intended to
+
+But then as per reformatting, they got lost...
+---
+ tests/integration_test.py | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/tests/integration_test.py b/tests/integration_test.py
+index 6ffe547..02528e1 100644
+--- a/tests/integration_test.py
++++ b/tests/integration_test.py
+@@ -396,7 +396,7 @@ class Tests(dbusmock.DBusTestCase):
+             lambda: self.read_file_contents(path) == encoded,
+             timeout=timeout,
+             message=f"file '{path}' does not contain '{contents}', "
+-            + "but '{self.read_file_contents(path)}'",
++            + f"but '{self.read_file_contents(path)}'",
+         )
+ 
+     def assert_sysfs_attr_eventually_is(self, device, attribute, contents, timeout=800):
+@@ -406,7 +406,7 @@ class Tests(dbusmock.DBusTestCase):
+             lambda: self.read_sysfs_attr(device, attribute) == encoded,
+             timeout=timeout,
+             message=f"file {device} '{attribute}' does not contain '{contents}', "
+-            + "but '{self.read_sysfs_attr(device, attribute)}'",
++            + f"but '{self.read_sysfs_attr(device, attribute)}'",
+         )
+ 
+     def assert_dbus_property_eventually_is(self, prop, value, timeout=1200):
+@@ -414,7 +414,8 @@ class Tests(dbusmock.DBusTestCase):
+         return self.assert_eventually(
+             lambda: self.get_dbus_property(prop) == value,
+             timeout=timeout,
+-            message=f"property '{prop}' is not '{value}', but '{self.get_dbus_property(prop)}'",
++            message=f"property '{prop}' is not '{value}', but "
++            + f"'{self.get_dbus_property(prop)}'",
+         )
+ 
+     #
diff --git a/debian/rules b/debian/rules
index 6494fef..9665a77 100755
--- a/debian/rules
+++ b/debian/rules
@@ -8,8 +8,15 @@ export DEB_LDFLAGS_MAINT_APPEND = -Wl,-z,defs
 
 override_dh_auto_configure:
 	dh_auto_configure -- \
-		-Dmanpage=enabled
-	# Fix contents of manpage, can be dropped when newer argparse-manpage lands
-	# in debian
-	sed -i s,argparse-manpage,powerprofilesctl,g \
-		$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/src/powerprofilesctl.1
+		-Dmanpage=enabled \
+		-Dbashcomp=enabled \
+		-Dzshcomp="/usr/share/zsh/vendor-completions" \
+		$(NULL)
+
+	# Newer python3-argparse-manpage is in debian but let's wait removing this
+	# until it's there for a while, so that there's not a mismatch.
+	if dpkg --compare-versions \
+		"$$(dpkg-query --showformat='${Version}' --show python3-argparse-manpage)" lt "4.0"; then \
+		sed -i s,argparse-manpage,powerprofilesctl,g \
+			$(CURDIR)/obj-$(DEB_HOST_GNU_TYPE)/src/powerprofilesctl.1; \
+	fi


More information about the Neon-commits mailing list