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
1ff1ee96
Commit
1ff1ee96
authored
6 years ago
by
Simon McVittie
Browse files
Options
Downloads
Patches
Plain Diff
run: Add separate lists for apt sources and apt keyrings
Signed-off-by:
Simon McVittie
<
smcv@collabora.com
>
parent
77d9c725
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
run.py
+94
-57
94 additions, 57 deletions
run.py
with
94 additions
and
57 deletions
run.py
+
94
−
57
View file @
1ff1ee96
...
...
@@ -84,6 +84,37 @@ _DEBOS_BASE_RECIPE = os.path.join(
_DEBOS_RUNTIMES_RECIPE
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
'
flatdeb
'
,
'
debos-runtimes.yaml
'
)
class
AptSource
:
def
__init__
(
self
,
kind
,
uri
,
suite
,
components
=
(
'
main
'
,),
trusted
=
False
):
self
.
kind
=
kind
self
.
uri
=
uri
self
.
suite
=
suite
self
.
components
=
components
self
.
trusted
=
trusted
def
__str__
(
self
):
if
self
.
trusted
:
maybe_options
=
'
[trusted=yes]
'
else
:
maybe_options
=
''
return
'
%s%s %s %s %s
'
%
(
self
.
kind
,
maybe_options
,
self
.
uri
,
self
.
suite
,
'
'
.
join
(
self
.
components
),
)
class
Builder
:
"""
...
...
@@ -118,6 +149,8 @@ class Builder:
self
.
export_bundles
=
False
self
.
sources_required
=
set
()
self
.
strip_source_version_suffix
=
None
self
.
apt_keyrings
=
[]
self
.
apt_sources
=
[]
self
.
logger
=
logger
.
getChild
(
'
Builder
'
)
...
...
@@ -334,6 +367,38 @@ class Builder:
self
.
strip_source_version_suffix
=
self
.
suite_details
.
get
(
'
strip_source_version_suffix
'
,
''
)
for
source
in
self
.
suite_details
[
'
sources
'
]:
keyring
=
source
.
get
(
'
keyring
'
)
if
keyring
is
not
None
:
self
.
apt_keyrings
.
append
(
keyring
)
uri
=
source
[
'
apt_uri
'
]
suite
=
source
.
get
(
'
apt_suite
'
,
self
.
apt_suite
)
suite
=
suite
.
replace
(
'
*
'
,
self
.
apt_suite
)
components
=
source
.
get
(
'
apt_components
'
,
self
.
suite_details
.
get
(
'
apt_components
'
,
[
'
main
'
])
)
trusted
=
source
.
get
(
'
apt_trusted
'
,
False
)
if
source
.
get
(
'
deb
'
,
True
):
self
.
apt_sources
.
append
(
AptSource
(
'
deb
'
,
uri
,
suite
,
components
=
components
,
trusted
=
trusted
,
))
if
source
.
get
(
'
deb-src
'
,
True
):
self
.
apt_sources
.
append
(
AptSource
(
'
deb-src
'
,
uri
,
suite
,
components
=
components
,
trusted
=
trusted
,
))
if
self
.
apt_sources
[
0
].
kind
!=
'
deb
'
:
parser
.
error
(
'
First apt source must provide .deb packages
'
)
getattr
(
self
,
'
command_
'
+
args
.
command
.
replace
(
'
-
'
,
'
_
'
))(
**
vars
(
args
))
...
...
@@ -342,8 +407,8 @@ class Builder:
@property
def
apt_uris
(
self
):
for
source
in
self
.
suite_details
[
'
sources
'
]
:
yield
source
[
'
apt_
uri
'
]
for
source
in
self
.
apt_
sources
:
yield
source
.
uri
def
ensure_build_area
(
self
):
os
.
makedirs
(
self
.
xdg_cache_dir
,
0o700
,
exist_ok
=
True
)
...
...
@@ -357,9 +422,8 @@ class Builder:
)
self
.
ensure_build_area
()
apt_suite
=
self
.
suite_details
[
'
sources
'
][
0
].
get
(
'
apt_suite
'
,
self
.
apt_suite
)
# debootstrap only supports one suite, so we use the first
apt_suite
=
self
.
apt_sources
[
0
].
suite
dest_recipe
=
os
.
path
.
join
(
scratch
,
'
flatdeb.yaml
'
)
shutil
.
copyfile
(
_DEBOS_BASE_RECIPE
,
dest_recipe
)
...
...
@@ -417,7 +481,7 @@ class Builder:
'
-t
'
,
'
architecture:{}
'
.
format
(
self
.
primary_dpkg_arch
),
'
-t
'
,
'
suite:{}
'
.
format
(
apt_suite
),
'
-t
'
,
'
mirror:{}
'
.
format
(
self
.
suite_details
[
'
sources
'
]
[
0
]
[
'
apt_
uri
'
]
,
self
.
apt_
sources
[
0
]
.
uri
,
),
'
-t
'
,
'
ospack:{}
'
.
format
(
tarball
+
'
.new
'
),
'
-t
'
,
'
manifest_prefix:base-{}-{}
'
.
format
(
...
...
@@ -434,9 +498,7 @@ class Builder:
),
]
keyring
=
self
.
suite_details
[
'
sources
'
][
0
].
get
(
'
keyring
'
)
if
keyring
is
not
None
:
for
keyring
in
self
.
apt_keyrings
:
if
os
.
path
.
exists
(
os
.
path
.
join
(
'
suites
'
,
keyring
)):
keyring
=
os
.
path
.
join
(
'
suites
'
,
keyring
)
elif
os
.
path
.
exists
(
keyring
):
...
...
@@ -459,10 +521,12 @@ class Builder:
os
.
path
.
basename
(
keyring
),
)
)
else
:
keyring
=
''
components
=
self
.
suite_details
.
get
(
'
apt_components
'
,
[
'
main
'
])
# debootstrap only supports one keyring and one apt source,
# so we take the first one
break
components
=
self
.
apt_sources
[
0
].
components
if
components
:
argv
.
append
(
'
-t
'
)
...
...
@@ -773,52 +837,25 @@ class Builder:
'
w
'
,
encoding
=
'
utf-8
'
)
as
writer
:
for
source
in
self
.
suite_details
[
'
sources
'
]:
suite
=
source
.
get
(
'
apt_suite
'
,
self
.
apt_suite
)
suite
=
suite
.
replace
(
'
*
'
,
self
.
apt_suite
)
components
=
source
.
get
(
'
apt_components
'
,
self
.
suite_details
.
get
(
'
apt_components
'
,
[
'
main
'
]))
options
=
[]
if
source
.
get
(
'
apt_trusted
'
,
False
):
options
.
append
(
'
trusted=yes
'
)
if
options
:
options_str
=
'
[
'
+
'
'
.
join
(
options
)
+
'
]
'
for
source
in
self
.
apt_sources
:
writer
.
write
(
'
{}
\n
'
.
format
(
source
))
for
keyring
in
self
.
apt_keyrings
:
if
os
.
path
.
exists
(
os
.
path
.
join
(
'
suites
'
,
keyring
)):
keyring
=
os
.
path
.
join
(
'
suites
'
,
keyring
)
elif
os
.
path
.
exists
(
keyring
):
pass
else
:
options_str
=
''
for
prefix
in
(
'
deb
'
,
'
deb-src
'
):
writer
.
write
(
'
{}{} {} {} {}
\n
'
.
format
(
prefix
,
options_str
,
source
[
'
apt_uri
'
],
suite
,
'
'
.
join
(
components
),
))
keyring
=
source
.
get
(
'
keyring
'
)
if
keyring
is
not
None
:
if
os
.
path
.
exists
(
os
.
path
.
join
(
'
suites
'
,
keyring
)):
keyring
=
os
.
path
.
join
(
'
suites
'
,
keyring
)
elif
os
.
path
.
exists
(
keyring
):
pass
else
:
raise
RuntimeError
(
'
Cannot open {}
'
.
format
(
keyring
))
shutil
.
copyfile
(
os
.
path
.
abspath
(
keyring
),
os
.
path
.
join
(
overlay
,
'
etc
'
,
'
apt
'
,
'
trusted.gpg.d
'
,
os
.
path
.
basename
(
keyring
),
),
)
raise
RuntimeError
(
'
Cannot open {}
'
.
format
(
keyring
))
shutil
.
copyfile
(
os
.
path
.
abspath
(
keyring
),
os
.
path
.
join
(
overlay
,
'
etc
'
,
'
apt
'
,
'
trusted.gpg.d
'
,
os
.
path
.
basename
(
keyring
),
),
)
def
create_flatpak_manifest_overlay
(
self
,
...
...
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