commit 0a56e224ab9940c6a458fbb672a709e9c541dedd
Author: Marcin Krol <h...@tld-linux.org>
Date:   Tue Apr 23 01:02:51 2024 +0200

    - make openbox-xdg-autostart python3 compatible (patch from Debian)

 openbox.spec  |   6 +--
 python3.patch | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 123 insertions(+), 3 deletions(-)
---
diff --git a/openbox.spec b/openbox.spec
index 219f1e3..0cdc60c 100644
--- a/openbox.spec
+++ b/openbox.spec
@@ -6,13 +6,14 @@ Summary:      Small and fast window manger for the X Window
 Summary(pl.UTF-8):     Mały i szybki zarządca okien dla X Window
 Name:          openbox
 Version:       3.6.1
-Release:       6
+Release:       7
 Epoch:         1
 License:       GPL v2+
 Group:         X11/Window Managers
 #Source0Download: http://openbox.org/wiki/Openbox:Download
 Source0:       http://openbox.org/dist/openbox/%{name}-%{version}.tar.xz
 # Source0-md5: 46bf5f1edda0eda0d9e824b585988be9
+Patch0:                python3.patch
 URL:           http://openbox.org/
 BuildRequires: autoconf >= 2.54
 BuildRequires: automake >= 1:1.11
@@ -239,8 +240,7 @@ Motyw Syscrash dla Openboksa.
 
 %prep
 %setup -q
-
-%{__sed} -i -e '1s,/usr/bin/env python$,%{__python},' 
data/autostart/openbox-xdg-autostart
+%patch0 -p1
 
 %build
 %{__libtoolize}
diff --git a/python3.patch b/python3.patch
new file mode 100644
index 0000000..dc62821
--- /dev/null
+++ b/python3.patch
@@ -0,0 +1,120 @@
+diff -ur openbox-3.6.1.orig/data/autostart/openbox-xdg-autostart 
openbox-3.6.1/data/autostart/openbox-xdg-autostart
+--- openbox-3.6.1.orig/data/autostart/openbox-xdg-autostart    2013-04-17 
14:27:27.000000000 +0200
++++ openbox-3.6.1/data/autostart/openbox-xdg-autostart 2024-04-23 
00:59:58.692750755 +0200
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/python3
+ 
+ # openbox-xdg-autostart runs things based on the XDG autostart specification
+ # Copyright (C) 2008       Dana Jansens
+@@ -28,9 +28,7 @@
+     from xdg.DesktopEntry import DesktopEntry
+     from xdg.Exceptions import ParsingError
+ except ImportError:
+-    print
+-    print >>sys.stderr, "ERROR:", ME, "requires PyXDG to be installed"
+-    print
++    sys.stderr.write("\nERROR: %s requires PyXDG to be installed\n" % ME)
+     sys.exit(1)
+ 
+ def main(argv=sys.argv):
+@@ -51,7 +49,7 @@
+             try:
+                 autofile = AutostartFile(path)
+             except ParsingError:
+-                print "Invalid .desktop file: " + path
++                print("Invalid .desktop file: " + path)
+             else:
+                 if not autofile in files:
+                     files.append(autofile)
+@@ -99,9 +97,9 @@
+ 
+     def _alert(self, str, info=False):
+         if info:
+-            print "\t ", str
++            print("\t ", str)
+         else:
+-            print "\t*", str
++            print("\t*", str)
+ 
+     def _showInEnvironment(self, envs, verbose=False):
+         default = not self.de.getOnlyShowIn()
+@@ -146,14 +144,14 @@
+ 
+     def display(self, envs):
+         if self._shouldRun(envs):
+-            print "[*] " + self.de.getName()
++            print("[*] " + self.de.getName())
+         else:
+-            print "[ ] " + self.de.getName()
++            print("[ ] " + self.de.getName())
+         self._alert("File: " + self.path, info=True)
+         if self.de.getExec():
+             self._alert("Executes: " + self.de.getExec(), info=True)
+         self._shouldRun(envs, True)
+-        print
++        print()
+ 
+     def run(self, envs):
+         here = os.getcwd()
+@@ -165,34 +163,34 @@
+         os.chdir(here)
+ 
+ def show_help():
+-    print "Usage:", ME, "[OPTION]... [ENVIRONMENT]..."
+-    print
+-    print "This tool will run xdg autostart .desktop files"
+-    print
+-    print "OPTIONS"
+-    print "  --list        Show a list of the files which would be run"
+-    print "                Files which would be run are marked with an 
asterix"
+-    print "                symbol [*].  For files which would not be run,"
+-    print "                information is given for why they are excluded"
+-    print "  --help        Show this help and exit"
+-    print "  --version     Show version and copyright information"
+-    print
+-    print "ENVIRONMENT specifies a list of environments for which to run 
autostart"
+-    print "applications.  If none are specified, only applications which do 
not "
+-    print "limit themselves to certain environments will be run."
+-    print
+-    print "ENVIRONMENT can be one or more of:"
+-    print "  GNOME         Gnome Desktop"
+-    print "  KDE           KDE Desktop"
+-    print "  ROX           ROX Desktop"
+-    print "  XFCE          XFCE Desktop"
+-    print "  Old           Legacy systems"
+-    print
++    print("Usage:", ME, "[OPTION]... [ENVIRONMENT]...")
++    print()
++    print("This tool will run xdg autostart .desktop files")
++    print()
++    print("OPTIONS")
++    print("  --list        Show a list of the files which would be run")
++    print("                Files which would be run are marked with an 
asterix")
++    print("                symbol [*].  For files which would not be run,")
++    print("                information is given for why they are excluded")
++    print("  --help        Show this help and exit")
++    print("  --version     Show version and copyright information")
++    print()
++    print("ENVIRONMENT specifies a list of environments for which to run 
autostart")
++    print("applications.  If none are specified, only applications which do 
not ")
++    print("limit themselves to certain environments will be run.")
++    print()
++    print("ENVIRONMENT can be one or more of:")
++    print("  GNOME         Gnome Desktop")
++    print("  KDE           KDE Desktop")
++    print("  ROX           ROX Desktop")
++    print("  XFCE          XFCE Desktop")
++    print("  Old           Legacy systems")
++    print()
+ 
+ def show_version():
+-    print ME, VERSION
+-    print "Copyright (c) 2008        Dana Jansens"
+-    print
++    print(ME, VERSION)
++    print("Copyright (c) 2008        Dana Jansens")
++    print()
+ 
+ if __name__ == "__main__":
+         sys.exit(main())
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/openbox.git/commitdiff/0a56e224ab9940c6a458fbb672a709e9c541dedd

_______________________________________________
pld-cvs-commit mailing list
pld-cvs-commit@lists.pld-linux.org
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to