Ticket #4497 (closed defect: fixed)
extension file and section override
Reported by: | musinsky | Owned by: | andrew_b |
---|---|---|---|
Priority: | major | Milestone: | 4.8.31 |
Component: | mc-config-ini | Version: | 4.8.29 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Branch state: | merged | Votes for changeset: | committed-master |
Description
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.
Change History
comment:2 Changed 15 months ago by andrew_b
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.
comment:3 Changed 15 months ago by andrew_b
- Owner set to andrew_b
- Status changed from new to accepted
- Branch state changed from no branch to on review
- Milestone changed from Future Releases to 4.8.31
Branch: 4497_mc.ext.ini_sections
changeset:215602737dce7238841b9a0b4f9f92f9026fa3ea
comment:4 follow-up: ↓ 5 Changed 15 months ago by ossi
"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.
comment:5 in reply to: ↑ 4 Changed 15 months ago by andrew_b
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.
comment:6 Changed 15 months ago by andrew_b
- Votes for changeset set to andrew_b
- Branch state changed from on review to approved
comment:7 Changed 15 months ago by andrew_b
- Status changed from accepted to testing
- Votes for changeset changed from andrew_b to committed-master
- Resolution set to fixed
- Branch state changed from approved to merged
Merged to master: [892bee5bf75b761d802d087ab47b2680f9d7dd8a].
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...