Bug 253203 - x11-wm/icewm Provide separate installed and global preference paths
Summary: x11-wm/icewm Provide separate installed and global preference paths
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Alexey Dokuchaev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-03 08:02 UTC by Duane
Modified: 2021-02-17 03:02 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (portmaster)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Duane 2021-02-03 08:02:43 UTC
I'm not sure if this is possible, but the man pages show the `/usr/local/share/icewm/preferences` file twice which suggests that it might be possible to set these two entries to different locations.

It would be ideal if one of them could be at a different location so that global preferences can be set that aren't affected by reinstalls, for example `/usr/local/etc/X11/icewm/preferences`.  Similarly for all of the other preference files.
Comment 1 Chris Hutchinson 2021-02-04 00:51:41 UTC
(In reply to Duane from comment #0)
Thinking about this more. I'm inclined to
ask what the goal is. IOW wouldn't it be
just as simple to point icewm to your
_chosen_ || _preferred_ config? I'm not
exactly sure what your intended goal is
here with this.

Thanks.
Comment 2 Duane 2021-02-04 06:59:17 UTC
(In reply to Chris Hutchinson from comment #1)

I’m administering a multiuser system in an educational setting and I need to preset certain global preferences that users cannot edit and that wont be lost due to a reinstall of the package (and that wont prevent me from seeing the default version of the preferences if it’s updated).

I’m not sure how the `pkg` system works if I edit an installed file. Does it leave it undisturbed across an uninstall/reinstall cycle? And if something important changes in the default config with a version update how will I be able to see it?

As an example other programs often seem to have a .conf and a .conf.default which could be an alternative option.
Comment 3 Chris Hutchinson 2021-02-04 16:17:05 UTC
(In reply to Duane from comment #2)
Ahh. OK. Yep. Can do.
What your looking for is fairly well provided:
Provide a "default" config file. If upgrading,
snoop for _modified_ default config. If found
place default config as config.example || default.sample.

Will that get it for you?

Thanks for the clarification.

--Chris
Comment 4 Duane 2021-02-04 19:43:38 UTC
(In reply to Chris Hutchinson from comment #3)

Yep, that will be fine.  Be careful though, there’s like 8 different preference/config files.

Thanks.
Comment 5 Chris Hutchinson 2021-02-04 23:33:42 UTC
(In reply to Duane from comment #4)
OK then. Will do.
I should be able to get to it over the weekend.

--Chris
Comment 6 Alexey Dokuchaev freebsd_committer 2021-02-08 04:41:36 UTC
(In reply to Duane from comment #0)
> It would be ideal if one of them could be at a different location so that
> global preferences can be set that aren't affected by reinstalls, for example
> `/usr/local/etc/X11/icewm/preferences`.
As of ports r564677, the port no longer sets CFGDIR to ${DATADIR} and it defaults to more sane and pkg(8)-friendly /usr/local/etc/icewm which you can create files under and they will survive package deinstall/update/reinstall.

Could you update the port and see if it currently suits your needs?
Comment 7 Duane 2021-02-16 21:27:24 UTC
(In reply to Alexey Dokuchaev from comment #6)

Finally had the opportunity to test this, and the icehelp change.  They're both working beautifully now.  Thanks very much.