This is the mail archive of the
mailing list for the Cygwin project.
Setup of default configuration files
- From: "John Morrison" <john dot r dot morrison at ntlworld dot com>
- To: "Cygwin Apps" <cygwin-apps at cygwin dot com>
- Date: Sun, 5 Jan 2003 15:53:07 -0000
- Subject: Setup of default configuration files
Christopher and I had a little conversation at the beginning of
December. It occured to me/us that a lot of cygwin packages
have postinstall scripts which just copy default versions of
configuration files into the correct location if they don't
It was thought that this could be simplified into just one
postinstallation script. Basically, the script would, when a
new file has been placed under a particular directory
(/etc/defaults/) it would be copied (/etc/defaults/ becomming
the equivalent of /) if a file of the same name didn't already
This has (I think) two advantages
1) not everyone has to maintain such a post installation script and
2) there's no excuse not to make use of it and config files
wouldn't be deleted upon uninstall.
Anyway, the script...
for f in `find . -type f`; do
fDest=`echo $f | sed 's/^\.//g'`
if [ ! -f $fDest ]; then
echo Using the default version of $fDest
cp $f $fDest
echo $fDest is already in existance, not overwriting.
Packages can be found... (note that it needs renumbering,
but should give you some idea of the functionality)
(this should be added to the 'how to create a package' instructions, or
sdesc: "Conditionally move default files to proper location"
requires: ash findutils fileutils sed sh-utils
Also, I've re-done base-files using this mechanism as
Thanks for reading so much, hope to hear some