Mon Sep 5 15:55:43 2022 UTC ()
wm/openbox: Patch openbox-xdg-autostart to run in Python 3.
(riastradh)
diff -r1.112 -r1.113 pkgsrc/wm/openbox/Makefile
diff -r1.34 -r1.35 pkgsrc/wm/openbox/distinfo
diff -r0 -r1.1 pkgsrc/wm/openbox/patches/patch-data_autostart_openbox-xdg-autostart
--- pkgsrc/wm/openbox/Makefile 2022/06/30 11:18:57 1.112
+++ pkgsrc/wm/openbox/Makefile 2022/09/05 15:55:42 1.113
| @@ -1,17 +1,17 @@ | | | @@ -1,17 +1,17 @@ |
1 | # $NetBSD: Makefile,v 1.112 2022/06/30 11:18:57 nia Exp $ | | 1 | # $NetBSD: Makefile,v 1.113 2022/09/05 15:55:42 riastradh Exp $ |
2 | | | 2 | |
3 | DISTNAME= openbox-3.6.1 | | 3 | DISTNAME= openbox-3.6.1 |
4 | PKGREVISION= 19 | | 4 | PKGREVISION= 20 |
5 | CATEGORIES= wm x11 | | 5 | CATEGORIES= wm x11 |
6 | MASTER_SITES= http://openbox.org/dist/openbox/ | | 6 | MASTER_SITES= http://openbox.org/dist/openbox/ |
7 | | | 7 | |
8 | MAINTAINER= snj@NetBSD.org | | 8 | MAINTAINER= snj@NetBSD.org |
9 | HOMEPAGE= http://openbox.org/ | | 9 | HOMEPAGE= http://openbox.org/ |
10 | COMMENT= Standards compliant, light-weight, and extensible window manager | | 10 | COMMENT= Standards compliant, light-weight, and extensible window manager |
11 | LICENSE= gnu-gpl-v2 | | 11 | LICENSE= gnu-gpl-v2 |
12 | | | 12 | |
13 | DEPENDS+= vera-ttf>=1.10:../../fonts/vera-ttf | | 13 | DEPENDS+= vera-ttf>=1.10:../../fonts/vera-ttf |
14 | | | 14 | |
15 | GNU_CONFIGURE= YES | | 15 | GNU_CONFIGURE= YES |
16 | USE_TOOLS+= gmake msgfmt pkg-config | | 16 | USE_TOOLS+= gmake msgfmt pkg-config |
17 | USE_LIBTOOL= YES | | 17 | USE_LIBTOOL= YES |
--- pkgsrc/wm/openbox/distinfo 2021/10/26 11:25:16 1.34
+++ pkgsrc/wm/openbox/distinfo 2022/09/05 15:55:43 1.35
| @@ -1,6 +1,7 @@ | | | @@ -1,6 +1,7 @@ |
1 | $NetBSD: distinfo,v 1.34 2021/10/26 11:25:16 nia Exp $ | | 1 | $NetBSD: distinfo,v 1.35 2022/09/05 15:55:43 riastradh Exp $ |
2 | | | 2 | |
3 | BLAKE2s (openbox-3.6.1.tar.gz) = c8cb7c66138f4c6832db9c8a302c91f2ae13df6fa9b8363f5bb726dab00c7d9a | | 3 | BLAKE2s (openbox-3.6.1.tar.gz) = c8cb7c66138f4c6832db9c8a302c91f2ae13df6fa9b8363f5bb726dab00c7d9a |
4 | SHA512 (openbox-3.6.1.tar.gz) = 5e6f4a214005bea8b26bc8959fe5bb67356a387ddd317e014f43cb5b5bf263ec617a5973e2982eb76a08dc7d3ca5ec9e72e64c9b5efd751001a8999b420b1ad0 | | 4 | SHA512 (openbox-3.6.1.tar.gz) = 5e6f4a214005bea8b26bc8959fe5bb67356a387ddd317e014f43cb5b5bf263ec617a5973e2982eb76a08dc7d3ca5ec9e72e64c9b5efd751001a8999b420b1ad0 |
5 | Size (openbox-3.6.1.tar.gz) = 962665 bytes | | 5 | Size (openbox-3.6.1.tar.gz) = 962665 bytes |
6 | SHA1 (patch-ab) = e6d837a3f74deacdb9ebbf813b7f86497fa34fa9 | | 6 | SHA1 (patch-ab) = e6d837a3f74deacdb9ebbf813b7f86497fa34fa9 |
| | | 7 | SHA1 (patch-data_autostart_openbox-xdg-autostart) = a9fc5d705eab3fc7828cfa8c472378cf99f608a6 |
$NetBSD: patch-data_autostart_openbox-xdg-autostart,v 1.1 2022/09/05 15:55:43 riastradh Exp $
Make this run in Python 3.
--- data/autostart/openbox-xdg-autostart.orig 2013-04-17 12:27:27.000000000 +0000
+++ data/autostart/openbox-xdg-autostart
@@ -19,6 +19,8 @@
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
+from __future__ import print_function
+
ME="openbox-xdg-autostart"
VERSION="1.1"
@@ -28,9 +30,7 @@ try:
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\n" % (ME,))
sys.exit(1)
def main(argv=sys.argv):
@@ -51,7 +51,7 @@ def main(argv=sys.argv):
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 +99,9 @@ class AutostartFile:
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 +146,14 @@ class AutostartFile:
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 +165,34 @@ class AutostartFile:
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())