From owner-freebsd-questions@freebsd.org Sat Mar 6 16:12:21 2021 Return-Path: Delivered-To: freebsd-questions@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 B385756B4E7 for ; Sat, 6 Mar 2021 16:12:21 +0000 (UTC) (envelope-from kevans@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 4Dt8ks4gMCz4XT6 for ; Sat, 6 Mar 2021 16:12:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: from mail-qt1-f170.google.com (mail-qt1-f170.google.com [209.85.160.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) (Authenticated sender: kevans) by smtp.freebsd.org (Postfix) with ESMTPSA id 93439245DB for ; Sat, 6 Mar 2021 16:12:21 +0000 (UTC) (envelope-from kevans@freebsd.org) Received: by mail-qt1-f170.google.com with SMTP id v3so4311968qtw.4 for ; Sat, 06 Mar 2021 08:12:21 -0800 (PST) X-Gm-Message-State: AOAM531NjP7Qn0OAXx3KhNK+d+K1faikb1f7ZHCl6kFTgPj3kle6snPw 0rVbs5GGOXzKRV4W4YmIAKAZPM4PrmJ1eI2E6F4= X-Google-Smtp-Source: ABdhPJw73dsk7mUJCy36BoARS1+FvDBB6HUkNCy9jZastY/MeACY00y7ZB/MWXgwvA2Nv5wKkW+iEEI57Y9rIlv35Z0= X-Received: by 2002:ac8:5bcb:: with SMTP id b11mr13948055qtb.310.1615047140964; Sat, 06 Mar 2021 08:12:20 -0800 (PST) MIME-Version: 1.0 References: <9178f6c5-631a-c2c2-c6b1-8def94a3397b@dreamchaser.org> <42cacf1d-88be-d8a2-9ff4-f82ce378adc7@dreamchaser.org> <698998b7-e46c-b27f-29cf-7abd7b1a0b7b@dreamchaser.org> In-Reply-To: <698998b7-e46c-b27f-29cf-7abd7b1a0b7b@dreamchaser.org> From: Kyle Evans Date: Sat, 6 Mar 2021 10:12:03 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: sed -i empty argument compatibility issue To: freebsd@dreamchaser.org Cc: FreeBSD Mailing List Content-Type: text/plain; charset="UTF-8" X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Mar 2021 16:12:21 -0000 On Sat, Mar 6, 2021 at 9:40 AM Gary Aitken 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