Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
PortWINE
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Mikhail Tergoev
PortWINE
Commits
76ebfaaa
Commit
76ebfaaa
authored
Nov 11, 2024
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added grep -v
parent
50ff3751
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
74 additions
and
41 deletions
+74
-41
functions_helper
data_from_portwine/scripts/functions_helper
+65
-33
start.sh
data_from_portwine/scripts/start.sh
+9
-8
No files found.
data_from_portwine/scripts/functions_helper
View file @
76ebfaaa
...
...
@@ -407,32 +407,65 @@ try_copy_file_with_checksums () {
export -f try_copy_file_with_checksums
lsbash () {
local grep_with_i
find_name directory find_file found_successfully find_file_old
local grep_with_i
grep_with_v find_name directory find_file found_successfully find_file_old find_file_old_array
if [[
$1
=~
\/
]] ; then
directory=
$1
; shift
else
directory=
$PWD
fi
if [[
$1
== --grep ]] ; then
shift
# аналог grep -i
if [[
$1
== "
-i
" ]] ; then
grep_with_i=true ; shift
fi
find_name=
$1
fi
for find_file in "
$directory
"/* ; do
find_file=
${
find_file
//*\//
}
grep_find_file1 () {
find_file_old=
$find_file
if [[
$grep_with_i
== true ]] ; then
find_file=
${
find_file
,,
}
find_name=
${
find_name
,,
}
fi
if [[
$find_file
=~
$find_name
]]
\
|| [[ -z
$find_name
]] ; then
echo "
$find_file_old
"
found_successfully=1
grep_find_file2 () {
if [[ -z
$1
]] ; then
echo "
$find_file_old
"
found_successfully=1
else
find_file_old_array+=("
$find_file_old
")
fi
}
if [[
$grep_with_v
== true ]] ; then
if [[ !
$find_file
=~
$find_name
]] ; then
grep_find_file2 "
$@
"
fi
else
if [[
$find_file
=~
$find_name
]]
\
|| [[ -z
$find_name
]] ; then
grep_find_file2 "
$@
"
fi
fi
}
while true ; do
unset grep_with_i grep_with_v
if [[
$1
== --grep ]] ; then
shift
while true ; do
# аналог grep -i
if [[
$1
== "
-i
" ]] ; then
grep_with_i=true ; shift ; continue
fi
# аналог grep -v
if [[
$1
== "
-v
" ]] ; then
grep_with_v=true ; shift ; continue
fi
find_name=
$1
; shift ; break
done
fi
if [[ -n
${
find_file_old_array
[0]
}
]] ; then
for find_file in "
${
find_file_old_array
[@]
}
" ; do
unset find_file_old_array
grep_find_file1 "
$@
"
done
else
for find_file in "
$directory
"/* ; do
find_file=
${
find_file
//*\//
}
grep_find_file1 "
$@
"
done
fi
if [[ -n
$1
]] ; then continue ; else break ; fi
done
if [[
$found_successfully
== 1 ]] ; then
return 0
...
...
@@ -1429,7 +1462,7 @@ restart_pp () {
--userconf
)
export
RESTART_PP_USED
=
"userconf"
;;
--edit_db
)
export
RESTART_PP_USED
=
"edit_db"
;;
esac
/usr/bin/env bash
-c
${
pw_full_command_line
[@]
}
&
/usr/bin/env bash
-c
"
${
pw_full_command_line
[@]
}
"
&
exit
0
}
...
...
@@ -1938,8 +1971,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
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
...
...
@@ -2089,9 +2122,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
lsbash
"
${
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
$(
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
...
...
@@ -2122,9 +2155,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
lsbash
"
${
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
$(
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
...
...
@@ -6044,16 +6077,15 @@ pw_auto_create_shortcut () {
fi
unset
LINKS
for
link_file
in
"
${
PORT_WINE_PATH
}
"
/data/prefixes/
*
/drive_c/users/
*
/Desktop/
*
.lnk
do
link_file
=
$(
readlink
-f
"
${
link_file
}
"
)
IFS
=
' '
read
-r
-a
LINKS
<<<
"
${
LINKS
[*]
}
${
link_file
// /@_@
}
"
for
link_file
in
"
${
PORT_WINE_PATH
}
"
/data/prefixes/
*
/drive_c/users/
*
/Desktop/
*
.lnk
;
do
link_file
=
$(
readlink
-f
"
$link_file
"
)
LINKS+
=(
"
${
link_file
// /#@_@#
}
"
)
done
[[
-z
"
${
LINKS
[0]
}
"
]]
&&
return
0
IFS
=
' '
read
-r
-a
SORTED_LINKS
<<<
"
$(
echo
"
${
LINKS
[@]
}
"
|
tr
' '
'\n'
|
sort
-u
|
tr
'\n'
' '
)
"
for
link_file
in
"
${
SORTED_LINKS
[@]//
@_@
/
}
"
;
do
for
link_file
in
"
${
SORTED_LINKS
[@]//
#@_@#
/
}
"
;
do
if
command
-v
exiftool &>/dev/null
;
then
if
timeout
3 exiftool
"
$link_file
"
&>
"
${
PW_TMPFS_PATH
}
/exiftool.tmp"
;
then
prefix_name
=
$(
echo
"
$link_file
"
|
awk
-F
"/prefixes/"
'{print $2}'
|
awk
-F
"/"
'{print $1}'
)
...
...
@@ -6147,22 +6179,22 @@ portwine_change_shortcut () {
portwine_search_shortcut
()
{
unset
PW_DELETE_SHORTCUT_MENU PW_DELETE_SHORTCUT_DESKTOP
PW_DELETE_MENU
=
"
$(
grep
-il
"
${
portwine_exe
}
"
"
${
HOME
}
/.local/share/applications"
/
*
.desktop 2>/dev/null
)
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_MENU
<<<
"
${
PW_DELETE_SHORTCUT_MENU
[*]
}
${
PW_DELETE_MENU
// /@_@
}
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_MENU
<<<
"
${
PW_DELETE_SHORTCUT_MENU
[*]
}
${
PW_DELETE_MENU
// /#@_@#
}
"
PW_DELETE_PP
=
"
$(
grep
-il
"
${
portwine_exe
}
"
"
${
PORT_WINE_PATH
}
"
/
*
.desktop 2>/dev/null
)
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_MENU
<<<
"
${
PW_DELETE_SHORTCUT_MENU
[*]
}
${
PW_DELETE_PP
// /@_@
}
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_MENU
<<<
"
${
PW_DELETE_SHORTCUT_MENU
[*]
}
${
PW_DELETE_PP
// /#@_@#
}
"
if
[[
-d
"
${
HOME
}
/Desktop"
]]
;
then
PW_DELETE_DESKTOP
=
"
$(
grep
-il
"
${
portwine_exe
}
"
"
${
HOME
}
/Desktop"
/
*
.desktop 2>/dev/null
)
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_DESKTOP
<<<
"
${
PW_DELETE_SHORTCUT_DESKTOP
[*]
}
${
PW_DELETE_DESKTOP
// /@_@
}
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_DESKTOP
<<<
"
${
PW_DELETE_SHORTCUT_DESKTOP
[*]
}
${
PW_DELETE_DESKTOP
// /#@_@#
}
"
fi
if
[[
-d
"
${
HOME
}
/Рабочий стол"
]]
;
then
PW_DELETE_DESKTOP
=
"
$(
grep
-il
"
${
portwine_exe
}
"
"
${
HOME
}
/Рабочий стол"
/
*
.desktop 2>/dev/null
)
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_DESKTOP
<<<
"
${
PW_DELETE_SHORTCUT_DESKTOP
[*]
}
${
PW_DELETE_DESKTOP
// /@_@
}
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_DESKTOP
<<<
"
${
PW_DELETE_SHORTCUT_DESKTOP
[*]
}
${
PW_DELETE_DESKTOP
// /#@_@#
}
"
fi
if
[[
$(
xdg-user-dir DESKTOP
)
]]
;
then
PW_DELETE_DESKTOP
=
"
$(
grep
-il
"
${
portwine_exe
}
"
"
$(
xdg-user-dir DESKTOP
)
"
/
*
.desktop 2>/dev/null
)
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_DESKTOP
<<<
"
${
PW_DELETE_SHORTCUT_DESKTOP
[*]
}
${
PW_DELETE_DESKTOP
// /@_@
}
"
read
-r
-d
''
-a
PW_DELETE_SHORTCUT_DESKTOP
<<<
"
${
PW_DELETE_SHORTCUT_DESKTOP
[*]
}
${
PW_DELETE_DESKTOP
// /#@_@#
}
"
fi
}
...
...
@@ -6173,7 +6205,7 @@ portwine_delete_shortcut () {
unset
PORTWINE_CHANGE_SHORTCUT
for
delete_shortcut
in
"
${
PW_DELETE_SHORTCUT_MENU
[@]
}
"
"
${
PW_DELETE_SHORTCUT_DESKTOP
[@]
}
"
;
do
rm
-f
"
${
delete_shortcut
//
@_@
/
}
"
rm
-f
"
${
delete_shortcut
//
#@_@#
/
}
"
done
}
...
...
data_from_portwine/scripts/start.sh
View file @
76ebfaaa
...
...
@@ -643,9 +643,9 @@ else
done < "
$PORT_WINE_TMP_PATH
/statistics
"
if [[
$SORT_WITH_TIME
== enabled ]] && [[
${
line2
[3]
}
== NEW_DESKTOP ]] ; then
sed -i "
s
/
${
line2
[1]
}
${
line2
[2]
}
NEW_DESKTOP/
${
line2
[1]
}
${
line2
[2]
}
OLD_DESKTOP/
" "
$PORT_WINE_TMP_PATH
/statistics
"
IFS=' ' read -r -a PW_AMOUNT_NEW_DESKTOP <<< "
${
PW_AMOUNT_NEW_DESKTOP
[*]
}
$AMOUNT_GENERATE_BUTTONS
"
PW_AMOUNT_NEW_DESKTOP+=("
$AMOUNT_GENERATE_BUTTONS
")
else
IFS=' ' read -r -a PW_AMOUNT_OLD_DESKTOP <<< "
${
PW_AMOUNT_OLD_DESKTOP
[*]
}
$AMOUNT_GENERATE_BUTTONS
"
PW_AMOUNT_OLD_DESKTOP+=("
$AMOUNT_GENERATE_BUTTONS
")
fi
(( AMOUNT_GENERATE_BUTTONS++ ))
fi
...
...
@@ -771,14 +771,14 @@ else
done
<
"
$ai_file
"
AI_FILE
=
"
${
ai_file
//
"
$PORT_SCRIPTS_PATH
/pw_autoinstall/"
/
}
"
AI_FILE_CHECK
=
"
$AI_FILE
=
$AI_AMOUNT_ARRAY
"
IFS
=
' '
read
-r
-a
AI_FILE_ARRAY
<<<
"
${
AI_FILE_ARRAY
[*]
}
$AI_FILE
"
AI_FILE_ARRAY+
=(
"
$AI_FILE
"
)
if
[[
$AI_TOP_GAMES
=
~
${
AI_FILE_CHECK
//=*/
}
]]
;
then
IFS
=
' '
read
-r
-a
AI_TRUE_FILE
<<<
"
${
AI_TRUE_FILE
[*]
}
$AI_FILE_CHECK
"
AI_TRUE_FILE+
=(
"
$AI_FILE_CHECK
"
)
else
if
[[
${
AI_NAME
[
"
$AI_AMOUNT_ARRAY
"
]
}
=
~
\(
ENG
\)
]]
;
then
IFS
=
' '
read
-r
-a
AI_FILE_ENG
<<<
"
${
AI_FILE_ENG
[*]
}
$AI_AMOUNT_ARRAY
"
AI_FILE_ENG+
=(
"
$AI_AMOUNT_ARRAY
"
)
else
IFS
=
' '
read
-r
-a
AI_FILE_UNSORTED
<<<
"
${
AI_FILE_UNSORTED
[*]
}
$AI_AMOUNT_ARRAY
"
AI_FILE_UNSORTED+
=(
"
$AI_AMOUNT_ARRAY
"
)
fi
fi
((
AI_AMOUNT_ARRAY++
))
...
...
@@ -786,8 +786,9 @@ else
for
ai_sort
in
$AI_TOP_GAMES
;
do
if
[[
${
AI_TRUE_FILE
[*]
}
=
~
$ai_sort
]]
;
then
AI_TRUE_FILE_NEW
=(
${
AI_TRUE_FILE
[@]//
$ai_sort
=/
}
)
AI_FILE_SORTED+
=(
${
AI_TRUE_FILE_NEW
[@]//*=*/
}
)
AI_TRUE_FILE_NEW
=(
"
${
AI_TRUE_FILE
[@]//
$ai_sort
=/
}
"
)
AI_TRUE_FILE_NEW
=(
"
${
AI_TRUE_FILE_NEW
[*]//*=*/
}
"
)
AI_FILE_SORTED+
=(
"
${
AI_TRUE_FILE_NEW
[*]// /
}
"
)
fi
done
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment