Skip to content

Consistent configuration/example files installation#2704

Closed
czarkoff wants to merge 1 commit into
mpv-player:masterfrom
czarkoff:config_files
Closed

Consistent configuration/example files installation#2704
czarkoff wants to merge 1 commit into
mpv-player:masterfrom
czarkoff:config_files

Conversation

@czarkoff
Copy link
Copy Markdown
Contributor

While not really issues, these are inconsistencies that I find irritating:

  • Waf installs encoding_profiles.conf to CONFDIR, but other installation files are installed into DOCDIR.
  • example.conf is a filename for mpv.conf example. Other examples' names are the same with configuration files they are examples of.

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2016

The first thing is is fully intentional. encoding_profiles.conf is actually parsed on loading, and actually contains active settings. The other conf files are fully documented and are just examples.

The second commit would be acceptable, though.

@czarkoff
Copy link
Copy Markdown
Contributor Author

I would avoid installing files directly to /etc, but it is your project and you know better.

I have a hidden agenda with this issue: in OpenBSD all files in packages are checksumed, so we can't install to /etc - if somebody will edit the file, its checksum wouldn't match during package update or removal. Instead we install to example directory, and copy files to /etc during package installation. With old-configure I could simply override config directory during packaging stage; now, that I have to use waf, it becomes an issue.

@pigoz
Copy link
Copy Markdown
Member

pigoz commented Jan 11, 2016

@czarkoff do --confdir or --docdir help in your case? See ./waf configure --help

@czarkoff
Copy link
Copy Markdown
Contributor Author

Not really. When called during configure stage, --confdir also sets runtime location of configuration files. During other stages of built process --confdir is silently ignored.

@pigoz
Copy link
Copy Markdown
Member

pigoz commented Jan 11, 2016

Well it's not like most users would edit config files directly in the confdir. I think using a read only path for the confdir might be an acceptable solution.

Otherwise how do other OpenBSD ports handle system wide config files? A lot (most?) of software out there installs default config files to etc.

@czarkoff
Copy link
Copy Markdown
Contributor Author

Most software doesn't use waf.

make CONFDIR=/etc
make CONFDIR=/usr/local/share/example/progname/ install

This is not real code, but things like that work with GNU and BSD makefiles, simple configure scripts, cmake lists, auto*-generated makefiles and everything else I ever dealt with.

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2016

Yeah, most software uses cmake these days, or MSVC+Xcode project files.

@czarkoff
Copy link
Copy Markdown
Contributor Author

@wm4 I see increasing amounts of pure makefile-based configuration. In my experience, these are easiest to write, most readable and far more flexible.

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2016

So you want the 10kloc shell vomit back that mplayer had?

@czarkoff
Copy link
Copy Markdown
Contributor Author

@wm4 I sort of liked old-configure and old-makefile. I have to admit, waf produces better results, but mostly because old buildsystem was much less tested.

@czarkoff
Copy link
Copy Markdown
Contributor Author

And 1500 lines of old-* don't look as bad as 53967 lines of waf.

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2016

And 1500 lines of old-*

Because it supported only desktop Linux (and maybe OpenBSD if you hacked it a bit).

@czarkoff
Copy link
Copy Markdown
Contributor Author

I have no clue about building software on OSX, but MinGW support would not double that number. Assuming that nothing from old build system is reusable on OSX, there is still about 50k lines of overhead with waf. And making waf handle unit tests in adequate fashion would add yet more overhead.

pigoz added a commit that referenced this pull request Jan 11, 2016
Some packagers need to install config files to a different path but still load
from another path.

See #2704
@pigoz
Copy link
Copy Markdown
Member

pigoz commented Jan 11, 2016

^ that should fix your problem, hopefully

@czarkoff
Copy link
Copy Markdown
Contributor Author

Yes, it helps. What about another commit (example.confmpv.conf)?

@czarkoff
Copy link
Copy Markdown
Contributor Author

I dropped the encoding-profiles.conf commit, so now the question boils down to example.confmpv.conf.

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2016

Looks ok, will apply later. (Maybe you could add "etc: " as prefix, but I can do that myself.)

@ghost
Copy link
Copy Markdown

ghost commented Jan 11, 2016

Pushed that commit.

@czarkoff
Copy link
Copy Markdown
Contributor Author

Could you please also push 968bcfd by @pigoz?

pigoz added a commit that referenced this pull request Jan 11, 2016
Some packagers need to install default config files to some path but
automatically load system configuration files from another path.

See #2704
@pigoz
Copy link
Copy Markdown
Member

pigoz commented Jan 11, 2016

Could you please also push 968bcfd by @pigoz?

@czarkoff: pushed

I think we can close this.

@pigoz pigoz closed this Jan 11, 2016
@czarkoff czarkoff deleted the config_files branch January 11, 2016 20:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants