From: Ionen Wolkens <ionen@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Subject: Re: [gentoo-dev] [PATCH v2 1/1] esed.eclass: new eclass
Date: Sat, 4 Jun 2022 03:00:34 -0400	[thread overview]
Message-ID: <YpsDEnqAN/YUMDSH@eversor> (raw)
In-Reply-To: <YpqkFR4FlC4BSWGO@dj3ntoo>
[-- Attachment #1: Type: text/plain, Size: 1790 bytes --]
On Fri, Jun 03, 2022 at 07:15:17PM -0500, Oskari Pirhonen wrote:
[snip[
> Testing for (in)equality between pre- and post-sed contents is
> reasonable enough in most cases. This time, though, it would fail to
> detect anything has changed since the pre-sed contents have their NULL's
> unintentionally stripped, whereas the post-sed contents have them
> intentionally stripped.
>
> While I personally don't think that running sed on binary files is a
> good idea in the first place, it's still relevant since the end result
> would be an incorrect answer to the question of "Did sed actually do
> anything?".
Yeah one of the primary motivation to silence this was elsewhere, I
don't think silencing matters for esed and if binary files are being
modified may as well use sed(1) directly instead (this is something
that'd need to be more intensively verified on bumps than with esed
anyway).
Use is also very uncommon, although sed is still "handy" when changing
just 1 instruction and want to avoid an extra dependency on a proper
binary patching method.
 
> On the other hand, saving a set of pre- and post-sed hashes like Ulrich
> suggested would give the expected result.
If really wanted to solve this yes, although it may make sense to say
this eclass is not for binary files. The talk to add bash-only "erepl"
makes it rather difficult to preserve nulls (mapfile silently strip \0
without even a warning). mapfile -d '' could allow to restore them
but ideally want to iterate on lines to do per-line pattern matches.
Is it possible to hack away something to preserve? Probably.. but it's
going to make this messy and I'm not sure it's worth it.
erepl is also worse because they'll be lost in output and not just
during comparison.
-- 
ionen
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
next prev parent reply	other threads:[~2022-06-04  7:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-31 11:23 [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Ionen Wolkens
2022-05-31 11:23 ` [gentoo-dev] [PATCH 1/2] esed.eclass: new eclass Ionen Wolkens
2022-05-31 13:45   ` Ionen Wolkens
2022-06-03  7:14   ` Ulrich Mueller
2022-06-03  9:26     ` Ionen Wolkens
2022-06-03 11:19       ` Ionen Wolkens
2022-05-31 11:23 ` [gentoo-dev] [PATCH 2/2] eclass/tests/esed.sh: basic tests for esed.eclass Ionen Wolkens
2022-05-31 13:54 ` [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Anna
2022-05-31 14:29   ` Ionen Wolkens
2022-05-31 14:44     ` Jaco Kroon
2022-06-03  4:09 ` Michał Górny
2022-06-03  4:45   ` Ionen Wolkens
2022-06-03  4:47     ` Anna V
2022-06-03  5:01       ` Ionen Wolkens
2022-06-03  5:00     ` Anna V
2022-06-03  5:05   ` Ionen Wolkens
2022-06-03  4:59 ` Sam James
2022-06-03  5:02   ` Sam James
2022-06-03 11:36 ` [gentoo-dev] [PATCH v2 0/1] esed Ionen Wolkens
2022-06-03 11:36   ` [gentoo-dev] [PATCH v2 1/1] esed.eclass: new eclass Ionen Wolkens
2022-06-04  0:15     ` Oskari Pirhonen
2022-06-04  7:00       ` Ionen Wolkens [this message]
2022-06-03 14:13   ` [gentoo-dev] [PATCH v2 0/1] esed Ionen Wolkens
2022-06-04 16:19 ` [gentoo-dev] [PATCH 0/2] Add esed.eclass for sed that dies if caused no changes Alessandro Barbieri
2022-06-04 16:53   ` Ionen Wolkens
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox
  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):
  git send-email \
    --in-reply-to=YpsDEnqAN/YUMDSH@eversor \
    --to=ionen@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY
  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
  Be sure your reply has a Subject: header at the top and a blank line
  before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox