appimage-run: Support type-1 Appimages (#45973)
This attempts to detect older appimages and extract them in the same manner as new ones, without changing filesystem paths
This commit is contained in:
parent
3410dcd90e
commit
5fb0ed64d0
@ -1,4 +1,4 @@
|
|||||||
{ stdenv, writeScript, buildFHSUserEnv, coreutils
|
{ stdenv, writeScript, buildFHSUserEnv, coreutils, file, libarchive
|
||||||
, extraPkgs ? pkgs: [] }:
|
, extraPkgs ? pkgs: [] }:
|
||||||
|
|
||||||
buildFHSUserEnv {
|
buildFHSUserEnv {
|
||||||
@ -131,7 +131,14 @@ buildFHSUserEnv {
|
|||||||
export APPDIR="$SQUASHFS_ROOT/squashfs-root"
|
export APPDIR="$SQUASHFS_ROOT/squashfs-root"
|
||||||
if [ ! -x "$APPDIR" ]; then
|
if [ ! -x "$APPDIR" ]; then
|
||||||
cd "$SQUASHFS_ROOT"
|
cd "$SQUASHFS_ROOT"
|
||||||
"$APPIMAGE" --appimage-extract 2>/dev/null
|
|
||||||
|
if ${file}/bin/file --mime-type --brief --keep-going "$APPIMAGE" | grep -q iso; then
|
||||||
|
# is type-1 appimage
|
||||||
|
${libarchive}/bin/bsdtar -x -C "$SQUASHFS_ROOT" -f "$APPIMAGE"
|
||||||
|
else
|
||||||
|
# is type-2 appimage
|
||||||
|
"$APPIMAGE" --appimage-extract 2>/dev/null
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cd "$APPDIR"
|
cd "$APPDIR"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user