[opensuse-factory] New package wcd for openSUSE Factory
Hi, I have created a new package wcd for openSUSE. Wcd is a shell utility to change directory fast on the command line. See also http://waterlan.home.xs4all.nl/#WCD_ANCHOR Wcd is a mature application. I am also the upstream maintainer of Wcd. Yesterday I have done a submit request the wcd package to devel project utilities (https://build.opensuse.org/project/show/utilities). The request is still open. best regards, Erwin Waterlander -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Wed, 15 Oct 2014 22:04:59 +0200 Erwin Waterlander <waterlan@xs4all.nl> wrote:
I recently got confused between the packages available on openSUSE named WICD, pronounced "wicked", and Wicked, pronounced "wicked". Now we are to have "wcd", pronounced . . . ? ;-) -- Graham Davis, Bracknell, Berks. openSUSE 13.2-RC1 (64-bit); KDE 4.14.1; AMD Phenom II X2 550 Processor; Kernel: 3.16.3; Video: nVidia GeForce 210 (using nouveau driver); Sound: ATI SBx00 Azalia (Intel HDA) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
I have created a new package wcd for openSUSE. Wcd is a shell utility to change directory fast on the command line.
The "wcd" function is prone to race conditions because all invocations use the same file. That raises the question, why use a file at all? At least on Linux where pipes properly work and ttys exist, there is no need for additional temporary files. wcd () { go="${WCDHOME:-${HOME}}/bin/wcd.go"; rm -f "$go" 2> /dev/null; /usr/bin/wcd.exe "$@"; [ -f "$go" ] && . "$go"; unset go }
The documentation directory should probably be called /usr/share/doc/packages/wcd rather than wcd-5.2.25 since it is impossible to coinstall two versions currently.
Uh, well, WCD? -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Jan Engelhardt schreef op 2014-10-16 13:28:
No. Every user has its own 'go script'. And a user will not type the wcd command twice at the same time.
A file works fine.
Thanks. I fixed that. best regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Op 17-10-2014 0:36 Claudio Freire schreef:
User -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, 17 Oct 2014 00:25, waterlan <waterlan@...> wrote:
Playing Devils' Advocat: O'rly? Multiple xterms? To get sure of at least that, you would have to use either the $PPID, or the tty/pty-id to differate that.
It's not about raining onto your parade, it's about pointing out potential problems. Better get answers to that now than later. About the name, I would speak it "We-CD" and CD like in Compact-Disc. - Yamaban -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Op 17-10-2014 0:39 Yamaban schreef:
With two keyboards, and four hands? Perhaps the devil can do that, but I can't. ;)
First I have to see the problem. In 17 years I have not seen a race condition problem, nor did I get a report. I have used it on many systems, at home and in industry. But I'm always open for improvements. Patches are welcome.
About the name, I would speak it "We-CD" and CD like in Compact-Disc.
Also good. best regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/17/2014 07:56 AM, Erwin Waterlander wrote:
Shared accounts are not unusual on servers. So if 2 persons are using the same account and `wcd` at the same time ... ... "yes, we can". ;-) Have a nice day, Berny -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Op 17-10-2014 11:28 Bernhard Voelker schreef:
OK. You have got a point. The two persons can set a different WCDHOME variable. They would need to do that already if they don't want to share the (extra) tree data, bans, excludes, aliases, and stack. The two users would need to make some personal setup on the shared account anyway, for instance for their personal aliases or vim editor settings. best regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/17/2014 04:49 PM, Erwin Waterlander wrote:
Why? I mean all of them can use the same settings for that single account, and they can simultaneously run vim, the aliases ... but not wcd. ;-/ Couldn't it just write to stdout? wcd () { local out="$( env wcd "$@")" || return test "$out" && eval "$out" } (I didn't look at wcd too much - especially the output, so eval might be the wrong approach. It must be more complicated, otherwise directly cd-ing to "$out" would be the obvious way.) Have a nice day, Berny -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Friday 2014-10-17 17:14, Bernhard Voelker wrote:
Only if he makes the interactive session open /dev/tty and writes there instead of stdout. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Op 17-10-2014 17:14 Bernhard Voelker schreef:
I would not want to use my colleagues aliases and vim settings...
Yes it can. wcd () { cd "$($HOME/bin/wcd.exe -GN -j $@)" } but then you loose the option to choose when you have multiple matches. And that is not handy when you have a lot of folders in the tree index. Normally when there are multiple matches, or when you want to see the stack, an ncurses interface is launched. This sort of breaks the stdout method. Perhaps it is possible, but I did not look into that for a long time. best regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/17/2014 05:14 PM, Bernhard Voelker wrote:
You can use wcd. Like I said, each user can set $WCDHOME to a personal folder. If you don't want that this function also works: function wcd { $HOME/bin/wcd.exe -G $HOME/.wcd/${PPID} $* . $HOME/.wcd/${PPID}/wcd.go } I don't see a real blocking issue for using wcd on a shared account. best regards, Erwin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Fri, Oct 17, 2014 at 2:56 AM, Erwin Waterlander <waterlan@xs4all.nl> wrote:
Broadcasted terminals (see terminator broadcast). Slight human error can make you broadcast to the same server, and kaputt. Cronjobs, using wcd inside a cron is probably not a very good idea, but someone might think it dandy to not have to type the whole path, and then you can run into trouble (not only the race condition of course, but it would be possible for wcd to race another wcd for sure). In any case, using the user alone is a poor choice when you have the shell's PID. Use that, it takes almost no effort. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Mon, Oct 20, 2014 at 3:30 PM, Erwin Waterlander <waterlan@xs4all.nl> wrote:
I know, but people will abuse it. Be ready for bug reports. And it *is* a bug. What's this reluctance to use the shell's PID as someone suggested? It's a trivial enough change. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/20/2014 09:16 PM, Claudio Freire wrote:
I am ready for bug reports. So far there is no report that anybody actually hit this problem. I admit it is possible that the problem can occur if two people on a shared account enter the wcd command in the same millisecond.
What's this reluctance to use the shell's PID as someone suggested? It's a trivial enough change.
I'm not reluctant to solve this issue. I may do that in a future version. I gave two possible workarounds on this list. Use the $WCDHOME variable, or use the -G option. I see it as a minor issue, not important enough to block the current version of wcd from Suse. best regards, Erwin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Am 17.10.2014 um 00:25 schrieb waterlan:
Multiple people administering a server as "root". -- Stefan Seyfried "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." -- Richard Feynman -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Graham P Davis schreef op 2014-10-16 11:44:
double u cee dee Or try in Dutch, it sounds like: way cay day. ;) -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
%{_bindir}/wcd.exe should be moved to %{_libdir}, since it is not supposed to be called directly (and wcd.exe is a weird name). $HOME/bin is not guaranteed to exist. Really the the wcd function should not use any files at all. Also, it clobbers the go shell variable. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andreas Schwab schreef op 2014-10-21 09:58:
%{_bindir}/wcd.exe should be moved to %{_libdir}, since it is not supposed to be called directly
I will change this.
(and wcd.exe is a weird name).
It is a valid name, but some people don't like it because it reminds them of Windows. I will change it.
$HOME/bin is not guaranteed to exist.
It will be automatically created.
Really the the wcd function should not use any files at all.
For now I postpone this issue to later.
Also, it clobbers the go shell variable.
Can you explain? Thanks for the feedback. best regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Erwin Waterlander <waterlan@xs4all.nl> writes:
The function overwrites it. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andreas Schwab schreef op 2014-10-21 10:34:
You are right. I fix it. Thanks. -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Erwin Waterlander <waterlan@xs4all.nl> writes:
$HOME/bin is not guaranteed to exist.
It will be automatically created.
It's not the right place for temporary files. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andreas Schwab schreef op 2014-10-21 10:38:
I know, but I want to keep it there for backward compatibility. regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Erwin Waterlander <waterlan@xs4all.nl> writes:
Which compatibility? This is an implementation detail of wcd. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andreas Schwab schreef op 2014-10-21 12:55:
For all those people who manually created the function. Those are a lot over the past 18 years, and I don't want to bother them. regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Erwin Waterlander <waterlan@xs4all.nl> writes:
They will continue to use the function they defined on their own. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Andreas Schwab schreef op 2014-10-21 14:13:
The bin sub-folder is default on Unix. That is set in the binary and is also documented. I can use the -G option to change the location, but I don't want to do that in the default function. When the option -G is used WCDHOME has no influence on the location of the go-script anymore. This may surprise users. I leave the use of -G to personal configurations. Because it is a shell script, and personal scripts are put typically in ~/bin, I was thinking 18 years ago to put this one there too. Perhaps wrong, but it is not a big deal. If it is a problem for a user he/she can always change the location. regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tue, Oct 21, 2014 at 1:15 PM, Erwin Waterlander <waterlan@xs4all.nl> wrote:
Well, TBH, I don't think putting an executable script in /tmp is a good idea either. I'm pretty sure the security guys will complain if done like that. I prefer something in home than in /tmp. In that sense, while ~/bin isn't the right place (I'd rather go for ~/tmp if it was standard), it's the safest choice ATM. The function only has to be really sure it's not clobbering any existing script there, and that folder permissions are not too permissive. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tue, 21 Oct 2014 19:05, Claudio Freire wrote:
~/bin should be created at first user login due to /etc/skel
Hmm, how about a folder "wcd" under "~/.local"? .local/ is in /etc/skel, and is conform to the freedesktop standards, OTOH, maybe the dir ~/.config/ is better, but you have to create it with mode 0700 if it isn't there already (not in skel). - Yamaban -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
В Tue, 21 Oct 2014 19:21:38 +0200 (CEST) Yamaban <foerster@lisas.de> пишет:
$XDG_RUNTIME_DIR?
-- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tue, 21 Oct 2014 19:30, Andrei Borzenkov wrote:
The trouble with $XDG_* is that I can not get that to work well without having a valid Xsession. Not so good for remote work via ssh. That is why I brought ~/.local/{program} and ~/.config/{program} into the discussion. Yes, testing for /run/user/{UID}/ can also be done, but I still find systems without /run/user/ or /var/run/user/ structure. - Yamaban. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tuesday, October 21, 2014 07:44:54 PM Yamaban wrote:
man pam_systemd pam_systemd is part of "common-session", so no X dependency here ... Regards, Stefan -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/21/2014 07:44 PM, Yamaban wrote:
I find backward compatibility and portability very important. Wcd is still compatible with the first version, and many shells are supported. I'm not optimizing for specific Unix (like) systems. regards, Erwin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
These days, /var/run/user/$UID/ could be an option. -- Karl Eichwalder SUSE LINUX Products GmbH R&D / Documentation Maxfeldstraße 5 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer, HRB 16746 (AG Nürnberg) -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tuesday 2014-10-21 09:58, Andreas Schwab wrote:
%{_bindir}/wcd.exe should be moved to %{_libdir}, since it is not supposed to be called directly (and wcd.exe is a weird name).
That should be %_libexecdir in fact. As for the name, what's in a name. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/21/2014 10:31 AM, Jan Engelhardt wrote:
What I read is that libexec is intended for programs that are not intended to be be executed directly by users or shell scripts. In other words, libexec is for programs called by programs. The wcd program is intended to be executed by a shell script, so the correct location of the program is under /usr/bin/. Second, I read that Suse does not support libexec. It is also not present on my openSUSE 13.1 installation. best regards, Erwin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On Tuesday 2014-10-21 21:23, Erwin Waterlander wrote:
It is not that strict. The point is simply that /usr/lib(exec)/whatever/ is not going to be in the $PATH, so calling a program there usually requires specifying the full path. libexec is for programs invoked by other “routines”, i.e. abstract mechanisms that conveniently hide the full path from the user. That may be programs, scripts, sh aliases, or even symlinks: /sbin/init is just a symlink to /usr/lib/systemd/systemd, too, you know.
Second, I read that Suse does not support libexec. It is also not present on my openSUSE 13.1 installation.
We do support the concept of libexec. (GNU packages sort of demand it.) It just so happens that we defined the libexec directory to be /usr/lib, which coincides with %_libdir on some (but not all) platforms. -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
Jan Engelhardt schreef op 2014-10-22 02:12:
OK, thanks for the info. I fix it. best regards, -- Erwin Waterlander http://waterlan.home.xs4all.nl/ -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
On 10/22/2014 09:07 AM, Erwin Waterlander wrote:
I have uploaded the changes. See https://build.opensuse.org/request/show/258141 regards, Erwin -- To unsubscribe, e-mail: opensuse-factory+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-factory+owner@opensuse.org
participants (12)
-
Andreas Schwab
-
Andrei Borzenkov
-
Bernhard Voelker
-
Claudio Freire
-
Erwin Waterlander
-
Graham P Davis
-
Jan Engelhardt
-
Karl Eichwalder
-
Stefan Bruens
-
Stefan Seyfried
-
waterlan
-
Yamaban