diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2020-11-24 15:39:35 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-24 15:39:35 +0100 |
commit | 79086e5d55e037b994c839c2894a3667ae72547b (patch) | |
tree | c8403bdf0da9c322ec36313e3e81606cf198b502 /pkgs | |
parent | fbeebf8b49daf2ad873a3657e9ec312339b7dc42 (diff) | |
parent | 4d51f95638a8ca1d1c8f911a9f6e6baf34b9a7c0 (diff) | |
download | nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.tar nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.tar.gz nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.tar.bz2 nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.tar.lz nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.tar.xz nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.tar.zst nixpkgs-79086e5d55e037b994c839c2894a3667ae72547b.zip |
Merge pull request #104769 from symphorien/appimage-run-locale
appimage-run: parse readelf's output in C locale
Diffstat (limited to 'pkgs')
-rwxr-xr-x | pkgs/build-support/appimage/appimage-exec.sh | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pkgs/build-support/appimage/appimage-exec.sh b/pkgs/build-support/appimage/appimage-exec.sh index 82ebdd0bbe4..7986c589667 100755 --- a/pkgs/build-support/appimage/appimage-exec.sh +++ b/pkgs/build-support/appimage/appimage-exec.sh @@ -1,4 +1,6 @@ #!@shell@ +# shellcheck shell=bash + if [ -n "$DEBUG" ] ; then set -x fi @@ -13,8 +15,10 @@ unpack() { local out="$2" # https://github.com/AppImage/libappimage/blob/ca8d4b53bed5cbc0f3d0398e30806e0d3adeaaab/src/libappimage/utils/MagicBytesChecker.cpp#L45-L63 - local appimageSignature=$(readelf -h "$src" | awk 'NR==2{print $10$11;}') - local appimageType=$(readelf -h "$src" | awk 'NR==2{print $12;}') + local appimageSignature; + appimageSignature="$(LC_ALL=C readelf -h "$src" | awk 'NR==2{print $10$11;}')" + local appimageType; + appimageType="$(LC_ALL=C readelf -h "$src" | awk 'NR==2{print $12;}')" # check AppImage signature if [ "$appimageSignature" != "4149" ]; then @@ -35,7 +39,7 @@ unpack() { # multiarch offset one-liner using same method as AppImage # see https://gist.github.com/probonopd/a490ba3401b5ef7b881d5e603fa20c93 - offset=$(readelf -h "$src" | awk 'NR==13{e_shoff=$5} NR==18{e_shentsize=$5} NR==19{e_shnum=$5} END{print e_shoff+e_shentsize*e_shnum}') + offset=$(LC_ALL=C readelf -h "$src" | awk 'NR==13{e_shoff=$5} NR==18{e_shentsize=$5} NR==19{e_shnum=$5} END{print e_shoff+e_shentsize*e_shnum}') echo "Uncompress $(basename "$src") of type $appimageType @ offset $offset" unsquashfs -q -d "$out" -o "$offset" "$src" chmod go-w "$out" |