All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: masonwardle@gmail.com, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 5/5] support/download/check-hash: accept hash files without terminating \n
Date: Tue, 20 Aug 2024 19:20:26 +0200	[thread overview]
Message-ID: <87jzgbf6w5.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <7c4ef882367896d7d522301f04c742bc26df47aa.1710027863.git.yann.morin.1998@free.fr> (Yann E. MORIN's message of "Sun, 10 Mar 2024 00:44:29 +0100")

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Lots of people are using broken text editors that 1. do not naturally
 > terminate text files with a final \n as is customary in UNIX text files,
 > and 2. do not respect our .editorconfig settings, which explicitly
 > require adding that final newline. See this nice summary of what a text
 > file is (with references to applicable standards):

 >     https://stackoverflow.com/questions/12916352/shell-script-read-missing-last-line/12916758#12916758

 > So, it is not surprising that read does not read the last "line" of a
 > file, when said "line" does not end with a newline, because it is thus
 > not really a line.

 > Even though we do mandate actual text files, let's be a little bit lax
 > in this respect, because people may write packages, and their hash
 > files, in a br2-external tree, and they may not have our .editorconfig
 > in the directory heierarchy (e.g. if buildroot is a submodule of their
 > br2-external tree, or whatever).

 > mapfile does not suffer from this limitation, though, and correctly
 > reads all lines from a file, even the final line-that-is-not-a-line.

 > mapfile was introduced in bash 4.0, released on 2009-01-20, more than
 > 15 years ago. Debian squeeze, released in 2011 already had bash 4.1.
 > Those are really ancient. So, it means we can indeed expect bash
 > version 4.0 or later; which means mapfile is available.

 > "It should be fine!"

 > Fixes: #15976

 > Reported-by: masonwardle@gmail.com
 > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

Committed to 2024.02.x and 2024.05.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2024-08-20 17:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-09 23:44 [Buildroot] [PATCH 0/5] support: accept text files with missing terminating \n (branch yem/newlines) Yann E. MORIN
2024-03-09 23:44 ` [Buildroot] [PATCH 1/5] support/scripts/mkusers: fix UID/GID confusion Yann E. MORIN
2024-03-09 23:44 ` [Buildroot] [PATCH 2/5] support/scripts/mkusers: fix shellcheck errors Yann E. MORIN
2024-03-09 23:44 ` [Buildroot] [PATCH 3/5] support/scripts/mkusers: accept user tables without terminating \n Yann E. MORIN
2024-07-14 20:50   ` Arnout Vandecappelle via buildroot
2024-08-20 17:18   ` Peter Korsgaard
2024-03-09 23:44 ` [Buildroot] [PATCH 4/5] support/download/check-hash: fix shellcheck errors Yann E. MORIN
2024-03-09 23:44 ` [Buildroot] [PATCH 5/5] support/download/check-hash: accept hash files without terminating \n Yann E. MORIN
2024-07-14 20:50   ` Arnout Vandecappelle via buildroot
2024-08-20 17:20   ` Peter Korsgaard [this message]
2024-04-01 18:49 ` [Buildroot] [PATCH 0/5] support: accept text files with missing terminating \n (branch yem/newlines) Yann E. MORIN

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=87jzgbf6w5.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@buildroot.org \
    --cc=masonwardle@gmail.com \
    --cc=yann.morin.1998@free.fr \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.