On 31.01.2011 22:35, dave reisner wrote:
+ soarch=$(LC_ALL=C readelf -h "$filename" 2>/dev/null | sed -n 's/.*Class.*ELF\(32\|64\)/\1/p')
Can I suggest using a lower level approach less prone to breakage because of a change in output format? It's a little more verbose, but it directly follows the ELF standard:
magic=$(dd if="$filename" bs=1 skip=1 count=3 2>/dev/null) [[ "$magic" = ELF ]] || continue read _ elfclass < <(hexdump -s5 -n1 "$filename") case $elfclass in *(0)1) soarch=32 ;; *(0)2) soarch=64 ;; esac [[ $soarch ]] || continue
And I already though the current implementation is too obfuscated... If you really want to do that, please move it to a script/binary with a few options so we can just get exactly the strings we need, but keep makepkg readable. -- Florian Pritz -- {flo,bluewind}@server-speed.net