Skip to content

Commit

Permalink
Reorganize installation
Browse files Browse the repository at this point in the history
  • Loading branch information
ale5000-git committed Aug 12, 2023
1 parent 5eb610e commit f4ec1e3
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 19 deletions.
4 changes: 3 additions & 1 deletion zip-content/inc/common-functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -735,16 +735,18 @@ prepare_installation()
ui_msg 'Preparing installation...'

if test "${PRIVAPP_FOLDER:?}" != 'priv-app' && test -e "${TMP_PATH:?}/files/priv-app"; then
ui_debug "Merging priv-app folder with ${PRIVAPP_FOLDER:?} folder..."
mkdir -p -- "${TMP_PATH:?}/files/${PRIVAPP_FOLDER:?}" || ui_error "Failed to create the dir '${TMP_PATH:?}/files/${PRIVAPP_FOLDER:?}'"
copy_dir_content "${TMP_PATH:?}/files/priv-app" "${TMP_PATH:?}/files/${PRIVAPP_FOLDER:?}"
delete "${TMP_PATH:?}/files/priv-app"
delete_temp "files/priv-app"
fi

if test "${API:?}" -ge 21; then
_backup_ifs="${IFS:-}"
IFS=''

# Move apps into subdirs
ui_debug "Moving apps into subdirs..."
if test -e "${TMP_PATH:?}/files/priv-app"; then
for entry in "${TMP_PATH:?}/files/priv-app"/*; do
path_without_ext="$(remove_ext "${entry:?}")"
Expand Down
36 changes: 18 additions & 18 deletions zip-content/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ if test "${IS_INSTALLATION:?}" = 'true'; then
# Preparing
ui_msg 'Preparing...'

# Check the existance of the libraries folders
if test "${API:?}" -ge 9 && test "${API:?}" -lt 21; then
if test "${CPU}" != false && test ! -e "${SYS_PATH:?}/lib"; then create_dir "${SYS_PATH:?}/lib"; fi
if test "${CPU64}" != false && test ! -e "${SYS_PATH:?}/lib64"; then create_dir "${SYS_PATH:?}/lib64"; fi
fi

setup_app 1 'UnifiedNlp (legacy)' 'LegacyNetworkLocation' 'app' false false

setup_app 1 'microG Services Core (vtm-legacy)' 'GmsCoreVtmLegacy' 'priv-app' false false
Expand Down Expand Up @@ -271,6 +265,14 @@ if test "${API:?}" -ge 21; then
create_dir "${TMP_PATH:?}/files/priv-app/GmsCore/lib"
move_dir_content "${TMP_PATH:?}/selected-libs" "${TMP_PATH:?}/files/priv-app/GmsCore/lib"
delete "${TMP_PATH:?}/selected-libs"
elif test "${API:?}" -ge 9; then
if test "${CPU64}" != false; then
move_rename_dir "${TMP_PATH:?}/libs/lib/${CPU64}" "${TMP_PATH:?}/files/lib64"
fi
if test "${CPU}" != false; then
move_rename_dir "${TMP_PATH:?}/libs/lib/${CPU}" "${TMP_PATH:?}/files/lib"
fi
delete "${TMP_PATH:?}/libs"
fi

if test "${API:?}" -lt 9; then
Expand All @@ -285,6 +287,16 @@ set_perm 0 0 0755 "${TMP_PATH:?}/addon.d/00-1-microg.sh"

# Installing
ui_msg 'Installing...'
if test "${API:?}" -ge 9 && test "${API:?}" -lt 21; then
if test "${CPU64}" != false; then
create_dir "${SYS_PATH:?}/lib64"
copy_dir_content "${TMP_PATH:?}/files/lib64" "${SYS_PATH:?}/lib64"
fi
if test "${CPU}" != false; then
create_dir "${SYS_PATH:?}/lib"
copy_dir_content "${TMP_PATH:?}/files/lib" "${SYS_PATH:?}/lib"
fi
fi
if test -f "${TMP_PATH:?}/files/etc/microg_device_profile.xml"; then copy_file "${TMP_PATH:?}/files/etc/microg_device_profile.xml" "${SYS_PATH:?}/etc"; fi
if test -f "${TMP_PATH:?}/files/etc/microg.xml"; then copy_file "${TMP_PATH:?}/files/etc/microg.xml" "${SYS_PATH:?}/etc"; fi
if test -e "${TMP_PATH:?}/files/etc/org.fdroid.fdroid"; then copy_dir_content "${TMP_PATH:?}/files/etc/org.fdroid.fdroid" "${SYS_PATH:?}/etc/org.fdroid.fdroid"; fi
Expand All @@ -310,18 +322,6 @@ fi

delete_dir_if_empty "${TMP_PATH:?}/files/etc"

if test "${API:?}" -ge 9 && test "${API:?}" -lt 21; then
if test "${CPU}" != false; then
move_rename_dir "${TMP_PATH:?}/libs/lib/${CPU}" "${TMP_PATH:?}/files/lib"
copy_dir_content "${TMP_PATH:?}/files/lib" "${SYS_PATH:?}/lib"
fi
if test "${CPU64}" != false; then
move_rename_dir "${TMP_PATH:?}/libs/lib/${CPU64}" "${TMP_PATH:?}/files/lib64"
copy_dir_content "${TMP_PATH:?}/files/lib64" "${SYS_PATH:?}/lib64"
fi
fi
delete_recursive "${TMP_PATH:?}/libs"

USED_SETTINGS_PATH="${TMP_PATH:?}/files/etc/zips"
create_dir "${USED_SETTINGS_PATH:?}"

Expand Down

0 comments on commit f4ec1e3

Please sign in to comment.