Commit 7cfd56f9 authored by Mikhail Tergoev's avatar Mikhail Tergoev

revert: lsbash to ls

parent c784add1
...@@ -410,6 +410,7 @@ lsbash () { ...@@ -410,6 +410,7 @@ lsbash () {
else else
directory=$PWD directory=$PWD
fi fi
grep_find_file1 () { grep_find_file1 () {
find_file_old=$find_file find_file_old=$find_file
if [[ $grep_with_i == true ]] ; then if [[ $grep_with_i == true ]] ; then
...@@ -1624,7 +1625,7 @@ init_wine_ver () { ...@@ -1624,7 +1625,7 @@ init_wine_ver () {
else else
if [[ -d "${PORT_WINE_PATH}/data/dist" ]] ; then if [[ -d "${PORT_WINE_PATH}/data/dist" ]] ; then
IFS=$'\n' IFS=$'\n'
for dist_dir in $(lsbash "${PORT_WINE_PATH}/data/dist/") ; do for dist_dir in $(ls -1 "${PORT_WINE_PATH}/data/dist") ; do
dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e s/[[:blank:]]/_/g) 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 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^^}" mv -- "${PORT_WINE_PATH}/data/dist/$dist_dir" "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}"
...@@ -1632,7 +1633,7 @@ init_wine_ver () { ...@@ -1632,7 +1633,7 @@ init_wine_ver () {
done done
IFS="$orig_IFS" IFS="$orig_IFS"
fi fi
if [[ -z $(lsbash "${PORT_WINE_PATH}/data/dist/" --grep "${PW_WINE_USE}") ]] ; then if [[ -z $(ls "${PORT_WINE_PATH}/data/dist/" | grep "${PW_WINE_USE}") ]] ; then
if [[ "$PW_WINE_USE" =~ PROTON_LG* ]] if [[ "$PW_WINE_USE" =~ PROTON_LG* ]]
then export PW_WINE_USE=PROTON_LG then export PW_WINE_USE=PROTON_LG
else export PW_WINE_USE=WINE_LG else export PW_WINE_USE=WINE_LG
...@@ -1649,20 +1650,20 @@ init_wine_ver () { ...@@ -1649,20 +1650,20 @@ init_wine_ver () {
export WINELOADER="${WINEDIR}/bin/wine" export WINELOADER="${WINEDIR}/bin/wine"
export WINESERVER="${WINEDIR}/bin/wineserver" export WINESERVER="${WINEDIR}/bin/wineserver"
if [[ -d "${WINEDIR}/files" && ! -d "${WINEDIR}/dist" ]] ; then if [[ -d "${WINEDIR}/files" && ! -d "${WINEDIR}/dist" ]] ; then
for clear_dist_files in $(lsbash "$WINEDIR" | sed -r "s/^(files|version)$//g") ; do for clear_dist_files in $(ls "${WINEDIR}" | sed -r "s/^(files|version)$//g") ; do
rm -fr "${WINEDIR}/$clear_dist_files" rm -fr "${WINEDIR}/$clear_dist_files"
done done
mv -f "${WINEDIR}/files"/* "${WINEDIR}/" mv -f "${WINEDIR}/files"/* "${WINEDIR}/"
rm -fr "${WINEDIR}/files" rm -fr "${WINEDIR}/files"
elif [[ ! -d "${WINEDIR}/files" && -d "${WINEDIR}/dist" ]] ; then elif [[ ! -d "${WINEDIR}/files" && -d "${WINEDIR}/dist" ]] ; then
for clear_dist_files in $(lsbash "$WINEDIR" | sed -r "s/^(dist|version)$//g") ; do for clear_dist_files in $(ls "${WINEDIR}" | sed -r "s/^(dist|version)$//g") ; do
rm -fr "${WINEDIR}/$clear_dist_files" rm -fr "${WINEDIR}/$clear_dist_files"
done done
mv -f "${WINEDIR}/dist"/* "${WINEDIR}/" mv -f "${WINEDIR}/dist"/* "${WINEDIR}/"
rm -fr "${WINEDIR}/dist" rm -fr "${WINEDIR}/dist"
elif [[ -f "${WINEDIR}/proton_dist.tar" ]] ; then elif [[ -f "${WINEDIR}/proton_dist.tar" ]] ; then
unpack "${WINEDIR}/proton_dist.tar" "${WINEDIR}/" unpack "${WINEDIR}/proton_dist.tar" "${WINEDIR}/"
for clear_dist_files in $(lsbash "$WINEDIR" | sed -r "s/^(bin|lib|lib64|share|version)$//g") ; do for clear_dist_files in $(ls "${WINEDIR}" | sed -r "s/^(bin|lib|lib64|share|version)$//g") ; do
rm -fr "${WINEDIR}/$clear_dist_files" rm -fr "${WINEDIR}/$clear_dist_files"
done done
fi fi
...@@ -1951,7 +1952,7 @@ pw_kill_autostart () { ...@@ -1951,7 +1952,7 @@ pw_kill_autostart () {
fi fi
done done
if [[ -n "$(lsbash "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/ | grep -m 1 ".tmp")" ]] ; then if [[ -n "$(ls "${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 rm -f "${PORT_WINE_PATH}/data/prefixes/${PW_PREFIX_NAME}"/drive_c/*.tmp
fi fi
...@@ -2042,8 +2043,8 @@ pw_download_libs () { ...@@ -2042,8 +2043,8 @@ pw_download_libs () {
"${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}.tar.xz" ; then "${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 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" try_remove_file "${PORT_WINE_TMP_PATH}/libs${PW_LIBS_VER}.tar.xz"
if lsbash "${PORT_WINE_TMP_PATH}" --grep libs_v --grep -v libs"${PW_LIBS_VER}" ; then if ls "${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}") for RM_LIBS in $(ls "${PORT_WINE_TMP_PATH}" | grep libs_v | grep -v libs"${PW_LIBS_VER}")
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_LIBS}" do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_LIBS}"
done done
fi fi
...@@ -2193,9 +2194,9 @@ pw_check_and_download_plugins () { ...@@ -2193,9 +2194,9 @@ pw_check_and_download_plugins () {
try_remove_file "${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}.tar.xz" try_remove_file "${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}.tar.xz"
# TODO: drop clear prefix, and add update prefix from new plugins # TODO: drop clear prefix, and add update prefix from new plugins
pw_clear_pfx pw_clear_pfx
if lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}" if ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}"
then then
for RM_PLUGINS in $(lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}") for RM_PLUGINS in $(ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}")
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_PLUGINS}" do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_PLUGINS}"
done done
fi fi
...@@ -2226,9 +2227,9 @@ pw_check_and_download_plugins () { ...@@ -2226,9 +2227,9 @@ pw_check_and_download_plugins () {
try_remove_file "${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}.tar.xz" try_remove_file "${PORT_WINE_TMP_PATH}/plugins${PW_PLUGINS_VER}.tar.xz"
# TODO: drop clear prefix, and add update prefix from new plugins # TODO: drop clear prefix, and add update prefix from new plugins
pw_clear_pfx pw_clear_pfx
if lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}" if ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}"
then then
for RM_PLUGINS in $(lsbash "${PORT_WINE_TMP_PATH}" --grep plugins_v --grep -v "plugins${PW_PLUGINS_VER}") for RM_PLUGINS in $(ls "${PORT_WINE_TMP_PATH}" | grep plugins_v | grep -v "plugins${PW_PLUGINS_VER}")
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_PLUGINS}" do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_PLUGINS}"
done done
fi fi
...@@ -2355,7 +2356,7 @@ pw_init_db () { ...@@ -2355,7 +2356,7 @@ pw_init_db () {
# shellcheck source=/dev/null # shellcheck source=/dev/null
source "${PORTWINE_DB_FILE}" source "${PORTWINE_DB_FILE}"
if echo "${portwine_exe}" | grep "/prefixes/" &>/dev/null ; then if echo "${portwine_exe}" | grep "/prefixes/" &>/dev/null ; then
if [[ -z $(lsbash "${PORT_WINE_PATH}/prefixes/" --grep ^"${PW_PREFIX_NAME}"$) ]] \ if [[ -z $(ls "${PORT_WINE_PATH}/prefixes/" | grep -e ^"${PW_PREFIX_NAME}"$) ]] \
|| [[ -z $(grep -e ^"export PW_PREFIX_NAME=" "${PORTWINE_DB_FILE}" 2>/dev/null) ]] || [[ -z $(grep -e ^"export PW_PREFIX_NAME=" "${PORTWINE_DB_FILE}" 2>/dev/null) ]]
then then
PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}') PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}')
...@@ -2395,7 +2396,7 @@ pw_init_db () { ...@@ -2395,7 +2396,7 @@ pw_init_db () {
try_copy_file "${PW_FIND_DB_FILE}" "${portwine_exe}".ppdb try_copy_file "${PW_FIND_DB_FILE}" "${portwine_exe}".ppdb
PORTWINE_DB_FILE="${portwine_exe}".ppdb PORTWINE_DB_FILE="${portwine_exe}".ppdb
if echo "${portwine_exe}" | grep "/prefixes/" &>/dev/null ; then if echo "${portwine_exe}" | grep "/prefixes/" &>/dev/null ; then
if [[ -z $(lsbash "${PORT_WINE_PATH}/prefixes/" --grep ^"${PW_PREFIX_NAME}"$) ]] \ if [[ -z $(ls "${PORT_WINE_PATH}/prefixes/" | grep -e ^"${PW_PREFIX_NAME}"$) ]] \
|| [[ -z $(grep -e ^"export PW_PREFIX_NAME=" "${PORTWINE_DB_FILE}" 2>/dev/null) ]] || [[ -z $(grep -e ^"export PW_PREFIX_NAME=" "${PORTWINE_DB_FILE}" 2>/dev/null) ]]
then then
PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}') PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}')
...@@ -2444,7 +2445,7 @@ pw_init_db () { ...@@ -2444,7 +2445,7 @@ pw_init_db () {
if [[ "${PW_WINE_CPU_TOPOLOGY}" == "disabled" ]] && [[ -n "${WINE_CPU_TOPOLOGY}" ]] ; then if [[ "${PW_WINE_CPU_TOPOLOGY}" == "disabled" ]] && [[ -n "${WINE_CPU_TOPOLOGY}" ]] ; then
export PW_WINE_CPU_TOPOLOGY="${WINE_CPU_TOPOLOGY}" export PW_WINE_CPU_TOPOLOGY="${WINE_CPU_TOPOLOGY}"
fi fi
if lsbash "${PATH_TO_GAME}"/*_Data/Resources/ --grep "unity" &>/dev/null \ if ls "${PATH_TO_GAME}"/*_Data/Resources/ 2>/dev/null | grep "unity" &>/dev/null \
&& [[ "${PW_WINE_CPU_TOPOLOGY}" == "disabled" ]] \ && [[ "${PW_WINE_CPU_TOPOLOGY}" == "disabled" ]] \
&& [[ $(grep -c ^"processor" /proc/cpuinfo) -gt "8" ]] && [[ $(grep -c ^"processor" /proc/cpuinfo) -gt "8" ]]
then then
......
...@@ -120,15 +120,14 @@ echo "" > "${PW_TMPFS_PATH}/tmp_yad_form" ...@@ -120,15 +120,14 @@ echo "" > "${PW_TMPFS_PATH}/tmp_yad_form"
echo "" > "${PW_TMPFS_PATH}/tmp_yad_form_vulkan" echo "" > "${PW_TMPFS_PATH}/tmp_yad_form_vulkan"
create_new_dir "${PORT_WINE_PATH}/data/dist" create_new_dir "${PORT_WINE_PATH}/data/dist"
pushd "${PORT_WINE_PATH}/data/dist/" 1>/dev/null || fatal IFS=$'\n'
for dist_dir in ./* ; do for dist_dir in $(ls -1 "${PORT_WINE_PATH}/data/dist") ; do
[[ -d "$dist_dir" ]] || continue dist_dir_new=$(echo "${dist_dir}" | awk '$1=$1' | sed -e s/[[:blank:]]/_/g)
dist_dir_new="${dist_dir//[[:blank:]]/_}"
if [[ ! -d "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}" ]] ; then 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^^}" mv -- "${PORT_WINE_PATH}/data/dist/$dist_dir" "${PORT_WINE_PATH}/data/dist/${dist_dir_new^^}"
fi fi
done done
popd 1>/dev/null || fatal IFS="$orig_IFS"
create_new_dir "${PORT_WINE_PATH}/data/prefixes/DEFAULT" create_new_dir "${PORT_WINE_PATH}/data/prefixes/DEFAULT"
create_new_dir "${PORT_WINE_PATH}/data/prefixes/DOTNET" create_new_dir "${PORT_WINE_PATH}/data/prefixes/DOTNET"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment