revert: lsbash to ls
This commit is contained in:
parent
c784add1e2
commit
7cfd56f98e
@ -410,6 +410,7 @@ lsbash () {
|
||||
else
|
||||
directory=$PWD
|
||||
fi
|
||||
|
||||
grep_find_file1 () {
|
||||
find_file_old=$find_file
|
||||
if [[ $grep_with_i == true ]] ; then
|
||||
@ -1624,7 +1625,7 @@ init_wine_ver () {
|
||||
else
|
||||
if [[ -d "${PORT_WINE_PATH}/data/dist" ]] ; then
|
||||
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)
|
||||
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^^}"
|
||||
@ -1632,7 +1633,7 @@ init_wine_ver () {
|
||||
done
|
||||
IFS="$orig_IFS"
|
||||
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* ]]
|
||||
then export PW_WINE_USE=PROTON_LG
|
||||
else export PW_WINE_USE=WINE_LG
|
||||
@ -1649,20 +1650,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 $(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"
|
||||
done
|
||||
mv -f "${WINEDIR}/files"/* "${WINEDIR}/"
|
||||
rm -fr "${WINEDIR}/files"
|
||||
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"
|
||||
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 $(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"
|
||||
done
|
||||
fi
|
||||
@ -1951,7 +1952,7 @@ pw_kill_autostart () {
|
||||
fi
|
||||
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
|
||||
fi
|
||||
|
||||
@ -2042,8 +2043,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 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}")
|
||||
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}")
|
||||
do try_remove_dir "${PORT_WINE_TMP_PATH}/${RM_LIBS}"
|
||||
done
|
||||
fi
|
||||
@ -2193,9 +2194,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 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
|
||||
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}"
|
||||
done
|
||||
fi
|
||||
@ -2226,9 +2227,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 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
|
||||
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}"
|
||||
done
|
||||
fi
|
||||
@ -2355,7 +2356,7 @@ pw_init_db () {
|
||||
# shellcheck source=/dev/null
|
||||
source "${PORTWINE_DB_FILE}"
|
||||
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) ]]
|
||||
then
|
||||
PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}')
|
||||
@ -2395,7 +2396,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 $(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) ]]
|
||||
then
|
||||
PW_PREFIX_NAME=$(echo "${portwine_exe}" | awk -F"/prefixes/" '{print $2}' | awk -F"/" '{print $1}')
|
||||
@ -2444,7 +2445,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 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" ]] \
|
||||
&& [[ $(grep -c ^"processor" /proc/cpuinfo) -gt "8" ]]
|
||||
then
|
||||
|
@ -120,15 +120,14 @@ echo "" > "${PW_TMPFS_PATH}/tmp_yad_form"
|
||||
echo "" > "${PW_TMPFS_PATH}/tmp_yad_form_vulkan"
|
||||
|
||||
create_new_dir "${PORT_WINE_PATH}/data/dist"
|
||||
pushd "${PORT_WINE_PATH}/data/dist/" 1>/dev/null || fatal
|
||||
for dist_dir in ./* ; do
|
||||
[[ -d "$dist_dir" ]] || continue
|
||||
dist_dir_new="${dist_dir//[[:blank:]]/_}"
|
||||
IFS=$'\n'
|
||||
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)
|
||||
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^^}"
|
||||
fi
|
||||
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/DOTNET"
|
||||
|
Loading…
Reference in New Issue
Block a user