Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
steam-runtime-tools
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
steam-runtime-tools
Commits
cde98f85
Commit
cde98f85
authored
5 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
system-info: Look for expectations in /usr/lib/steamrt by default
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
7a8e2c01
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!32
Auto-detect path to expectations
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
steam-runtime-tools/system-info.c
+31
-2
31 additions, 2 deletions
steam-runtime-tools/system-info.c
tests/system-info.c
+3
-3
3 additions, 3 deletions
tests/system-info.c
with
34 additions
and
5 deletions
steam-runtime-tools/system-info.c
+
31
−
2
View file @
cde98f85
...
@@ -75,6 +75,7 @@ struct _SrtSystemInfo
...
@@ -75,6 +75,7 @@ struct _SrtSystemInfo
{
{
/*< private >*/
/*< private >*/
GObject
parent
;
GObject
parent
;
/* "" if we have tried and failed to auto-detect */
gchar
*
expectations
;
gchar
*
expectations
;
Tristate
can_write_uinput
;
Tristate
can_write_uinput
;
/* (element-type Abi) */
/* (element-type Abi) */
...
@@ -347,6 +348,34 @@ library_compare (SrtLibrary *a, SrtLibrary *b)
...
@@ -347,6 +348,34 @@ library_compare (SrtLibrary *a, SrtLibrary *b)
return
g_strcmp0
(
srt_library_get_soname
(
a
),
srt_library_get_soname
(
b
));
return
g_strcmp0
(
srt_library_get_soname
(
a
),
srt_library_get_soname
(
b
));
}
}
static
gboolean
ensure_expectations
(
SrtSystemInfo
*
self
)
{
if
(
self
->
expectations
==
NULL
)
{
const
char
*
runtime
;
const
char
*
sysroot
=
"/"
;
gchar
*
def
;
runtime
=
g_getenv
(
"STEAM_RUNTIME"
);
if
(
runtime
!=
NULL
&&
runtime
[
0
]
==
'/'
)
sysroot
=
runtime
;
def
=
g_build_filename
(
sysroot
,
"usr"
,
"lib"
,
"steamrt"
,
"expectations"
,
NULL
);
if
(
g_file_test
(
def
,
G_FILE_TEST_IS_DIR
))
self
->
expectations
=
g_steal_pointer
(
&
def
);
else
self
->
expectations
=
g_strdup
(
""
);
g_free
(
def
);
}
return
self
->
expectations
[
0
]
!=
'\0'
;
}
/**
/**
* srt_system_info_check_libraries:
* srt_system_info_check_libraries:
* @self: The #SrtSystemInfo object to use.
* @self: The #SrtSystemInfo object to use.
...
@@ -384,7 +413,7 @@ srt_system_info_check_libraries (SrtSystemInfo *self,
...
@@ -384,7 +413,7 @@ srt_system_info_check_libraries (SrtSystemInfo *self,
g_return_val_if_fail
(
libraries_out
==
NULL
||
*
libraries_out
==
NULL
,
g_return_val_if_fail
(
libraries_out
==
NULL
||
*
libraries_out
==
NULL
,
SRT_LIBRARY_ISSUES_INTERNAL_ERROR
);
SRT_LIBRARY_ISSUES_INTERNAL_ERROR
);
if
(
self
->
expectations
==
NULL
)
if
(
!
ensure_
expectations
(
self
)
)
{
{
/* We don't know which libraries to check. */
/* We don't know which libraries to check. */
return
SRT_LIBRARY_ISSUES_UNKNOWN_EXPECTATIONS
;
return
SRT_LIBRARY_ISSUES_UNKNOWN_EXPECTATIONS
;
...
@@ -538,7 +567,7 @@ srt_system_info_check_library (SrtSystemInfo *self,
...
@@ -538,7 +567,7 @@ srt_system_info_check_library (SrtSystemInfo *self,
return
srt_library_get_issues
(
library
);
return
srt_library_get_issues
(
library
);
}
}
if
(
self
->
expectations
!=
NULL
)
if
(
ensure_
expectations
(
self
)
)
{
{
dir_path
=
g_build_filename
(
self
->
expectations
,
multiarch_tuple
,
NULL
);
dir_path
=
g_build_filename
(
self
->
expectations
,
multiarch_tuple
,
NULL
);
dir
=
g_dir_open
(
dir_path
,
0
,
&
error
);
dir
=
g_dir_open
(
dir_path
,
0
,
&
error
);
...
...
This diff is collapsed.
Click to expand it.
tests/system-info.c
+
3
−
3
View file @
cde98f85
...
@@ -623,9 +623,9 @@ wrong_expectations (Fixture *f,
...
@@ -623,9 +623,9 @@ wrong_expectations (Fixture *f,
return
;
return
;
}
}
/* Set the expectations folder to
NULL.
/* Set the expectations folder to
one that does not contain the
* We expect the library checks to fail. */
*
necessary files.
We expect the library checks to fail. */
info
=
srt_system_info_new
(
NULL
);
info
=
srt_system_info_new
(
"/dev"
);
issues
=
srt_system_info_check_libraries
(
info
,
issues
=
srt_system_info_check_libraries
(
info
,
_SRT_MULTIARCH
,
_SRT_MULTIARCH
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment