Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
flatdeb-steam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steamrt
flatdeb-steam
Commits
e80b2ec1
Commit
e80b2ec1
authored
7 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
Improve Steam Runtime comparison
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
d4e860bd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compare-steam-runtime.py
+197
-40
197 additions, 40 deletions
compare-steam-runtime.py
with
197 additions
and
40 deletions
compare-steam-runtime.py
+
197
−
40
View file @
e80b2ec1
...
...
@@ -26,73 +26,230 @@
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
import
argparse
import
os
from
debian.debian_support
import
Version
import
yaml
def
main
(
packages
):
with
open
(
'
com.valvesoftware.SteamRuntime.yaml
'
)
as
reader
:
manifest
=
yaml
.
safe_load
(
reader
)
def
main
(
packages
,
*
,
manifest
=
None
,
steam
=
None
):
with
open
(
'
runtimes/com.valvesoftware.SteamRuntime.yaml
'
)
as
reader
:
source_manifest
=
yaml
.
safe_load
(
reader
)
print
(
'
---
'
)
missing_platform
=
set
()
missing_sdk
=
set
()
only_in_flatpak
=
set
()
only_in_steam
=
set
()
newer_in_flatpak
=
set
()
newer_in_steam
=
set
()
if
packages
is
not
None
:
print
(
'
comparing_packages_txt:
'
)
print
(
'
path:
'
+
packages
)
with
open
(
packages
,
'
r
'
)
as
reader
:
for
line
in
reader
:
line
=
line
.
strip
()
if
not
line
or
line
.
startswith
(
'
#
'
):
continue
tokens
=
line
.
split
()
source
=
tokens
[
0
]
binaries
=
tokens
[
1
:]
for
binary
in
binaries
:
if
(
binary
.
endswith
(
'
-dev
'
)
or
binary
.
endswith
(
'
-multidev
'
)
or
binary
.
endswith
(
'
-dbg
'
)
or
# Probably not intentionally in the user-facing Runtime?
# https://github.com/ValveSoftware/steam-runtime/issues/76
binary
.
endswith
(
'
-pic
'
)
or
# Probably not intentionally in the user-facing Runtime?
# https://github.com/ValveSoftware/steam-runtime/issues/77
binary
==
'
nvidia-cg-toolkit
'
):
if
binary
in
source_manifest
[
'
sdk
'
].
get
(
'
add_packages_multiarch
'
,
()):
continue
if
binary
in
source_manifest
[
'
sdk
'
][
'
add_packages
'
]:
continue
missing_sdk
.
add
(
binary
)
continue
if
binary
in
source_manifest
[
'
add_packages_multiarch
'
]:
continue
with
open
(
packages
,
'
r
'
)
as
reader
:
for
line
in
reader
:
line
=
line
.
strip
()
if
not
line
or
line
.
startswith
(
'
#
'
):
continue
tokens
=
line
.
split
()
source
=
tokens
[
0
]
binaries
=
tokens
[
1
:]
for
binary
in
binaries
:
if
(
binary
.
endswith
(
'
-dev
'
)
or
binary
.
endswith
(
'
-multidev
'
)
or
binary
.
endswith
(
'
-dbg
'
)
or
# Probably not intentionally in the user-facing Runtime?
# https://github.com/ValveSoftware/steam-runtime/issues/76
binary
.
endswith
(
'
-pic
'
)
or
# Probably not intentionally in the user-facing Runtime?
# https://github.com/ValveSoftware/steam-runtime/issues/77
binary
==
'
nvidia-cg-toolkit
'
):
if
binary
in
manifest
[
'
sdk
'
][
'
add_packages
'
]:
if
binary
in
source_manifest
[
'
add_packages
'
]:
continue
missing_sdk
.
add
(
binary
)
missing_platform
.
add
(
binary
)
if
missing_platform
:
print
(
'
missing_from_platform:
'
)
for
binary
in
sorted
(
missing_platform
):
print
(
'
-
'
+
binary
)
if
missing_sdk
:
print
(
'
missing_from_sdk:
'
)
for
binary
in
sorted
(
missing_sdk
):
print
(
'
-
'
+
binary
)
if
steam
is
None
:
steam
=
os
.
path
.
join
(
os
.
path
.
expanduser
(
'
~
'
),
'
.steam
'
,
'
steam
'
)
if
not
os
.
path
.
exists
(
steam
):
steam
=
None
steam_runtime
=
os
.
path
.
join
(
steam
,
'
ubuntu12_32
'
,
'
steam-runtime
'
)
if
not
os
.
path
.
exists
(
steam_runtime
):
steam_runtime
=
None
if
steam_runtime
is
not
None
and
manifest
is
not
None
:
print
(
'
comparing_steam_installation:
'
)
print
(
'
steam:
'
+
steam_runtime
)
print
(
'
manifest:
'
+
manifest
)
records
=
[]
with
open
(
manifest
,
'
r
'
)
as
reader
:
for
line
in
reader
:
if
line
.
strip
().
startswith
(
'
#
'
):
continue
if
binary
in
manifest
[
'
add_packages_multiarch
'
]:
if
not
line
.
strip
():
continue
records
.
append
(
line
.
split
(
'
\t
'
))
architectures
=
set
()
flatpak_versions
=
{}
primary
=
None
for
line
in
records
:
if
line
[
0
].
startswith
(
'
coreutils:
'
):
arch
=
line
[
0
].
split
(
'
:
'
,
1
)[
1
]
primary
=
arch
architectures
.
add
(
arch
)
elif
line
[
0
].
startswith
(
'
libc6:
'
):
arch
=
line
[
0
].
split
(
'
:
'
,
1
)[
1
]
architectures
.
add
(
arch
)
flatpak_versions
[
line
[
0
].
split
(
'
:
'
,
1
)[
0
]]
=
line
in_steam
=
set
()
only_in_flatpak
=
set
()
sources_only_in_flatpak
=
set
()
for
arch
in
architectures
:
contents
=
os
.
listdir
(
os
.
path
.
join
(
steam_runtime
,
arch
,
'
installed
'
))
for
name
in
contents
:
if
name
in
(
'
.
'
,
'
..
'
):
continue
if
binary
in
manifest
[
'
add_packages
'
]
:
if
name
.
endswith
(
'
.md5
'
)
:
continue
missing_platform
.
add
(
binary
)
binary
,
version
,
arch_
=
name
.
split
(
'
_
'
,
2
)
assert
arch_
in
(
arch
,
'
all
'
),
(
arch
,
name
)
in_steam
.
add
(
binary
)
flatpak_version
=
flatpak_versions
.
get
(
binary
)
if
flatpak_version
is
None
:
only_in_steam
.
add
(
binary
)
else
:
no_epoch_version
=
Version
(
flatpak_version
[
1
])
no_epoch_version
.
epoch
=
None
if
no_epoch_version
<
Version
(
version
):
newer_in_steam
.
add
(
(
binary
,
flatpak_version
[
1
],
version
,
arch
))
if
no_epoch_version
>
Version
(
version
):
newer_in_flatpak
.
add
(
(
binary
,
flatpak_version
[
1
],
version
,
arch
))
for
package
,
line
in
flatpak_versions
.
items
():
if
package
not
in
in_steam
:
source
=
line
[
2
]
or
package
if
'
(
'
in
source
:
source_version
=
source
.
split
(
'
(
'
,
1
)[
1
].
strip
(
'
)
'
)
else
:
source_version
=
line
[
1
]
only_in_flatpak
.
add
(
package
)
sources_only_in_flatpak
.
add
((
source
,
source_version
))
if
missing_platfor
m
:
print
(
'
Missing from platfor
m:
'
)
if
only_in_stea
m
:
print
(
'
only_in_stea
m:
'
)
for
binary
in
sorted
(
missing_platfor
m
):
print
(
'
-
'
+
binary
)
for
binary
in
sorted
(
only_in_stea
m
):
print
(
'
-
'
+
binary
)
if
missing_sd
k
:
print
(
'
Missing from sd
k:
'
)
if
only_in_flatpa
k
:
print
(
'
only_in_flatpa
k:
'
)
for
binary
in
sorted
(
missing_sd
k
):
print
(
'
-
'
+
binary
)
for
binary
in
sorted
(
only_in_flatpa
k
):
print
(
'
-
'
+
binary
)
if
missing_platform
or
missing_sdk
:
if
sources_only_in_flatpak
:
print
(
'
sources_only_in_flatpak:
'
)
for
source
in
sorted
(
sources_only_in_flatpak
):
print
(
'
- source:
'
+
source
[
0
])
print
(
'
source_version:
'
+
source
[
1
])
if
newer_in_flatpak
:
print
(
'
newer_in_flatpak:
'
)
for
binary
in
sorted
(
newer_in_flatpak
):
print
(
'
- package:
'
+
binary
[
0
])
print
(
'
in_flatpak:
'
+
binary
[
1
])
print
(
'
in_steam:
'
+
binary
[
2
])
print
(
'
architecture:
'
+
binary
[
3
])
if
newer_in_steam
:
print
(
'
newer_in_steam:
'
)
for
binary
in
sorted
(
newer_in_steam
):
print
(
'
- package:
'
+
binary
[
0
])
print
(
'
in_flatpak:
'
+
binary
[
1
])
print
(
'
in_steam:
'
+
binary
[
2
])
print
(
'
architecture:
'
+
binary
[
3
])
print
(
'
...
'
)
if
(
missing_platform
or
missing_sdk
or
only_in_flatpak
or
different_version
):
raise
SystemExit
(
1
)
if
__name__
==
'
__main__
'
:
parser
=
argparse
.
ArgumentParser
(
description
=
'
Compare Steam Runtime with official package list
'
)
parser
.
add_argument
(
'
--steam
'
,
metavar
=
'
STEAM
'
,
help
=
'
Path to ~/.steam/steam or ~/.local/share/Steam
'
,
)
parser
.
add_argument
(
'
--manifest
'
,
metavar
=
'
MANIFEST
'
,
help
=
'
Path to
'
'
~/.local/share/flatpak/runtime/
'
'
com.valvesoftware.SteamRuntime.Platform/
'
'
x86_64/scout_beta/active/files/manifest.dpkg or similar
'
,
)
parser
.
add_argument
(
'
packages
'
,
metavar
=
'
PACKAGES.TXT
'
,
help
=
'
Path to packages.txt from the Steam Runtime
'
,
)
args
=
parser
.
parse_args
()
main
(
args
.
packages
)
main
(
args
.
packages
,
manifest
=
args
.
manifest
,
steam
=
args
.
steam
)
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