Fixed LSBash when the directory is empty and revert ls to lsbash
This commit is contained in:
parent
6fd26a2110
commit
38f0db7c66
@ -419,8 +419,10 @@ lsbash () {
|
||||
fi
|
||||
grep_find_file2 () {
|
||||
if [[ -z $1 ]] ; then
|
||||
if [[ $find_file_old != "*" ]] ; then
|
||||
echo "$find_file_old"
|
||||
found_successfully=1
|
||||
fi
|
||||
else
|
||||
find_file_old_array+=("$find_file_old")
|
||||
fi
|
||||
@ -1625,7 +1627,7 @@ init_wine_ver () {
|
||||
else
|
||||
if [[ -d "${PORT_WINE_PATH}/data/dist" ]] ; then
|
||||
IFS=$'\n'
|
||||
for dist_dir in $(ls -1 "${PORT_WINE_PATH}/data/dist") ; do
|
||||
for dist_dir in $(lsbash "${PORT_WINE_PATH}/data/dist") ; do
|
||||
dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e s/[[:blank:]]/_/g)
|
||||
if [[ ! -d "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}" ]] ; then
|
||||
mv -- "${PORT_WINE_PATH}/data/dist/$dist_dir" "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}"
|
||||
@ -1633,7 +1635,7 @@ init_wine_ver () {
|
||||
done
|
||||
IFS="$orig_IFS"
|
||||
fi
|
||||
if [[ -z $(ls "${PORT_WINE_PATH}/data/dist/" | grep "${PW_WINE_USE}") ]] ; then
|
||||
if [[ -z $(lsbash "${PORT_WINE_PATH}/data/dist/" --grep "${PW_WINE_USE}") ]] ; then
|
||||
if [[ "$PW_WINE_USE" =~ PROTON_LG* ]]
|
||||
then export PW_WINE_USE=PROTON_LG
|
||||
else export PW_WINE_USE=WINE_LG
|
||||
@ -1650,20 +1652,20 @@ init_wine_ver () {
|
||||
export WINELOADER="${WINEDIR}/bin/wine"
|
||||
export WINESERVER="${WINEDIR}/bin/wineserver"
|
||||
if [[ -d "${WINEDIR}/files" && ! -d "${WINEDIR}/dist" ]] ; then
|
||||
for clear_dist_files in $(ls "${WINEDIR}" | sed -r "s/^(files|version)$//g") ; do
|
||||
for clear_dist_files in $(lsbash "$WINEDIR" | sed -r "s/^(files|version)$//g") ; do
|
||||
rm -fr "${WINEDIR}/$clear_dist_files"
|
||||
done
|
||||
mv -f "${WINEDIR}/files"/* "${WINEDIR}/"
|
||||
rm -fr "${WINEDIR}/files"
|
||||
elif [[ ! -d "${WINEDIR}/files" && -d "${WINEDIR}/dist" ]] ; then
|
||||
for clear_dist_files in $(ls "${WINEDIR}" | sed -r "s/^(dist|version)$//g") ; do
|
||||
for clear_dist_files in $(lsbash "$WINEDIR" | sed -r "s/^(dist|version)$//g") ; do
|
||||
rm -fr "${WINEDIR}/$clear_dist_files"
|
||||
done
|
||||
mv -f "${WINEDIR}/dist"/* "${WINEDIR}/"
|
||||
rm -fr "${WINEDIR}/dist"
|
||||
elif [[ -f "${WINEDIR}/proton_dist.tar" ]] ; then
|
||||
unpack "${WINEDIR}/proton_dist.tar" "${WINEDIR}/"
|
||||
for clear_dist_files in $(ls "${WINEDIR}" | sed -r "s/^(bin|lib|lib64|share|version)$//g") ; do
|
||||
for clear_dist_files in $(lsbash "$WINEDIR" | sed -r "s/^(bin|lib|lib64|share|version)$//g") ; do
|
||||
rm -fr "${WINEDIR}/$clear_dist_files"
|
||||
done
|
||||
fi
|
||||
@ -1952,7 +1954,7 @@ pw_kill_autostart () {
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -n "$(ls "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/ | grep -m 1 ".tmp")" ]] ; then
|
||||
if [[ -n "$(lsbash "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/ | grep -m 1 ".tmp")" ]] ; then
|
||||
rm -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/*.tmp
|
||||
fi
|
||||
|
||||
@ -2043,8 +2045,8 @@ pw_download_libs () {
|
||||
"${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}.tar.xz" ; then
|
||||
if unpack "${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}.tar.xz" "${PORT_WINE_TMP_PATH}/" ; then
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}.tar.xz"
|
||||
if ls "${PORT_WINE_TMP_PATH}" | grep libs_v | grep -v libs"${PW_LIBS_VER}" ; then
|
||||
for RM_LIBS in $(ls "${PORT_WINE_TMP_PATH}" | grep libs_v | grep -v libs"${PW_LIBS_VER}")
|
||||
if lsbash "${PORT_WINE_TMP_PATH}" --grep libs_v --grep -v libs"${PW_LIBS_VER}" ; then
|
||||
for RM_LIBS in $(lsbash "${PORT_WINE_TMP_PATH}" --grep libs_v --grep -v libs"${PW_LIBS_VER}")
|
||||
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_LIBS}"
|
||||
done
|
||||
fi
|
||||
@ -2194,9 +2196,9 @@ pw_check_and_download_plugins () {
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}.tar.xz"
|
||||
# TODO: drop clear prefix, and add update prefix from new plugins
|
||||
pw_clear_pfx
|
||||
if ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}"
|
||||
if lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}"
|
||||
then
|
||||
for RM_PLUGINS in $(ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}")
|
||||
for RM_PLUGINS in $(lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}")
|
||||
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_PLUGINS}"
|
||||
done
|
||||
fi
|
||||
@ -2227,9 +2229,9 @@ pw_check_and_download_plugins () {
|
||||
try_remove_file "${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}.tar.xz"
|
||||
# TODO: drop clear prefix, and add update prefix from new plugins
|
||||
pw_clear_pfx
|
||||
if ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}"
|
||||
if lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}"
|
||||
then
|
||||
for RM_PLUGINS in $(ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}")
|
||||
for RM_PLUGINS in $(lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}")
|
||||
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_PLUGINS}"
|
||||
done
|
||||
fi
|
||||
@ -2356,7 +2358,7 @@ pw_init_db () {
|
||||
# shellcheck source=/dev/null
|
||||
source "${PORTWINE_DB_FILE}"
|
||||
if echo "${portwine_exe}" | grep "/prefixes/" &>/dev/null ; then
|
||||
if [[ -z $(ls "${PORT_WINE_PATH}/prefixes/" | grep -e ^"${PW_PREFIX_NAME}"$) ]] \
|
||||
if [[ -z $(lsbash "${PORT_WINE_PATH}/prefixes/" --grep ^"${PW_PREFIX_NAME}"$) ]] \
|
||||
|| [[ -z $(grep -e ^"export PW_PREFIX_NAME=" "${PORTWINE_DB_FILE}" 2>/dev/null) ]]
|
||||
then
|
||||
PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}')
|
||||
@ -2396,7 +2398,7 @@ pw_init_db () {
|
||||
try_copy_file "${PW_FIND_DB_FILE}" "${portwine_exe}".ppdb
|
||||
PORTWINE_DB_FILE="${portwine_exe}".ppdb
|
||||
if echo "${portwine_exe}" | grep "/prefixes/" &>/dev/null ; then
|
||||
if [[ -z $(ls "${PORT_WINE_PATH}/prefixes/" | grep -e ^"${PW_PREFIX_NAME}"$) ]] \
|
||||
if [[ -z $(lsbash "${PORT_WINE_PATH}/prefixes/" --grep ^"${PW_PREFIX_NAME}"$) ]] \
|
||||
|| [[ -z $(grep -e ^"export PW_PREFIX_NAME=" "${PORTWINE_DB_FILE}" 2>/dev/null) ]]
|
||||
then
|
||||
PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}')
|
||||
@ -2445,7 +2447,7 @@ pw_init_db () {
|
||||
if [[ "${PW_WINE_CPU_TOPOLOGY}" == "disabled" ]] && [[ -n "${WINE_CPU_TOPOLOGY}" ]] ; then
|
||||
export PW_WINE_CPU_TOPOLOGY="${WINE_CPU_TOPOLOGY}"
|
||||
fi
|
||||
if ls "${PATH_TO_GAME}"/*_Data/Resources/ 2>/dev/null | grep "unity" &>/dev/null \
|
||||
if lsbash "${PATH_TO_GAME}"/*_Data/Resources/ --grep "unity" &>/dev/null \
|
||||
&& [[ "${PW_WINE_CPU_TOPOLOGY}" == "disabled" ]] \
|
||||
&& [[ $(grep -c ^"processor" /proc/cpuinfo) -gt "8" ]]
|
||||
then
|
||||
|
@ -121,7 +121,7 @@ echo "" > "${PW_TMPFS_PATH}/tmp_yad_form_vulkan"
|
||||
|
||||
create_new_dir "${PORT_WINE_PATH}/data/dist"
|
||||
IFS=$'\n'
|
||||
for dist_dir in $(ls -1 "${PORT_WINE_PATH}/data/dist") ; do
|
||||
for dist_dir in $(lsbash "${PORT_WINE_PATH}/data/dist/") ; do
|
||||
dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e s/[[:blank:]]/_/g)
|
||||
if [[ ! -d "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}" ]] ; then
|
||||
mv -- "${PORT_WINE_PATH}/data/dist/$dist_dir" "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}"
|
||||
|
Loading…
Reference in New Issue
Block a user