Bug#636147: /etc/editorrc ?
On Tue, Aug 02, 2011 at 04:42:01PM +, Thorsten Glaser wrote: Josip Rodin dixit: /var/lib/misc/editorrc could work? Sure would. Do you want me to prepare a patch for joe? If so, should I version it as NMU or regularily? You can prepare a patch, sure, but while you're at it, do first test the situation where 'editorrc' is a slave to 'editor' so that you can be sure what's going on there. -- 2. That which causes joy or happiness. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Josip Rodin dixit: You can prepare a patch, sure, but while you're at it, do first test the situation where 'editorrc' is a slave to 'editor' so that you can be sure Yup, tested that. Took me quite a few turns, too. The joe patch is attached, if you want me to upload this, just tell me so. The jupp cvsweb is here: https://www.mirbsd.org/cvs.cgi/contrib/hosted/tg/deb/jupp/debian/ In the end, I had to add a preinst for cleaning up before upgrading (but only then; taking care of the version numbers as well – the current /bin/sh-in-debian activities prepared me for that), and manually create the /etc/{joe,jupp}/editorrc symlinks in postinst. Putting them into the .deb didn’t work for various reasons (since it used to be managed by update-alternatives before). The slave stuff works well. bye, //mirabilos -- Yay for having to rewrite other people's Bash scripts because bash suddenly stopped supporting the bash extensions they make use of -- Tonnerre Lombard in #nosecdiff -u joe-3.7/debian/control joe-3.7/debian/control --- joe-3.7/debian/control +++ joe-3.7/debian/control @@ -7,6 +7,7 @@ Homepage: http://joe-editor.sourceforge.net/ Package: joe +Breaks: jupp ( 3.1.17-5~~) Architecture: any Depends: ${shlibs:Depends} Description: user friendly full screen text editor diff -u joe-3.7/debian/postinst joe-3.7/debian/postinst --- joe-3.7/debian/postinst +++ joe-3.7/debian/postinst @@ -3,20 +3,23 @@ if [ $1 = configure ]; then update-alternatives --install /usr/bin/editor editor /usr/bin/joe 70 \ +--slave /var/lib/misc/editorrc editorrc /etc/joe/joerc \ --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/joe.1.gz - update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/joerc 70 update-alternatives --install /usr/bin/editor editor /usr/bin/jmacs 50 \ +--slave /var/lib/misc/editorrc editorrc /etc/joe/jmacsrc \ --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/jmacs.1.gz - update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/jmacsrc 50 update-alternatives --install /usr/bin/editor editor /usr/bin/jstar 50 \ +--slave /var/lib/misc/editorrc editorrc /etc/joe/jstarrc \ --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/jstar.1.gz - update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/jstarrc 50 update-alternatives --install /usr/bin/editor editor /usr/bin/jpico 50 \ +--slave /var/lib/misc/editorrc editorrc /etc/joe/jpicorc \ --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/jpico.1.gz - update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/jpicorc 50 update-alternatives --install /usr/bin/editor editor /usr/bin/rjoe 25 \ +--slave /var/lib/misc/editorrc editorrc /etc/joe/rjoerc \ --slave /usr/share/man/man1/editor.1.gz editor.1.gz /usr/share/man/man1/rjoe.1.gz - update-alternatives --install /etc/joe/editorrc editorrc /etc/joe/rjoerc 25 + + rm -f /etc/joe/editorrc + ln -sf ../../var/lib/misc/editorrc /etc/joe/editorrc if [ -x `which update-menus 2/dev/null` ]; then update-menus ; fi diff -u joe-3.7/debian/changelog joe-3.7/debian/changelog --- joe-3.7/debian/changelog +++ joe-3.7/debian/changelog @@ -1,3 +1,12 @@ +joe (3.7-2.1) unstable; urgency=low + + * Non-maintainer upload. + * Improve coexistence of joe and jupp: move the editorrc symlink +to /var/lib/misc/editorrc and make it an update-alternatives +slave to editor (agreed by Raphaël Hertzog, Josip Rodin) + + -- Thorsten Glaser t...@mirbsd.de Wed, 03 Aug 2011 15:52:28 + + joe (3.7-2) unstable; urgency=high * Fix the crash when typing too many dashes on a line, d'oh, diff -u joe-3.7/debian/prerm joe-3.7/debian/prerm --- joe-3.7/debian/prerm +++ joe-3.7/debian/prerm @@ -4,11 +4,6 @@ update-alternatives --remove editor /usr/bin/joe - update-alternatives --remove editorrc /etc/joe/joerc update-alternatives --remove editor /usr/bin/jmacs - update-alternatives --remove editorrc /etc/joe/jmacsrc update-alternatives --remove editor /usr/bin/jstar - update-alternatives --remove editorrc /etc/joe/jstarrc update-alternatives --remove editor /usr/bin/jpico - update-alternatives --remove editorrc /etc/joe/jpicorc update-alternatives --remove editor /usr/bin/rjoe - update-alternatives --remove editorrc /etc/joe/rjoerc fi only in patch2: unchanged: --- joe-3.7.orig/debian/preinst +++ joe-3.7/debian/preinst @@ -0,0 +1,9 @@ +#!/bin/sh -e + +# drop old editorrc (master alternative and symlink file both) +if test x$1 = xupgrade test -n $2 \ +dpkg --compare-versions $2 lt '3.7-2.1~~'; then + # this will noisily pass if editorrc was already removed, + # but not remove a slave alternative + (update-alternatives --remove-all editorrc 2/dev/null || :) +fi
Bug#636147: /etc/editorrc ?
On Mon, Aug 01, 2011 at 10:28:17PM +, Thorsten Glaser wrote: Maybe simply coding it differently inside joe will be the best solution - if it notices that $self is 'editor', then don't just look for /etc/joe/${self}rc but instead look itself up once again through /etc/alternatives/editor to see what actual $variant was chosen, and then use that /etc/joe/${variant}rc. Ugh that is some major Debian specific source patching. It can be done, but I'm not really comfortable with this way out if we have another. I could hack it if really needed, but the alternatives system is Debian specific, and we can't even simply use realpath either, because the joe variants are symbolic links (by design). My plan is: have a coordinated upload of src:joe and src:jupp whose binary packages (all three) Break the previous versions of the other editor and move the alternative to /etc and have a symlink to it. I can prepare a patch for joe if you want. Parallel to that, we ask the dpkg people if we can move to a slave, and include that in the upload if possible (since I've fixed it for now, that upload isn't time critical). Well, I don't like that idea because it involves pretty much the same amount of work to accomplish the same Debian-specific solution. And if you no longer have /etc/joe/editorrc but instead /etc/editorrc, then that still requires source patching for joe to actually *read* it, so you're back to square one. I mean really, when we get back to the basics - if we in Debian decided to invent this editor symlink to editors, then it's perfectly acceptable for us to make actual editors work properly with that, rather than jump through hoops. Who exactly could complain about that? -- 2. That which causes joy or happiness. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Josip Rodin dixit: And if you no longer have /etc/joe/editorrc but instead /etc/editorrc, then that still requires source patching for joe to actually *read* it, so you're back to square one. No that’s actually the fun thing, just symlink it. I have a symlink already: lrwxrwxrwx 1 root root 15 Aug 1 16:13 /etc/jupp/editorrc - ../joe/editorrc I’d just let that point to ../editorrc and change joe to do the same. No complicated changes needed, and this works very well. bye, //mirabilos -- Yay for having to rewrite other people's Bash scripts because bash suddenly stopped supporting the bash extensions they make use of -- Tonnerre Lombard in #nosec -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
On Tue, Aug 02, 2011 at 08:03:40AM +, Thorsten Glaser wrote: Josip Rodin dixit: And if you no longer have /etc/joe/editorrc but instead /etc/editorrc, then that still requires source patching for joe to actually *read* it, so you're back to square one. No that???s actually the fun thing, just symlink it. I have a symlink already: lrwxrwxrwx 1 root root 15 Aug 1 16:13 /etc/jupp/editorrc - ../joe/editorrc I???d just let that point to ../editorrc and change joe to do the same. No complicated changes needed, and this works very well. It may not be complicated, but it would be obfuscated. But I see how a series of symlinks would be seen as acceptable - we do it all the time with alternatives :) The only question would be whether having a symlink called /etc/editorrc would confuse non-joe users. -- 2. That which causes joy or happiness. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Josip Rodin dixit: The only question would be whether having a symlink called /etc/editorrc would confuse non-joe users. Hm. Too bad we can't directly link to /etc/alternatives/editorrc... if you have any better place for it (/var/**/editorrc?), tell so ;-) bye, //mirabilos -- “Having a smoking section in a restaurant is like having a peeing section in a swimming pool.” -- Edward Burr -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
On Tue, Aug 02, 2011 at 09:10:20AM +, Thorsten Glaser wrote: Josip Rodin dixit: The only question would be whether having a symlink called /etc/editorrc would confuse non-joe users. Hm. Too bad we can't directly link to /etc/alternatives/editorrc... if you have any better place for it (/var/**/editorrc?), tell so ;-) /var/lib/misc/editorrc could work? -- 2. That which causes joy or happiness. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
I think that all of this silliness could be avoided, while perfectly reproducing current behavior, if jstar, joe, etc were wrappers, not symlinks: #!/bin/bash if [ x$(basename -- $0) = xeditor ]; then progname=jstar else progname=$0 fi exec -a $progname /usr/lib/joe/joe.real -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Piotr Engelking inkerma...@gmail.com wrote: #!/bin/bash if [ x$(basename -- $0) = xeditor ]; then Sorry, insufficient quoting, the above should be of course: if [ x$(basename -- $0) = xeditor ]; then -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Josip Rodin dixit: /var/lib/misc/editorrc could work? Sure would. Do you want me to prepare a patch for joe? If so, should I version it as NMU or regularily? bye, //mirabilos -- 08:05⎜XTaran:#grml mika: Does grml have an tool to read Apple ⎜System Log (asl) files? :) 08:08⎜ft:#grml yeah. /bin/rm. ;) 08:09⎜mrud:#grml hexdump -C 08:31⎜XTaran:#grml ft, mrud: *g* -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Piotr Engelking dixit: I think that all of this silliness could be avoided, while perfectly reproducing current behavior, if jstar, joe, etc were wrappers, not symlinks: I think that’s a lot more silly. Besides, wrapping would slow down and bloat. #!/bin/bash No bash in my code. if [ x$(basename -- $0) = xeditor ]; then progname=jstar Uhm, who says that? All of the flavours are perfectly usable as editors. exec -a $progname /usr/lib/joe/joe.real There’s no exec -a (well maybe in GNU bash but I won’t use that) ;-) I actually like the idea of making editorrc a slave to editor… bye, //mirabilos -- Support mksh as /bin/sh and RoQA dash NOW! ‣ src:bash (254 (273) bugs: 1 RC, 175 (190) IN, 78 (82) MW, 0 FP) ‣ src:dash (82 (90) bugs: 3 RC, 44 (47) IN, 35 (40) MW, 0 FP) ‣ src:mksh (2 bugs: 0 RC, 0 IN, 2 MW, 0 FP) -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Thorsten Glaser t...@mirbsd.de wrote: I think that’s a lot more silly. Besides, wrapping would slow down and bloat. It avoids the problem of editor and editorrc being out of sync. Slowdown is imperceptible (which is the only thing that matters, since joe is always used interactively). There is no memory cost, since exec is used, and the disk space needed is offset by the space saved by not maintaining an alternative. No bash in my code. I am not attached to any particular implementation. :) My example uses bash since it has exec -a. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Thorsten Glaser t...@mirbsd.de wrote: I actually like the idea of making editorrc a slave to editor… And this solution would indeed probably be the best, if it is possible. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Hi, I just ran into a funny problem regarding update-alternatives and editorrc: if joe is installed, it wants /etc/joe/editorrc whereas jupp reads /etc/jupp/editorrc (I’ll use joe’s for now and symlink to it but that will break when joe was installed, jupp is selected and joe is then removed… probably, that is – not RC severity but to be fixed before the release – I think, /etc/joe will simply still exist and dpkg not rmdir.) Can we agree to move the 'editorrc' alternative to /etc and symlink to that from /etc/joe/editorrc and /etc/jupp/editorrc both? Can we also prod the update-alternatives people to make editorrc a slave to editor, since that’s really the only way? (What didn’t work? You only wrote it didn’t work in joe-3.5’s changelog entry.) Thanks, //mirabilos -- Using Lynx is like wearing a really good pair of shades: cuts out the glare and harmful UV (ultra-vanity), and you feel so-o-o COOL. -- Henry Nelson, March 1999 -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
On Mon, Aug 01, 2011 at 08:20:21PM +, Thorsten Glaser wrote: Hi, I just ran into a funny problem regarding update-alternatives and editorrc: if joe is installed, it wants /etc/joe/editorrc whereas jupp reads /etc/jupp/editorrc (I???ll use joe???s for now and symlink to it but that will break when joe was installed, jupp is selected and joe is then removed??? probably, that is ??? not RC severity but to be fixed before the release ??? I think, /etc/joe will simply still exist and dpkg not rmdir.) Can we agree to move the 'editorrc' alternative to /etc and symlink to that from /etc/joe/editorrc and /etc/jupp/editorrc both? Can we also prod the update-alternatives people to make editorrc a slave to editor, since that???s really the only way? (What didn???t work? You only wrote it didn???t work in joe-3.5???s changelog entry.) What's with all the UTF-8 quotes? You're making your mails really hard to read and for no apparent reason... The problem with 'editorrc' is that it's really a joe-specific config file, so it doesn't make sense to move it out of /etc/joe. We would want editorrc to depend on editor in some way, since that is indeed logical, but IIRC you can't just invent new slaves to editor out of the blue and expect other editor alternatives to play along - they wouldn't know how. Maybe simply coding it differently inside joe will be the best solution - if it notices that $self is 'editor', then don't just look for /etc/joe/${self}rc but instead look itself up once again through /etc/alternatives/editor to see what actual $variant was chosen, and then use that /etc/joe/${variant}rc. -- 2. That which causes joy or happiness. -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Bug#636147: /etc/editorrc ?
Josip Rodin dixit: What's with all the UTF-8 quotes? You're making your mails really hard to read and for no apparent reason... Oh okay. UTF-8 works here. The problem with 'editorrc' is that it's really a joe-specific config file, so it doesn't make sense to move it out of /etc/joe. Well, there's jupp now. It really is some fork of joe, which I originally intended to rebase against later joe versions, but I _really_ don't like some of the changes, and new bugs, that come with it, so I don't think it'll happen again. Just cherry-picking now. (The new syntax highlighting code is on the list, and maybe the menu system, but I don't know if I want to use it for the options, and besides that, many options like XON/XOFF mode segfault joe…) I've not really been happy with either upstream (the 2.9 one, and now that Joe is back). We would want editorrc to depend on editor in some way, since that is indeed logical, but IIRC you can't just invent new slaves to editor out of the blue and expect other editor alternatives to play along - they wouldn't know how. Hm, these other editors could just have it dangling. We could ask the dpkg people for it. Maybe simply coding it differently inside joe will be the best solution - if it notices that $self is 'editor', then don't just look for /etc/joe/${self}rc but instead look itself up once again through /etc/alternatives/editor to see what actual $variant was chosen, and then use that /etc/joe/${variant}rc. Ugh that is some major Debian specific source patching. It can be done, but I'm not really comfortable with this way out if we have another. I could hack it if really needed, but the alternatives system is Debian specific, and we can't even simply use realpath either, because the joe variants are symbolic links (by design). My plan is: have a coordinated upload of src:joe and src:jupp whose binary packages (all three) Break the previous versions of the other editor and move the alternative to /etc and have a symlink to it. I can prepare a patch for joe if you want. Parallel to that, we ask the dpkg people if we can move to a slave, and include that in the upload if possible (since I've fixed it for now, that upload isn't time critical). bye, //mirabilos -- Yay for having to rewrite other people's Bash scripts because bash suddenly stopped supporting the bash extensions they make use of -- Tonnerre Lombard in #nosec -- To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org