mirror of
https://github.com/Phantop/appdwarf.git
synced 2024-11-19 13:23:06 +00:00
zzexe: fix decompression to modified exit
This commit is contained in:
parent
d65e78c2d5
commit
91e3ab229f
4
appdwarf
4
appdwarf
|
@ -40,7 +40,7 @@ zzexe() {
|
|||
|
||||
zzexe_header() {
|
||||
dir=$(dirname "$0") out=$(mktemp -t .zzXXXX.)
|
||||
awk 'f;/^exit \$res$/{f=1}' "$0" | head -c-1 | zstd -cd > "$out"
|
||||
awk 'f;/^exit \$\?$/{f=1}' "$0" | head -c-1 | zstd -cd > "$out"
|
||||
chmod +x "$out"
|
||||
ln -s "$out" "$dir"
|
||||
trap 'rm "$out" "$dir/$(basename "$out")"' 0 1 2 3 6 14 15 EXIT
|
||||
|
@ -61,7 +61,7 @@ case "$1" in
|
|||
d=dwarfs-root # just to keep line shorter, extract if file is dwarfs
|
||||
dwarfsck -d0 -i"$2" && mkdir $d && dwarfsextract -o $d -i "$2" && exit
|
||||
tmp=$(mktemp) # make tmp file to avoid io operations
|
||||
awk 'f;/^exit \$res$/{f=1}' "$2" | head -c-1 | zstd -cd > "$tmp"
|
||||
awk 'f;/^exit \$\?$/{f=1}' "$2" | head -c-1 | zstd -cd > "$tmp"
|
||||
mv "$tmp" "$2"
|
||||
chmod +x "$2"
|
||||
exit ;;
|
||||
|
|
Loading…
Reference in a new issue