Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 194095 - dispatch-conf warps around at buffer's end (bug | misfeature)
Summary: dispatch-conf warps around at buffer's end (bug | misfeature)
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Tools (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on:
Blocks: 194041
  Show dependency tree
 
Reported: 2007-09-28 15:45 UTC by The Prodigy's
Modified: 2007-10-06 04:35 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
validate input (validate.patch,1.47 KB, patch)
2007-09-29 01:54 UTC, Zac Medico
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description The Prodigy's 2007-09-28 15:45:23 UTC
Hi,

dispatch-conf (version: Id: dispatch-conf 6616 2007-05-24 20:56:51Z zmedico)

1. once at the end of a text buffer (as for example two long httpd.confs)... the buffer viewer (vi ? less ?) warps around to the beginning of the buffer.

2. when not viewing the very end of a text buffer, one cannot use the key-commands (u, l, etc.) to act on the files at hand.

1 & 2 combined make it very hard for anyone to execute the required actions on the files. Only 1 try in about 7, successfully places the viewer at the buffer's end, and thus, enabling the key-commands usage.

Expected correct behavior:
- don't warp around at the end of buffer (currently not implemented)
- don't warp around at the beginning of buffer (as it currently does)

Extra feature(s) which might be useful: 
- make key-commands usable anywhere in the buffer (beginning<->middle<->end).
- display key-commands usage at all times in a separate buffer on the bottom of the screen.

Thanks,

theprodigys


Reproducible: Always

Steps to Reproduce:
1. make a substantial change in one package's config file (the difference between changed & stock config file should be greater (line-wise) than the maximum lines displayed on your terminal (if possible resize down your terminal)
2. $ emerge -u 'your_package'
3. $ dispatch-conf
4. $ scroll down to the end of the buffer
Actual Results:  
- the buffer's end is never attained as it warps around to the beginning.
- depending on your skills/luck you can attain the buffer's end in 1 out of 7 tries (rough estimate ;)) by using a mixed set of 'human heuristic line counting' & '1 line at a time scroll down'.

Expected Results:  
- don't warp around at the end of buffer

Extra feature(s) which might be useful: 
- make key-commands usable anywhere in the buffer (beginning<->middle<->end).
- display key-commands usage at all times in a separate buffer on the bottom of the screen.
Comment 1 SpanKY gentoo-dev 2007-09-28 19:35:38 UTC
dispatch-conf isnt part of baselayout
Comment 2 Zac Medico gentoo-dev 2007-09-29 01:08:37 UTC
(In reply to comment #0)
> Expected correct behavior:
> - don't warp around at the end of buffer (currently not implemented)
> - don't warp around at the beginning of buffer (as it currently does)

You're complaints are related to two different issues:

1) The default "diff" command in /etc/dispatch-conf.conf passes the --QUIT-AT-EOF option to less, causing it to exit back to dispatch-conf when you hit EOF.

2) Apparently in some cases dispatch-conf will invoke the "diff" command immediately after it exits, due to some type of spurious input that it receives.

I'm currently investigating #2 to try and prevent that from happening.  The dispatch-conf input handler is very sensitive there because it temporarily puts the tty into raw mode in order to get a single character without waiting for a newline. If it doesn't recognize the first character then it immediately invokes the "diff" command again, leading to the "warp around" that you're experiencing.
Comment 3 Zac Medico gentoo-dev 2007-09-29 01:54:42 UTC
Created attachment 132139 [details, diff]
validate input

If you save this patch as /tmp/validate.patch the in can be applied as follows:

patch /usr/lib/portage/bin/dispatch-conf < /tmp/validate.patch
Comment 4 Zac Medico gentoo-dev 2007-10-06 04:35:35 UTC
This has been released in 2.1.3.12.