Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extension file and section override #4497

Closed
mc-butler opened this issue Aug 21, 2023 · 8 comments
Closed

extension file and section override #4497

mc-butler opened this issue Aug 21, 2023 · 8 comments
Assignees
Labels
area: config Configuration INI files prio: medium Has the potential to affect progress ver: 4.8.29 Reproducible in version 4.8.29
Milestone

Comments

@mc-butler
Copy link

Important

This issue was migrated from Trac:

Origin https://midnight-commander.org/ticket/4497
Reporter musinsky (@musinsky)

https://github.com/MidnightCommander/mc/blob/master/misc/mc.ext.ini.in

# Sections are processed from top to bottom, thus the order is important.
# If there are more than one sections with the same name in this file, the first
# section will be used.

not working example (always utar instead of uar)

# override section
[ipk]
Shell=.ipk
Open=%cd %p/uar://
# default section
[ipk]
Shell=.ipk
Include=tar.gz

working example 1

# override section
[ipk_other]
Shell=.ipk
Open=%cd %p/uar://
# default section
[ipk]
Shell=.ipk
Include=tar.gz

working example 2

# override section
[ipk]
Shell=.ipk
Open=%cd %p/uar://
# default section
[ipk]
Shell=.ipk
#Include=tar.gz

Rule "Sections are processed from top to bottom, thus the order is important" not working for Section with Include pattern.

@mc-butler
Copy link
Author

Changed by zaytsev (@zyv) on Aug 22, 2023 at 6:19 UTC (comment 1)

I wonder if the documentation is correct. I think it should be "the first that matches", but "the last with the same name". So your working example 1 is actually the correct and expected behaviour.

Is that what you had in mind, Andrew? If yes, then I could suggest a text change. Last time I reviewed it, it was just too much for me, and it seems that I've left some questionable grammar in there...

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 4, 2023 at 12:57 UTC (comment 2)

I inattentively read the GLib documentation. It says:

Note that in contrast to the Desktop Entry Specification, groups in key files may contain the same key multiple times; the last entry wins. Key files may also contain multiple groups with the same name; they are merged together.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 11, 2023 at 8:25 UTC (comment 3)

  • Branch state changed from no branch to on review
  • Milestone changed from Future Releases to 4.8.31
  • Owner set to andrew_b
  • Status changed from new to accepted

Branch: 4497_mc.ext.ini_sections
[215602737dce7238841b9a0b4f9f92f9026fa3ea]

@mc-butler
Copy link
Author

Changed by ossi (@ossilator) on Sep 11, 2023 at 10:00 UTC (comment 4)

"sections _are_ merged" in the examples.
however, i'm not sure i'd include the examples - i think the now correct description is pretty self-explanatory, so the examples are just noise one has to scroll past.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 12, 2023 at 5:47 UTC (comment 4.5)

Replying to ossi:

i think the now correct description is pretty self-explanatory, so the examples are just noise one has to scroll past.

Removed.

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 16, 2023 at 16:58 UTC (comment 6)

  • Votes set to andrew_b
  • Branch state changed from on review to approved

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 16, 2023 at 17:01 UTC (comment 7)

  • Status changed from accepted to testing
  • Resolution set to fixed
  • Branch state changed from approved to merged
  • Votes changed from andrew_b to committed-master

Merged to master: [892bee5].

@mc-butler
Copy link
Author

Changed by andrew_b (@aborodin) on Sep 16, 2023 at 17:02 UTC (comment 8)

  • Status changed from testing to closed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: config Configuration INI files prio: medium Has the potential to affect progress ver: 4.8.29 Reproducible in version 4.8.29
Development

No branches or pull requests

2 participants