From owner-freebsd-pkg@freebsd.org Thu Feb 18 19:32:48 2021 Return-Path: Delivered-To: freebsd-pkg@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id A062E547594 for ; Thu, 18 Feb 2021 19:32:48 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4DhPxX469Tz3LwK; Thu, 18 Feb 2021 19:32:48 +0000 (UTC) (envelope-from se@freebsd.org) Received: from Stefans-MBP-449.fritz.box (p200300cd5f19c700b8ef6f1af3dcb8fd.dip0.t-ipconnect.de [IPv6:2003:cd:5f19:c700:b8ef:6f1a:f3dc:b8fd]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 195B39645; Thu, 18 Feb 2021 19:32:48 +0000 (UTC) (envelope-from se@freebsd.org) To: Gerrit Kuehn , freebsd-pkg@freebsd.org References: <20210216122238.4057cde9@comet2.terra.ger> <20210218195136.6d3b6117@comet2.terra.ger> From: Stefan Esser Subject: Re: config file installation/removal Message-ID: Date: Thu, 18 Feb 2021 20:32:46 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210218195136.6d3b6117@comet2.terra.ger> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="4xYcvFnb1dY36xh36DbRnFvY5E9sUyLhh" X-BeenThere: freebsd-pkg@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Binary package management and package tools discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Feb 2021 19:32:48 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --4xYcvFnb1dY36xh36DbRnFvY5E9sUyLhh Content-Type: multipart/mixed; boundary="rRAGcQ9MQZMEdJEa1fjcBB4vkRmP7snpu"; protected-headers="v1" From: Stefan Esser To: Gerrit Kuehn , freebsd-pkg@freebsd.org Message-ID: 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 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--