lxsession v0.5.6

This commit is contained in:
uglyside
2025-06-14 12:12:30 +03:00
parent fe833a6161
commit 1cd64cb748
3 changed files with 15 additions and 82 deletions
+2 -5
View File
@@ -7,10 +7,7 @@
from pisi.actionsapi import autotools, pisitools, get
def setup():
pisitools.cflags.add("-Wno-deprecated-declarations")
pisitools.unlink("*.stamp")
autotools.autoreconf("-fv")
autotools.configure("--enable-gtk3 --disable-buildin-polkit --disable-buildin-clipboard")
autotools.configure("--enable-gtk3")
def build():
autotools.make()
@@ -18,5 +15,5 @@ def build():
def install():
autotools.rawInstall("DESTDIR=%s" % get.installDIR())
pisitools.dodoc("AUTHORS", "ChangeLog", "COPYING", "NEWS", "README")
pisitools.dodoc("AUTHORS", "COPYING")
@@ -1,69 +0,0 @@
From c398fd6db61bc084679759096bde5747e5616eca Mon Sep 17 00:00:00 2001
From: Jann Horn <jann@thejh.net>
Date: Sun, 18 Apr 2021 16:37:16 +0200
Subject: [PATCH] lxsession-logout: Avoid costly lsb_release invocation
Having the name of the distribution in the LXDE prompt looks kinda nice,
but `lsb_release -r -s` is fairly costly (or at least the version on
Debian is): It spins up a python interpreter, then runs `apt-cache policy`
(which in turn, among other things, runs
`/usr/bin/dpkg --print-foreign-architectures` twice).
On a desktop machine with a proper Haswell CPU, `lsb_release -r -s` takes
"only" around 105ms (around 79ms of that are for `apt-cache policy`);
but on an old Intel NUC with a 5-years-old mobile Intel Pentium with a TDP
of 6W, it takes roughly between 500ms and 1000ms.
As suggested by ZanderBrown, use glib's g_get_os_info() instead if
available. If that doesn't exist, it's probably better to omit the OS name
instead of potentially spending up to a second on figuring out what it is.
---
lxsession-logout/lxsession-logout.c | 33 ++++++-----------------------
1 file changed, 6 insertions(+), 27 deletions(-)
diff --git a/lxsession-logout/lxsession-logout.c b/lxsession-logout/lxsession-logout.c
index 489e6e3..f06e61d 100644
--- a/lxsession-logout/lxsession-logout.c
+++ b/lxsession-logout/lxsession-logout.c
@@ -716,35 +716,14 @@ int main(int argc, char * argv[])
if (session_name == NULL)
session_name = "LXDE";
- gchar *output = NULL;
-
- if (g_find_program_in_path("lsb_release"))
- {
- const gchar *command_line = "lsb_release -r -s";
- GError *error;
- if (!g_spawn_command_line_sync( command_line,
- &output,
- NULL,
- NULL,
- &error))
- {
-
- fprintf (stderr, "Error: %s\n", error->message);
- g_error_free (error);
-
- }
- }
+ gchar *os_name = NULL;
+#if GLIB_CHECK_VERSION(2, 64, 0)
+ os_name = g_get_os_info(G_OS_INFO_KEY_PRETTY_NAME);
+#endif
- if (output == NULL)
- {
- output = "";
- }
- else
- {
- output[strlen ( output ) - 1] = '\0';
- }
+ prompt = g_strdup_printf(_("<b><big>Logout %s %s session ?</big></b>"), session_name, os_name ? os_name : "");
- prompt = g_strdup_printf(_("<b><big>Logout %s %s session ?</big></b>"), session_name, output);
+ g_free(os_name);
}
gtk_label_set_markup(GTK_LABEL(label), prompt);
gtk_box_pack_start(GTK_BOX(controls), label, FALSE, FALSE, 4);
+13 -8
View File
@@ -3,19 +3,17 @@
<PISI>
<Source>
<Name>lxsession</Name>
<Homepage>https://www.lxde.org/</Homepage>
<Homepage>https://github.com/lxde/lxsession</Homepage>
<Packager>
<Name>PisiLinux Community</Name>
<Email>admins@pisilinux.org</Email>
<Name>Kamil Atlı</Name>
<Email>suvari@pisilinux.org</Email>
</Packager>
<License>GPL-2</License>
<License>GPLv2</License>
<IsA>app</IsA>
<PartOf>desktop.lxde</PartOf>
<Summary>LXDE session manager.</Summary>
<Description>lxsession is the default X11 session manager of LXDE.</Description>
<Archive sha1sum="93f495f3afff0300de3c7b9aacce0ef29eb86bab" type="tarxz">
mirrors://sourceforge/lxde/lxsession-0.5.5.tar.xz
</Archive>
<Archive sha1sum="93f495f3afff0300de3c7b9aacce0ef29eb86bab" type="tarxz">https://github.com/lxde/releases/raw/master/releases/lxsession-0.5.6.tar.xz</Archive>
<BuildDependencies>
<Dependency>intltool</Dependency>
<Dependency>vala-devel</Dependency>
@@ -30,7 +28,7 @@
<Dependency>gdk-pixbuf-devel</Dependency>
</BuildDependencies>
<Patches>
<Patch level="1">Avoid_costly_lsb_release_invocation.patch</Patch>
<!-- <Patch level="1"></Patch> -->
</Patches>
</Source>
@@ -56,6 +54,13 @@
</Package>
<History>
<Update release="2">
<Date>2025-06-14</Date>
<Version>0.5.6</Version>
<Comment>Version bump.</Comment>
<Name>Kamil Atlı</Name>
<Email>suvari@pisilinux.org</Email>
</Update>
<Update release="1">
<Date>2022-08-20</Date>
<Version>0.5.5</Version>