Created attachment 556276 [details] The eselect file I wrote Hi, I have recently written an eselect timezone module. https://github.com/zyklotomic/gentoo-utils I had thought there were none that existed since during the timezone configuration process of my installs, it was not mentioned in the handbook. However, I learned app-eselect/eselect-timezone-0.2 already exists. Nonetheless, I think my version is a slight improvement featurewise. However, it is definitely lacking in code quality due to my inexperience with bash. My version does work in its current from though. The biggest improvement is nested-index selection. In the existing eselect-timezone, eselect timezone list outputs all 500+ available timezones. In my version, you navigate with nested-indices. For example, 2 refers to America/ and within America/, 95 refers to New_York, so eselect timezone set 2-95 sets America/New_York as the timezone. You can also list all available timezones with eselect timezone list all if desired. Furthermore, in the existing version, indices don't show if you narrow down with eselect timezone list <literal-directory>. My version does though. Thank you! Best, Ethan Kiang
Hi, I'm not sure what are the next steps to move along in this improvement bug. What should I do? I know that my current code is not up to quality, it merely works. Best, Ethan
Let's not bypass the maintainer of the package, but give him some more time to reply. I have set a deadline at end of December (i.e., one month after filing of this bug). If there's no reply until then, we can see how to proceed.
Sorry for the delay, I forgot I wrote eselect-timezone. Regarding nested indexing, you can do "eselect timezone list America/" in the current version as well and then use the name e.g. "eselect timezone set America/Virgin".
Ah, sorry, I wasn't aware we were waiting for the maintainer. I thought I had done something wrong. Yeah, the only minor improvement is that you can access via index, for directories too, with my version.
Edit: I meant numerical indexing, for example $ eselect timezone list 40 Available timezone selections: Directory: /usr/share/zoneinfo/Mexico [40-1] BajaNorte [40-2] BajaSur [40-3] General # eselect timezone set 40-1
(In reply to Ethan Kiang from comment #5) > Edit: I meant numerical indexing, for example > > $ eselect timezone list 40 > Available timezone selections: > Directory: /usr/share/zoneinfo/Mexico > [40-1] BajaNorte > [40-2] BajaSur > [40-3] General > > # eselect timezone set 40-1 I don't have any time to maintain an enhanced version of eselect-timezone, so either you try to promote this as a different package, e.g. eselect-timezone-ng or take over the maintainership of eselect-timezone (with proxy maintainer).
(In reply to Ethan Kiang from comment #5) > Edit: I meant numerical indexing, for example > > $ eselect timezone list 40 > Available timezone selections: > Directory: /usr/share/zoneinfo/Mexico > [40-1] BajaNorte > [40-2] BajaSur > [40-3] General > > # eselect timezone set 40-1 These combined indexes are inconsistent with what is used throughout the rest of eselect, and they break backwards compatibility with the existing module. Since the existing module already has the filter functionality, it should be relatively easy to modify it to output something like this: # eselect timezone list Mexico Available timezones: [516] Mexico/BajaNorte [517] Mexico/BajaSur [518] Mexico/General # eselect timezone set 516 AFAICS, find_targets() would always have to return the full list for that, and do_list() would only output those entries that match the base dir.
Basically we need apply the filter after write_numbered_list() generated the numbered target list output. Back when I wrote this module, I couldn't think of a non-hackish way to do that and as selection by name is always possible I thought the index feature wasn't very important.
Yup, handling the indices were a challenge when I was writing the module. I was unaware of Christoph's module when I wrote mine. I will look into his first too.
(In reply to Christoph Junghans from comment #8) > Basically we need apply the filter after write_numbered_list() generated the > numbered target list output. Back when I wrote this module, I couldn't think > of a non-hackish way to do that Yeah, you cannot do this in any sane way with write_numbered_list(). You could call write_numbered_list_entry() directly, though. > and as selection by name is always possible I thought the index feature > wasn't very important. I agree, it would be nice to have but it is not essential.