Date: Tue, 18 Apr 2023 13:48:04 +0200 From: Felix Palmen <zirias@FreeBSD.org> To: ports@freebsd.org Subject: Re: Get ${OSREL} at install time Message-ID: <3gizlmiaz2h3qwk6xe64iik42vr6mtxyex4d2hjaymazz5nngt@3wm6jdrdxslm> In-Reply-To: <CAFDf7ULnDW2w8O9WD%2BDMdT2ku0DtH9OWDBidfejJQ9BEhJHOUg@mail.gmail.com> References: <CAFDf7UKJ%2BSy0f9xJZ8oc8fcaejhT1LFgjspVTHDt4E99z2sz3w@mail.gmail.com> <ff0dc458-76f6-0bc2-8560-0eea00744226@grosbein.net> <bbeaf874-8d0d-88b3-29d6-fcb081fb26cd@grosbein.net> <CAFDf7U%2BwOWBnW=bT8qM96_%2BWzCvgZ2dO2TD2LiJ=Gyc36Ft80A@mail.gmail.com> <oeuktukoy63y4f42sk3w3cel52g5zh3ng5rpjrn6rfoudksrkq@qiuzgeoqdmnn> <CAFDf7UK=-R6o2Q5o2ihsiD%2Bue_4L2j1tXEu2LiJSVp%2Br=uEwww@mail.gmail.com> <CAFDf7U%2BaV5rVQgcWz96v80tPWFH-9RXRmMbnrqEjv93xx9rvuw@mail.gmail.com> <CAFDf7ULnDW2w8O9WD%2BDMdT2ku0DtH9OWDBidfejJQ9BEhJHOUg@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
--bmhvz72sfqmq4ujt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Nuno Teixeira <eduardo@freebsd.org> [20230418 12:38]: > @postexec env osrel=3D$(freebsd-version -u) sed -E -e > "s,stable/[0-9]+,stable/${osrel%%.*}," -e > "s,releng/[0-9]+,releng/${osrel%%-*}," %%PREFIX%%/etc/gitup.conf This can't work because the shell will expand ${osrel%%...} before executing this whole command (and then, it's still unset). As a workaround, you could explicitly start another shell, e.g. like | env osrel=3D$([...]) /bin/sh -c 'sed -e "s,foo,${osrel%%-*}," [...]' But this is getting *really* messy, so I'd personally opt for the explicit post-install script. BTW, another thing might be a bit problematic here: Calling freebsd-version like this will work when pkg is used with -c (using chroot), but most likely not with -r. --=20 Felix Palmen <zirias@FreeBSD.org> {private} felix@palmen-it.de -- ports committer (mentee) -- {web} http://palmen-it.de {pgp public key} http://palmen-it.de/pub.txt {pgp fingerprint} 6936 13D5 5BBF 4837 B212 3ACC 54AD E006 9879 F231 --bmhvz72sfqmq4ujt Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iNUEABYKAH0WIQRpNhPVW79IN7ISOsxUreAGmHnyMQUCZD6DdF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0Njkz NjEzRDU1QkJGNDgzN0IyMTIzQUNDNTRBREUwMDY5ODc5RjIzMQAKCRBUreAGmHny MU77AP9E3lUc4NIAoTTUrbWJyze2AKku9aeBsAILGKYbRwiNxgD/Yb11ZTejUEpA /kTekDshfs+c/YTcAYABSBUhppLPJw8= =4zuc -----END PGP SIGNATURE----- --bmhvz72sfqmq4ujt--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3gizlmiaz2h3qwk6xe64iik42vr6mtxyex4d2hjaymazz5nngt>