Date: Thu, 18 Feb 2021 20:32:46 +0100 From: Stefan Esser <se@freebsd.org> To: Gerrit Kuehn <gerrit.kuehn@aei.mpg.de>, freebsd-pkg@freebsd.org Subject: Re: config file installation/removal Message-ID: <c6c3ee70-ea53-ff25-9033-2472f1e5b58c@freebsd.org> In-Reply-To: <20210218195136.6d3b6117@comet2.terra.ger> References: <20210216122238.4057cde9@comet2.terra.ger> <20210218195136.6d3b6117@comet2.terra.ger>
next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4xYcvFnb1dY36xh36DbRnFvY5E9sUyLhh Content-Type: multipart/mixed; boundary="rRAGcQ9MQZMEdJEa1fjcBB4vkRmP7snpu"; protected-headers="v1" From: Stefan Esser <se@freebsd.org> To: Gerrit Kuehn <gerrit.kuehn@aei.mpg.de>, freebsd-pkg@freebsd.org Message-ID: <c6c3ee70-ea53-ff25-9033-2472f1e5b58c@freebsd.org> Subject: Re: config file installation/removal References: <20210216122238.4057cde9@comet2.terra.ger> <20210218195136.6d3b6117@comet2.terra.ger> In-Reply-To: <20210218195136.6d3b6117@comet2.terra.ger> --rRAGcQ9MQZMEdJEa1fjcBB4vkRmP7snpu Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: de-DE Content-Transfer-Encoding: quoted-printable Am 18.02.21 um 19:51 schrieb Gerrit Kuehn: >=20 > On Tue, 16 Feb 2021 12:22:38 +0100 > Gerrit Kuehn <gerrit.kuehn@aei.mpg.de> wrote: >=20 >=20 > Hello, >=20 > I think I finally found the trigger for this: > It happens on systems where I had moved /usr/local/etc to /etc/local an= d > put a link in /usr/local instead: >=20 > lrwxr-xr-x 1 root wheel 10 Aug 31 2018 etc@ -> /etc/local >=20 > Moving the directory back to /usr/local/etc makes pkg behave as before.= >=20 > I've been using this for many years on many systems, but something in > file handling must have changed in the pkg/ports recently causing this > strange behaviour with sample files installation/removal. >=20 > Any ideas why this changed? Is this a bug or a feature? The @sample option in the plist file is implemented in the following LUA code: DBG(3)[37044]> Scripts: executing lua --- BEGIN --- -- args: etc/pkg.conf.sample args =3D {} for arg in string.gmatch("etc/pkg.conf.sample", "%S+") do table.insert(args, arg) end sample_file =3D pkg.prefixed_path(args[1]) if args[2] =3D=3D nil then target_file =3D string.gsub(sample_file,'%.sample$', "") else target_file =3D pkg.prefixed_path(args[2]) end if not pkg.stat(target_file) then pkg.copy(sample_file, target_file) end Scripts: --- END --- My assumption is that pkg.stat() does not follow symbolic links, but I have not checked whether this actually is the case. Regards, STefan --rRAGcQ9MQZMEdJEa1fjcBB4vkRmP7snpu-- --4xYcvFnb1dY36xh36DbRnFvY5E9sUyLhh Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmAuwN4FAwAAAAAACgkQR+u171r99UQo TQf/RFwQCX5hSKyV1lSuj4uorqmfZKjevclrQuEUN9KktpGJ74efpTCTa9MQITWeKk0GrTadgFny aN3cgngDcCoc2qsUNrXJfeWa6bBuNe/C5fE3mGYPp0Q0dap8Ve9iXpBgVnDsYj2S3uJdElgikO76 83eRDHTTR6kYbI/NnAcn+BCO4pYYU5kANVZhi5hVrVacR0/g6b6qeWu+L0I8fIaOCLgii23+lydz Qe72qwNeEjVKukgmGdYmkuMvDCaQw+0WAR7KShIUvwTIGAZFlzjtwsxI63YyFbt7tZvj7UdQqBQk ImC2cxP9CEBzkQ4VQ/IQ5RTAEMmCfbL2PpOZB9fpUA== =Noa5 -----END PGP SIGNATURE----- --4xYcvFnb1dY36xh36DbRnFvY5E9sUyLhh--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?c6c3ee70-ea53-ff25-9033-2472f1e5b58c>