Editing existing user-customized files

Ryan Stonecipher RMStonecipher at macports.org
Thu Dec 23 16:37:59 PST 2010


In the mpd portfile I provided a default configuration file, mpd.conf,
in r47239.
This configuration file is only destrooted if no file
${prefix}/etc/mpd.conf exists.
My intent was to not replace potentially-customized configuration
files with the default at each version/revision bump.

In the most recent update to mpd, a keyword in that configuration file
"error_file" was deprecated.
I have removed the keyword from the default configuration file, but do
not know how to ensure it is removed from users' existing
configuration files.

I would like to add an else statement so that upon detection of an
existing mpd.conf:
1) the existing ${prefix}/etc/mpd.conf is copied to ${destroot}${prefix}/etc/
2) all lines containing "error_file" are either commented out or removed
Could this be done within the post-destroot phase?

Ryan Stonecipher


More information about the macports-dev mailing list