On Fri, Aug 04, 2023 at 09:04:31PM +0000, Klemens Nanni wrote:
> First time trying anything like orca(1); I bet there's more:
>
> -23:59:57 pid: 94190 xfce4-session cat: /proc/94190/cmdline: No such file or directory
> +00:00:12 pid: 94190 xfce4-session xfce4-session
>
> Feedback? OK?
Now with all patches added to fix this idiom.
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/gnome/orca/Makefile,v
retrieving revision 1.138
diff -u -p -r1.138 Makefile
--- Makefile 26 May 2023 06:23:30 -0000 1.138
+++ Makefile 4 Aug 2023 21:21:59 -0000
@@ -2,6 +2,7 @@ COMMENT= assistive screen reader
GNOME_PROJECT= orca
GNOME_VERSION= 44.1
+REVISION= 0
# LGPLv2
PERMIT_PACKAGE= Yes
Index: patches/patch-src_orca_debug_py
===================================================================
RCS file: patches/patch-src_orca_debug_py
diff -N patches/patch-src_orca_debug_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_orca_debug_py 4 Aug 2023 21:29:17 -0000
@@ -0,0 +1,12 @@
+Index: src/orca/debug.py
+--- src/orca/debug.py.orig
++++ src/orca/debug.py
+@@ -522,7 +522,7 @@ def getOpenFDCount(pid):
+
+ def getCmdline(pid):
+ try:
+- openFile = os.popen('cat /proc/%s/cmdline' % pid)
++ openFile = os.popen('ps -o args -p %s | sed 1d' % pid)
+ cmdline = openFile.read()
+ openFile.close()
+ except:
Index: patches/patch-src_orca_orca_bin_py_in
===================================================================
RCS file: patches/patch-src_orca_orca_bin_py_in
diff -N patches/patch-src_orca_orca_bin_py_in
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_orca_orca_bin_py_in 4 Aug 2023 21:29:17 -0000
@@ -0,0 +1,12 @@
+Index: src/orca/orca_bin.py.in
+--- src/orca/orca_bin.py.in.orig
++++ src/orca/orca_bin.py.in
+@@ -64,7 +64,7 @@ class ListApps(argparse.Action):
+ name = "[DEAD]"
+
+ try:
+- cmdline = subprocess.getoutput('cat /proc/%s/cmdline' % pid)
++ cmdline = subprocess.getoutput('ps -o args -p %s | sed 1d' % pid)
+ except:
+ cmdline = '(exception encountered)'
+ else:
Index: patches/patch-src_orca_script_utilities_py
===================================================================
RCS file: patches/patch-src_orca_script_utilities_py
diff -N patches/patch-src_orca_script_utilities_py
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-src_orca_script_utilities_py 4 Aug 2023 21:22:25 -0000
@@ -0,0 +1,14 @@
+replace /proc/ with ps(1) in 'orca --list-apps' to get process arguments by PID
+
+Index: src/orca/script_utilities.py
+--- src/orca/script_utilities.py.orig
++++ src/orca/script_utilities.py
+@@ -147,7 +147,7 @@ class Utilities:
+ return ""
+
+ try:
+- cmdline = subprocess.getoutput("cat /proc/%s/cmdline" % pid)
++ cmdline = subprocess.getoutput("ps -o args -p %s | sed 1d" % pid)
+ except:
+ return ""
+
No comments:
Post a Comment