Date: Sat, 27 Aug 2005 09:31:34 -0500 From: Scot Hetzel <swhetzel@gmail.com> To: Marco van de Voort <marcov@stack.nl> Cc: freebsd-ports@freebsd.org Subject: Re: leaving behind .sample files and pkg_add alternate registerdb Message-ID: <790a9fff050827073117e5452@mail.gmail.com> In-Reply-To: <20050827133303.71F162287D@snail.stack.nl> References: <20050827133303.71F162287D@snail.stack.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
On 8/27/05, Marco van de Voort <marcov@stack.nl> wrote: >=20 > > I've been working on a port recently, and ran into two small questions: > > > > 1) is it evil to leave behind .cfg.sample files? If so, how do I add th= em > > to pkg-plist and avoid errors if the user moved (instead of copied) t= hem > > to the .cfg ? @unexec? If so, how would it look for a file? > > Yes, it is evil to leave the *.sample files behind, you'll need to add 2 lines to the package: @unexec if cmp -s %D/etc/example.conf %D/etc/example.conf-dist; then rm -f %D/etc/example.conf; fi etc/example.conf-dist @exec [ -f %B/example.conf ] || cp %B/%f %B/example.conf the @unexec removes example.conf if it is the same as example.conf-dist the @exec creates example.conf if it doesn't exist > 3) Is it possible that pkg_create doesn't add/create empty directories? > (I copied an example dir from a src archive, and it had empty CVS/ dirs > in it) >=20 You'll need to have your port create and remove the empty directories: @cwd /var @mode ug=3Drwx,o=3D @exec mkdir -p /var/state/saslauthd1 @exec chown -R cyrus:cyrus state @exec chmod -R o=3D state @unexec rmdir /var/state/saslauthd1 @unexec rmdir /var/state Scot --=20 DISCLAIMER: No electrons were mamed while sending this message. Only slightly bruised.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?790a9fff050827073117e5452>