public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* defaults
@ 2002-12-02  4:56 Morrison, John
  2002-12-02  7:52 ` defaults Christopher Faylor
  0 siblings, 1 reply; 5+ messages in thread
From: Morrison, John @ 2002-12-02  4:56 UTC (permalink / raw)
  To: 'cygwin@cygwin.com'

Hi all.

This has been at the back of my mind for awhile now since having to
do something for /etc/profile.default.

What I'm thinking of is a directory structure containing default files
and a script which, if the original of the default file doesn't exist,
copies it.  I'm specifically thinking of:

/etc/apache.new/access.conf.default
/etc/apache.new/httpd.conf.default
/etc/apache.new/magic.default
/etc/apache.new/mime.types.default
/etc/apache.new/srm.conf.default
/etc/bash.bashrc.default
/etc/enscript.cfg.default
/etc/exim.conf.default
/etc/mime.conf.default
/etc/profile.default
/etc/skel/[initial user files here]
/etc/squid.conf.default

I think creating...

/etc/defaults/etc/apache/access.conf
/etc/defaults/etc/apache/httpd.conf
/etc/defaults/etc/apache/magic
/etc/defaults/etc/apache/mime.types
/etc/defaults/etc/apache/srm.conf
/etc/defaults/etc/bash.bashrc
/etc/defaults/etc/enscript.cfg
/etc/defaults/etc/exim.conf
/etc/defaults/etc/mime.conf
/etc/defaults/etc/profile
/etc/defaults/etc/skel/[initial user files here]
/etc/defaults/etc/squid.conf

and the script...

================================================================

#!/bin/bash
cd /etc/defaults
for f in `find . -type f`; do
	fDest = `echo $f | sed 's/^\.//g'`
	echo $f $fDest
	if [ ! -f $fDest ]; then
		echo Using the default version of $fDest
		cp $f $fDest
	else
		echo $fDest is already in existance, not overwriting.
	fi
done

================================================================

There are however, a few problems which need to be overcome.

The first is that this script, although best as a postinstall,
would have be executed _after every install_.

The other would be to get people to use it ;)

Well, that's my mental thoughts on paper(?!).  Any comments?
would it be worth doing?

J.

--LongSig

It's so stupid of modern civilization to have given up believing in the
Devil when he is the only explanation of it.


=======================================================================
Information in this email and any attachments are confidential, and may
not be copied or used by anyone other than the addressee, nor disclosed
to any third party without our permission.  There is no intention to
create any legally binding contract or other commitment through the use
of this email.

Experian Limited (registration number 653331).  
Registered office: Talbot House, Talbot Street, Nottingham NG1 5HF

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: defaults
  2002-12-02  4:56 defaults Morrison, John
@ 2002-12-02  7:52 ` Christopher Faylor
  2002-12-04 13:53   ` defaults John Morrison
  2002-12-08  6:50   ` defaults John Morrison
  0 siblings, 2 replies; 5+ messages in thread
From: Christopher Faylor @ 2002-12-02  7:52 UTC (permalink / raw)
  To: cygwin

On Mon, Dec 02, 2002 at 12:56:03PM -0000, Morrison, John wrote:
>The first is that this script, although best as a postinstall,
>would have be executed _after every install_.
>
>The other would be to get people to use it ;)
>
>Well, that's my mental thoughts on paper(?!).  Any comments?
>would it be worth doing?

Here's how _update-info-dir does it:

  sdesc: "Generate info/dir file automatically"
  category: _PostInstallLast
  requires: texinfo ash
  autodep: usr/info/.*
  incver_ifdep: yes

You'd probably want something like:

  sdesc: "Conditionally move default files to proper location"
  category: _PostInstallLast
  requires: ash
  autodep: etc/defaults/.*
  incver_ifdep: yes

This would run automatically whenever packages are downloaded and
installed in one shot.  It wouldn't run if someone downloads everything
and then installs piecemeal, though.

The script to move the files would be the only thing in the package and
it would be a post-install script.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: defaults
  2002-12-02  7:52 ` defaults Christopher Faylor
@ 2002-12-04 13:53   ` John Morrison
  2002-12-04 14:22     ` defaults Christopher Faylor
  2002-12-08  6:50   ` defaults John Morrison
  1 sibling, 1 reply; 5+ messages in thread
From: John Morrison @ 2002-12-04 13:53 UTC (permalink / raw)
  To: cygwin

> From: Christopher Faylor
> >The other would be to get people to use it ;)
> >
> >Well, that's my mental thoughts on paper(?!).  Any comments?
> >would it be worth doing?
> 
> Here's how _update-info-dir does it:

Thanks :)

So - do you...
1) Think it's worth it
2) Think the _way_ I'm proposing is OK and,
3) think I should implement it? :)

J.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: defaults
  2002-12-04 13:53   ` defaults John Morrison
@ 2002-12-04 14:22     ` Christopher Faylor
  0 siblings, 0 replies; 5+ messages in thread
From: Christopher Faylor @ 2002-12-04 14:22 UTC (permalink / raw)
  To: cygwin

On Wed, Dec 04, 2002 at 09:52:53PM -0000, John Morrison wrote:
>> From: Christopher Faylor
>> >The other would be to get people to use it ;)
>> >
>> >Well, that's my mental thoughts on paper(?!).  Any comments?
>> >would it be worth doing?
>> 
>> Here's how _update-info-dir does it:
>
>Thanks :)
>
>So - do you...
>1) Think it's worth it
>2) Think the _way_ I'm proposing is OK and,
>3) think I should implement it? :)

Yes to all.

cgf

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: defaults
  2002-12-02  7:52 ` defaults Christopher Faylor
  2002-12-04 13:53   ` defaults John Morrison
@ 2002-12-08  6:50   ` John Morrison
  1 sibling, 0 replies; 5+ messages in thread
From: John Morrison @ 2002-12-08  6:50 UTC (permalink / raw)
  To: cygwin


> From: Christopher Faylor
> On Mon, Dec 02, 2002 at 12:56:03PM -0000, Morrison, John wrote:
>
> You'd probably want something like:
<snip/>

setup.hint:

sdesc: "Conditionally move default files to proper location"
category: _PostInstallLast
requires: ash findutils fileutils sed sh-utils
autodep: etc/defaults/.*
incver_ifdep: yes

> This would run automatically whenever packages are downloaded and
> installed in one shot.  It wouldn't run if someone downloads everything
> and then installs piecemeal, though.

I think there are lots of things that don't work when cygwin
is not installed via setup.  I can't think of any other way...

> The script to move the files would be the only thing in the package and
> it would be a post-install script.

Done :)

Please find for you perusal and review... (long links, will wrap!)
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/update-defaults/upda
te-defaults-1.0-1.tar.bz2
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/update-defaults/defa
ults.html (this should be added to the 'how to create a package'
instructions, or something
like?)
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/update-defaults/setu
p.hint
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/update-defaults/md5s
um

Also, re-done base-files using this mechanism...
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/base-files/base-file
s-1.2-1.tar.bz2
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/base-files/setup.hin
t
http://homepage.ntlworld.com/j-n-s.morrison/john/cygwin/base-files/md5sum

*Please* test this before including in the distro!

J.


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-12-08 14:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-12-02  4:56 defaults Morrison, John
2002-12-02  7:52 ` defaults Christopher Faylor
2002-12-04 13:53   ` defaults John Morrison
2002-12-04 14:22     ` defaults Christopher Faylor
2002-12-08  6:50   ` defaults John Morrison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).