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
4ee7af09
Commit
4ee7af09
authored
Oct 28, 2024
by
Vladislav
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added disabled stat func
parent
629f50e0
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
11 deletions
+17
-11
functions_helper
data_from_portwine/scripts/functions_helper
+17
-11
No files found.
data_from_portwine/scripts/functions_helper
View file @
4ee7af09
...
...
@@ -849,8 +849,7 @@ debug_timer () {
# Поиск нужного .desktop файла по $portwine_exe (для показа в комментариях нужного времени)
# Параллельное создание базы по времени после завершения приложения
search_desktop_file
()
{
local
desktop_file desktop_file_new line1 line2 line3 line4 count_line i
local
EXEC_DESKTOP TIME_TOTAL BROKEN_LINE FILE_SHA256SUM_ARRAY FILE_SHA256SUM_FOUND FILE_SHA256SUM_NOT_FOUND SKIP_REPAIR
local
desktop_file desktop_file_new line1 line2 FILE_SHA256SUM_ARRAY EXEC_DESKTOP BROKEN_LINE FILE_SHA256SUM_FOUND FILE_SHA256SUM_NOT_FOUND
if
[[
-z
$FILE_SHA256SUM
]]
;
then
read
-r
-a
FILE_SHA256SUM_ARRAY < <
(
sha256sum
"
$portwine_exe
"
)
FILE_SHA256SUM
=
${
FILE_SHA256SUM_ARRAY
[0]
}
...
...
@@ -869,6 +868,10 @@ search_desktop_file () {
fi
fi
done < "
$desktop_file
"
if [[
$portwine_exe
== "
${
EXEC_DESKTOP
//\
"/}"
]] ; then
DESKTOP_CORRECT_FILE=
"
$desktop_file
"
fi
if [[
$DESKTOP_WITH_TIME
== enabled ]] || [[
$SORT_WITH_TIME
== enabled ]] ; then
while IFS=
" "
read -r -a line2 ; do
if [[ -z
${
line2
[0]
}
]] \
|| [[ !
${
line2
[0]
}
=~ (.[Bb][Aa][Tt]
$|
.[Ee][Xx][Ee]
$|
.[Mm][Ss][Ii]
$|
.[Rr][Ee][Gg]
$)
]] ; then
...
...
@@ -883,27 +886,26 @@ search_desktop_file () {
FILE_SHA256SUM_NOT_FOUND=1
fi
done <
"
$PORT_WINE_TMP_PATH
/statistics"
if [[
$portwine_exe
== "
${
EXEC_DESKTOP
//\
"/}"
]] ; then
DESKTOP_CORRECT_FILE=
"
$desktop_file
"
fi
fi
fi
done
IFS=
"
$orig_IFS
"
if [[
$DESKTOP_WITH_TIME
== enabled ]] || [[
$SORT_WITH_TIME
== enabled ]] ; then
local line3 line4 count_line i TIME_TOTAL SKIP_REPAIR
## Ремонты
:
# Когда приложения ещё нет в статистике
[[ -z
${
line2
[2]
}
]] && line2[2]=0
## TODO
:
ремонтирует devel пр с entry point потом можно будет это дропнуть
# Ремонт, проверяет чтобы длинна хеш суммы была равна 64 символам, в ином случае удалит битые
if [[
$FILE_SHA256SUM_NOT_FOUND
== 1 ]] && [[
${#
line2
[1]
}
!=
"64"
]] ; then
while IFS=
" "
read -r -a line3 ; do
if [[
${#
line3
[1]
}
==
"64"
]]
then echo
"
${
line3
[*]
}
"
fi
done <
"
$PORT_WINE_TMP_PATH
/statistics"
>
"
$PORT_WINE_TMP_PATH
/statistics_repair"
IFS=
"
$orig_IFS
"
try_remove_file
"
$PORT_WINE_TMP_PATH
/statistics"
mv -f
"
$PORT_WINE_TMP_PATH
/statistics_repair"
"
$PORT_WINE_TMP_PATH
/statistics"
return 0
search_desktop_file
fi
# Ремонт, если есть пустые строки и непонятные строки без .exe, .bat, .msi, .reg
...
...
@@ -913,9 +915,10 @@ search_desktop_file () {
then echo
"
${
line4
[*]
}
"
fi
done <
"
$PORT_WINE_TMP_PATH
/statistics"
>
"
$PORT_WINE_TMP_PATH
/statistics_repair"
IFS=
"
$orig_IFS
"
try_remove_file
"
$PORT_WINE_TMP_PATH
/statistics"
mv -f
"
$PORT_WINE_TMP_PATH
/statistics_repair"
"
$PORT_WINE_TMP_PATH
/statistics"
return 0
search_desktop_file
fi
# Ремонтирует путь на новый, если вдруг путь до .exe файла битый или изменился, но .exe файл он опознал
...
...
@@ -930,6 +933,8 @@ search_desktop_file () {
line2[1]=
$FILE_SHA256SUM
fi
# Когда приложения ещё нет в статистике
[[ -z
${
line2
[2]
}
]] && line2[2]=0
# Ремонт, если сломалось время
if [[ !
${
line2
[2]
}
=~ [0-9]+ ]] || (( line2[2] >= 999999999 )) ; then
sed -i
"s|
${
line2
[1]
}
${
line2
[2]
}
|
${
line2
[1]
}
0|"
"
$PORT_WINE_TMP_PATH
/statistics"
...
...
@@ -958,7 +963,7 @@ search_desktop_file () {
echo
"
${
portwine_exe
// /#@_@#
}
$FILE_SHA256SUM
$TIME_TOTAL
OLD_DESKTOP"
>>
"
$PORT_WINE_TMP_PATH
/statistics"
fi
count_line=4
# Здесь добавляются новые линии для статистики
# Здесь добавляются новые линии для статистики (L4-) важен
if [[ -z
${
line2
[4]
}
]] ; then
SKIP_REPAIR=1
sed -i
"s|
$FILE_SHA256SUM
\(
.*
\)
|
$FILE_SHA256SUM
\1
L4-1|"
"
$PORT_WINE_TMP_PATH
/statistics"
...
...
@@ -996,7 +1001,8 @@ search_desktop_file () {
sed -i
"s|
${
portwine_exe
// /#@_@#
}
$FILE_SHA256SUM
\(
.*
\)
|
${
line2
[*]
}
|"
"
$PORT_WINE_TMP_PATH
/statistics"
fi
# Сюда все sedы от L4, L5 и т.д. (после всех ремонтов)
sed -i
"s|
$FILE_SHA256SUM
\(
.*
\)
L4-
${
line2
[4]
}
|
$FILE_SHA256SUM
\1
L4-
$NUMBER_OF_STARTS
|"
"
$PORT_WINE_TMP_PATH
/statistics"
sed -i
"s|
$FILE_SHA256SUM
\(
.*
\)
${
line2
[4]
}
|
$FILE_SHA256SUM
\1
L4-
$NUMBER_OF_STARTS
|"
"
$PORT_WINE_TMP_PATH
/statistics"
fi
fi
fi
}
...
...
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