blueprint-freespeech / ricochet-build

Repo for building ricochet-refresh
https://github.com/blueprint-freespeech/ricochet-refresh
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

package: use dd instead of sed to patch linuxdeploy #16

Closed NoisyCoil closed 5 months ago

NoisyCoil commented 5 months ago

If $linuxdeploy contains the sequence AI\x02 more than once, sed will replace all its occurrences. Instead, it should only replace the first one. This can be achieved either using one of sed's flags/options, or using

the much more precise and determinstic dd

as suggested by the intial author of the patch themselves.

For the record, this is not just a theoretical concern: linuxdeploy for linux-aarch64 (at least the linked version) does indeed contain the sequence AI\x02 twice, and the erroneous replacement of the second one makes the command

$linuxdeploy --appimage-extract-and-run -d ./ricochet-refresh.desktop  ${ICON_ARGS} --icon-filename=ricochet-refresh --output appimage --appdir AppDir

fail.