On Tue, 20 Feb 2007 17:19:19 -0500, "A. Costa" <[EMAIL PROTECTED]> said: > > How about then just proceed to display the status of > > exim4-daemon-light instead? > > It depends if the 'dlocate' programmer (or patcher) likes long or > short output. The longer version you suggested (with status switch) has > the advantage that the 'dlocate' output would be more standard. The > shorter one would be harder for scripting, because if we wanted the > package size of the current 'mail-transport-agent', it'd require > parsing 'dlocate' twice -- first to check if its virtual, and again to > run 'dlocate -s exim4-daemon-light'. For that purpose the long version > seems much better!
Yes, that's a good scenario to keep in mind, too. I was thinking mainly from the perspective of the user. "That's what I asked for, dammit, do I have to tell you again that that's what I want!?" > > Packages which provide 'mail-transport-agent': > > exim4-daemon-heavy - exim MTA (v4) daemon with extended features, ... > > Your lead in is better. The listing with one-line descriptions should be > a '-v (--verbose)' option. Ah, but dlocate's handling of options is rather non-standard. Currently every command is an "option" and there are no real "options". I don't like that design much, but I don't think we should break it, either. > Howbout a different approach, new (conditional or pseudo) field names: > > % dlocate -s mail-transport-agent > Virtual package providers: { ... } > Current provider: exim4-daemon-light > Package: exim4-daemon-light > Status: install ok installed > Priority: standard > { ... } > > ...and if there was no MTA it would say: > > % dlocate -s mail-transport-agent > Virtual package providers: { ... } > Current provider: none > > Hope that's better... Yes, I like that approach. Actually, I'd add an empty line in there, just to keep this visually distinct. Otherwise it's too easy to miss. Consider this: vnix$ command -option Xxxx: xxx xxxxx xx xxxxxx xx Xxxxx-Xxx-X: xxx, xxx (>= xxx.x:x) Xxx-Xxxxx: xxxxxx, xxxx? Attention: here is the information you want Xxxxx: xxx xxxxxxx xxxx With an empty line, it's at least a little bit more likely that you will notice that the first line contains stuff which affects the interpretation of the information that you are actually looking for. (On the next day, he learned to pipe the command to "| grep ^Attention:" ...) For some weird reason, my subconscious tells me to use single-word or hyphenated field names for consistency. I'm also wondering whether the fields should be reordered a litte bit. Maybe like this: vnix$ dlocate -s mail-transport-agent Package: mail-transport-agent (virtual) Providers: exim4-daemon-heavy, exim4-daemon-light, postfix, courier-mta ... Package: postfix Status: install ok installed Priority: extra Section: mail : Not sure if Providers: should be comma-separated (cf. Depends:) or space-separated or even pipe-separated (again, cf. how equally valid alternatives are shown in Depends:) or what. (I had "Virtual-Providers:" there at first but I think maybe just "Providers:" is better.) /* era */ -- If this were a real .signature, it would suck less. Well, maybe not. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]