- payload now extracts in the right location - payload checks if the file is already extracted - etc.master
parent
35d955683e
commit
17ab178cdd
@ -1,2 +1 @@ |
|||||||
**/pcmi/** |
tests/** |
||||||
**/badwolf/** |
|
||||||
|
@ -1,19 +1,27 @@ |
|||||||
#!/bin/sh -e |
#!/bin/sh -e |
||||||
|
|
||||||
# TODO: verify checksum before extracting |
# TODO: verify checksum before extracting |
||||||
# SUM |
|
||||||
# TODO: extract self without resolving to $0 because it doesn't resolve links |
# TODO: extract self without resolving to $0 because it doesn't resolve links |
||||||
tail -c +"$(expr BYTES + 1)" $0 | lz4 -dc | tar -x |
|
||||||
# TODO: remove hardcoded directory |
|
||||||
# TODO: use a different extraction path |
|
||||||
cd ID |
|
||||||
|
|
||||||
export ORIGIN="$(pwd)" |
if [ -z "$XDG_CACHE_HOME" ]; then |
||||||
export LD_LIBRARY_PATH="$ORIGIN/lib" |
destdir=/tmp |
||||||
export PATH="$ORIGIN/bin":$PATH |
else |
||||||
|
destdir="$XDG_CACHE_HOME" |
||||||
|
fi |
||||||
|
|
||||||
#export LD_DEBUG='libs' |
if ! [ "$(head -n 1 "$destdir"/ID/checksum 2>/dev/null)" = 'SUM' ]; then |
||||||
|
tail -c +BYTES "$0" | lz4 -dc | tar -x -C "$destdir" |
||||||
|
echo "SUM" > "$destdir"/ID/checksum |
||||||
|
fi |
||||||
|
|
||||||
|
ORIGIN="$destdir"/ID |
||||||
|
LD_LIBRARY_PATH="$ORIGIN/lib" |
||||||
|
PATH="$ORIGIN/bin":$PATH |
||||||
|
export ORIGIN |
||||||
|
export LD_LIBRARY_PATH |
||||||
|
export PATH |
||||||
|
|
||||||
|
# export LD_DEBUG='libs' |
||||||
|
|
||||||
# TODO: use $0 instead |
# TODO: use $0 instead |
||||||
# FIXME: uses the system's basename |
exec "$destdir"/ID/bin/"$(basename "$1")" |
||||||
exec bin/"$(basename "$1")" |
|
||||||
|
Loading…
Reference in new issue