mirror of
https://github.com/Phantop/appdwarf.git
synced 2025-01-10 06:06:47 +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() {
|
zzexe_header() {
|
||||||
dir=$(dirname "$0") out=$(mktemp -t .zzXXXX.)
|
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"
|
chmod +x "$out"
|
||||||
ln -s "$out" "$dir"
|
ln -s "$out" "$dir"
|
||||||
trap 'rm "$out" "$dir/$(basename "$out")"' 0 1 2 3 6 14 15 EXIT
|
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
|
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
|
dwarfsck -d0 -i"$2" && mkdir $d && dwarfsextract -o $d -i "$2" && exit
|
||||||
tmp=$(mktemp) # make tmp file to avoid io operations
|
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"
|
mv "$tmp" "$2"
|
||||||
chmod +x "$2"
|
chmod +x "$2"
|
||||||
exit ;;
|
exit ;;
|
||||||
|
|
Loading…
Reference in a new issue