Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 6 Mar 2021 10:12:03 -0600
From:      Kyle Evans <kevans@freebsd.org>
To:        freebsd@dreamchaser.org
Cc:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: sed -i empty argument compatibility issue
Message-ID:  <CACNAnaGNxhO8GQK=Z_-47HkHpbsHCoANPbFmmdxOsm%2Bxm%2BFDbg@mail.gmail.com>
In-Reply-To: <698998b7-e46c-b27f-29cf-7abd7b1a0b7b@dreamchaser.org>
References:  <9178f6c5-631a-c2c2-c6b1-8def94a3397b@dreamchaser.org> <CACNAnaGNj55KkSEZOoEqtMVOXtFpk5Ek9tEKJJYARWUGgpwCcw@mail.gmail.com> <f89c2931-ae39-37c4-9638-f0ab39884c3f@dreamchaser.org> <CACNAnaGhGpjO0BzFskJketcnvi5%2BsjOD9N-jTffK_Ejnpt%2BzXQ@mail.gmail.com> <42cacf1d-88be-d8a2-9ff4-f82ce378adc7@dreamchaser.org> <CACNAnaF0LpDKtct1WGNemodz-ycUvrdGNh1vburxKWU070D3bA@mail.gmail.com> <698998b7-e46c-b27f-29cf-7abd7b1a0b7b@dreamchaser.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Mar 6, 2021 at 9:40 AM Gary Aitken <freebsd@dreamchaser.org> wrote:
>
> On 3/5/21 10:42 PM, Kyle Evans wrote:
>
> > Is this used only at build-time, or at runtime? The former can just
> > pull in gsed as a BUILD_DEPENDS and use a BINARY_ALIAS to stash it
> > first. Autoconfig takes some more work;
> > ac_cv_path_SED=${LOCALBASE}/bin/gsed instead, maybe. At runtime, your
> > best option is to patch the script to use gsed and slap a RUN_DEPENDS
> > on that bad boy.
>
> It's a build-time only issue, but I'm trying to come up with a solution
> that "just works" on both the linux end and the fbsd end, so porting
> doesn't involve any patch files.  A BUILD_DEPENDS and BINARY_ALIAS would
> work, thanks.  I see that now in the porter's hb, 5.17.  That may be a
> better solution, as it would deal with any future instances of non-standard
> usage, although convincing the linux and windoze folks to use only
> standard features would be a good thing.
>

Excellent, good to hear.

Also, some of the other comments in this thread have been a little
discouraging. In an ideal world, FreeBSD would have adopted the same
argument-optional approach, because that's what *Perl* does. We
originally adopted the feature from Perl back in 839af0c1039fbde.
Calling the GNU sed behavior "broken" is just outright wrong, given
that there is no prior Unix art for this and it's a much more useful
interpretation of '-i'.

Thanks,

Kyle Evans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACNAnaGNxhO8GQK=Z_-47HkHpbsHCoANPbFmmdxOsm%2Bxm%2BFDbg>