Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Mar 2009 13:55:27 -0500
From:      Wesley Shields <wxs@FreeBSD.org>
To:        Torfinn Ingolfsen <tingox@gmail.com>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: Installing 'config' file with port
Message-ID:  <20090302185527.GE89771@atarininja.org>
In-Reply-To: <ef8c8a880903020958w4d0f999bu2d603f2904b11bba@mail.gmail.com>
References:  <20090302090221.7948106f@scorpio> <ef8c8a880903020958w4d0f999bu2d603f2904b11bba@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 02, 2009 at 06:58:57PM +0100, Torfinn Ingolfsen wrote:
> Hello,
> 
> On Mon, Mar 2, 2009 at 3:02 PM, Jerry <gesbbb@yahoo.com> wrote:
> > I am creating a port that will install a 'config' file in the
> > "/usr/local/etc" directory. Reading through the 'Porters Handbook", I
> > cam across this example.
> >
> > post-install:
> > ? ?@if [ ! -f ${PREFIX}/etc/orbit.conf ]; then \
> > ? ? ? ?${CP} -p ${PREFIX}/etc/orbit.conf.sample ${PREFIX}/etc/orbit.conf ; \
> > ? ?fi
> 
> This is done so that the config file is not overwritten if it is
> already there (think port upgrade). If the config file exists already,
> just copy the *.conf.sample file without renaming it.

Don't forget the corresponding part in pkg-plist so that the same thing
is done when the package is used.

-- WXS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090302185527.GE89771>