* speakupconf problem and fix @ Adam Myrow ` William Hubbs 0 siblings, 1 reply; 4+ messages in thread From: Adam Myrow @ UTC (permalink / raw) To: speakup Hi. I just updated Speakup with GIT to check out some of the changes. I found a problem with speakupconf right off. It was failing to save parameters because it was giving the "find" command invalid options. A little investigation showed that the problem was in this line of code. SAVELIST=`find . -readable -writable -type f |sed 's/..//'` The problem is, the version of find in Slackware 12.2 does not recognize the "-readable" and "-writable" options. I suspect that they are in some newer version of find. The "find --version" command gives the following on my system. GNU find version 4.2.31 Built using GNU gnulib version 2007-02-24 Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION I quickly found the solution. I modified the problem line to look like this. SAVELIST=`find . -perm -u+rw -type f |sed 's/..//'` I believe this accomplishes the same thing as the original line, using the "-perm" flag which is a part of find on just about any Unix system in existence. Does anybody see any problem with having this change made to the GIT version of speakupconf? It is probably best to use the most portable syntax where possible to avoid future problems like this. Thanks. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: speakupconf problem and fix speakupconf problem and fix Adam Myrow @ ` William Hubbs ` William Hubbs 0 siblings, 1 reply; 4+ messages in thread From: William Hubbs @ UTC (permalink / raw) To: Speakup is a screen review system for Linux. -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi Adam, On Mon, Jun 22, 2009 at 08:25:59PM -0500, Adam Myrow wrote: > The problem is, the version of find in Slackware 12.2 does not recognize > the "-readable" and "-writable" options. I suspect that they are in some > newer version of find. The "find --version" command gives the following on > my system. > > GNU find version 4.2.31 > Built using GNU gnulib version 2007-02-24 > Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION You are correct; you are running an old version of findutils. find - --version returns the following here: find (GNU findutils) 4.4.0 Copyright (C) 2007 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Written by Eric B. Decker, James Youngman, and Kevin Dalley. Built using GNU gnulib version e5573b1bad88bfabcda181b9e0125fb0c52b7d3b Features enabled: D_TYPE O_NOFOLLOW(enabled) LEAF_OPTIMISATION FTS() CBO(level=0) I also looked in my changelogs, and we have had this version of findutils since march 2008, so it has been around for quite a while. > I quickly found the solution. I modified the problem line to look like > this. > > SAVELIST=`find . -perm -u+rw -type f |sed 's/..//'` > > I believe this accomplishes the same thing as the original line, using the > "-perm" flag which is a part of find on just about any Unix system in > existence. Does anybody see any problem with having this change made to > the GIT version of speakupconf? It is probably best to use the most > portable syntax where possible to avoid future problems like this. Thanks. Actually it doesn't do the same thing. The difference is subtile, but important. The solution you propose only works if the user running speakupconf is also the owner of the files in /sys/accessibility/speakup, which is not necessarily true. This is because the -perm flag compares its argument to the permissions of the files. The -readable and -writable flags, on the other hand, test to see if the user running the find has permission to read and write the files even if the user does not own them. This is what we want with speakupconf, since it is possible for different users to have their own preferred speakup settings. I don't know of a way to accomplish this easily without the -readable and -writable flags. For those of you on the list with newer findutils, here is a great example of the difference: As a user, run the following two commands: find /sbin -perm -u+rw -type f -print find /sbin -readable -writable -type f -print They give very different results. If you can come up with another solution that does the same thing we are looking for (allows a user to save the files they can read and write regardless of whether they actually own the files), let me know. Thanks, William -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.11 (GNU/Linux) iEYEARECAAYFAkpA9n8ACgkQblQW9DDEZThpBACfWomclS8OUY/aPmomGaf6Da6g HzgAoLM28hCyiX6jvBE9spXqO9w+QwOb =j41U -----END PGP SIGNATURE----- ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: speakupconf problem and fix ` William Hubbs @ ` William Hubbs ` Adam Myrow 0 siblings, 1 reply; 4+ messages in thread From: William Hubbs @ UTC (permalink / raw) To: Speakup is a screen review system for Linux. On Tue, Jun 23, 2009 at 10:36:31AM -0500, William Hubbs wrote: > > The problem is, the version of find in Slackware 12.2 does not recognize > > the "-readable" and "-writable" options. I suspect that they are in some > > newer version of find. The "find --version" command gives the following on > > my system. (snip) > If you can come up with another solution that does the same thing we > are looking for (allows a user to save the files they can read and write > regardless of whether they actually own the files), let me know. Chris and I came up with a solution for this issue, and the fix is checked into git. Adam, can you do another pull and let me know if the change we made works for you? Thanks, William ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: speakupconf problem and fix ` William Hubbs @ ` Adam Myrow 0 siblings, 0 replies; 4+ messages in thread From: Adam Myrow @ UTC (permalink / raw) To: Speakup is a screen review system for Linux. On Tue, 23 Jun 2009, William Hubbs wrote: > Chris and I came up with a solution for this issue, and the fix is > checked into git. Adam, can you do another pull and let me know if the > change we made works for you? It seems to work perfectly, and although probably a bit slower than the original method, is more portable. Thanks for explaining why using -perm wasn't the right solution. I never run speakupconf as a regular user, so didn't notice the difference. Since I'm the only user on my computer, I just do a "speakupconf load" in /etc/rc.d/rc.local at boot up. I wonder why Slackware stuck with an old version of find? I know they have been reluctant to upgrade to BASH 4 because of some incompatibilities that they've encountered in testing, so maybe, it was something similar. anyway, thanks for the quick response. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~ UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
speakupconf problem and fix Adam Myrow
` William Hubbs
` William Hubbs
` Adam Myrow
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).