Lennart Sorensen <lsore...@csclub.uwaterloo.ca> writes: > On Mon, Oct 31, 2016 at 04:06:43PM +0100, Cyril Brulebois wrote: >> I think a crucial point is that something's being documented in standards >> doesn't mean it actually works in real life, everywhere, in all versions >> of all implementations. (There's also the topic of possible differences in >> interpretations.) > > That is certainly true. Bugs happen. > > So I did miss something. sed does not support \a. > > One option that does work in d-i based on the posix spec would be > something like this: > > sed '1,/^$/d;/^-----BEGIN PGP SIGNATURE-----$/,$d' < "$inreldest" | tr '\n' > '\a' | sed 's/[[:cntrl:]]$//' | tr '\a' '\n' > "$reldest" > > Of course that is deleting the control character at the end of the file, > not just if it is \a, although given the input isn't supposed to contain > any control characters that might be OK. > > Apparently sed in d-i is really close to only doing what posix says it > has to do and hence no support for \a. > > So if there is any desire to remove the need for having head support > negative offsets, then the above might be an option. > >> > > That's entirely correct. Running from within d-i is mandatory though… >> > >> > Well yes, that part should certainly work. >> >> should → must > > Sure. > >> > Now why did GPG decide to throw away the last character in the input >> > anyhow. Such a stupid choice. >> >> We're not here to discuss GPG choices, or bugs. > > Nope, just pondering. Seems like such a dumb choice. > >> > So it does mean if it hsa InRelease signature, then you need head that >> > supports negative offsets, so any decent linux system should be fine, >> > and any recent busybox with enough advanced features. >> >> We don't *need* head with negative offsets. That was just a random idea I >> had at the time, which I checked to be working fine. The bug closure and >> the committed implementation show there's no *need* for that… > > Well there doesn't seem to be any simple way to delete the last newline > with just shell tools. head seems like the best one so far, when using > the extention.
The fixed function that does the work in the new release is here: http://sources.debian.net/src/debootstrap/1.0.86/functions/#L529 as you can see, it's pure shell. Cheers, Phil. -- |)| Philip Hands [+44 (0)20 8530 9560] HANDS.COM Ltd. |-| http://www.hands.com/ http://ftp.uk.debian.org/ |(| Hugo-Klemm-Strasse 34, 21075 Hamburg, GERMANY
signature.asc
Description: PGP signature