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
Vladislav
PortWINE
Commits
eecab254
Commit
eecab254
authored
Sep 27, 2024
by
Mikhail Tergoev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added pw_check_command func
parent
853b34d5
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
34 deletions
+27
-34
functions_helper
data_from_portwine/scripts/functions_helper
+27
-34
No files found.
data_from_portwine/scripts/functions_helper
View file @
eecab254
...
...
@@ -1896,47 +1896,40 @@ pw_port_update () {
return 0
}
pw_skip_update () {
if command -v gamescope &>/dev/null ; then
if ! timeout 3 gamescope --help &> "${PW_TMPFS_PATH}/gamescope.tmp" ; then
print_error "gamescope - broken!"
pw_check_command () {
local S_CMD="${1//" "*/}"
local F_CMD="$1"
[[ -z "$TIMEOUT_CMD" ]] && TIMEOUT_CMD="3"
if command -v "$S_CMD" &>/dev/null ; then
if ! timeout "$TIMEOUT_CMD" $F_CMD &> "${PW_TMPFS_PATH}/$S_CMD.tmp" ; then
print_error "$S_CMD - broken!"
unset TIMEOUT_CMD
return 1
else
print_info "$S_CMD - found"
unset TIMEOUT_CMD
return 0
fi
else
print_warning "gamescope - not found!"
print_warning "$S_CMD - not found!"
unset TIMEOUT_CMD
return 1
fi
}
export -f pw_check_command
if command -v vulkaninfo &>/dev/null ; then
if ! timeout 3 vulkaninfo &> "${PW_TMPFS_PATH}/vulkaninfo.tmp" ; then
print_error "vulkaninfo - broken!"
fi
else
pw_skip_update () {
for f_cmd in "gamescope --help" "lspci -k" "xrandr --current" "locale -a"
do pw_check_command "$f_cmd"
done
TIMEOUT_CMD="5"
if ! pw_check_command vulkaninfo ; then
print_warning "use portable vulkaninfo"
"$PW_PLUGINS_PATH"/portable/bin/x86_64-linux-gnu-vulkaninfo &> "${PW_TMPFS_PATH}/vulkaninfo.tmp"
fi
if command -v lspci &>/dev/null ; then
if ! timeout 3 lspci -k &> "${PW_TMPFS_PATH}/lspci.tmp" ; then
print_error "lspci - broken!"
fi
else
print_warning "lspci - not found!"
fi
if command -v xrandr &>/dev/null ; then
if ! timeout 3 xrandr --current &> "${PW_TMPFS_PATH}/xrandr.tmp" ; then
print_error "xrandr - broken!"
fi
else
print_warning "xrandr - not found!"
fi
if command -v locale &>/dev/null ; then
if ! timeout 3 locale -a &> "${PW_TMPFS_PATH}/locale.tmp" ; then
print_error "locale - broken!"
fi
else
print_warning "locale - not found!"
fi
}
pw_skip_update_new () {
...
...
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