Commit 1435a5dc authored by Simon McVittie's avatar Simon McVittie

Allow building only Platform or only SDK

Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 7482785d
...@@ -66,15 +66,30 @@ actions: ...@@ -66,15 +66,30 @@ actions:
- action: run - action: run
label: copy manifest from platform label: copy manifest from platform
chroot: false chroot: false
command: 'echo; cp "$RECIPEDIR/manifest.dpkg.platform" "$ROOTDIR/usr"' command: |
set -e
echo
if [ -e "$RECIPEDIR/manifest.dpkg.platform" ]; then
cp "$RECIPEDIR/manifest.dpkg.platform" "$ROOTDIR/usr"
fi
- action: run - action: run
label: copy manifest from platform label: copy manifest from platform
chroot: false chroot: false
command: 'echo; cp "$RECIPEDIR/manifest.dpkg.built-using.platform" "$ROOTDIR/usr"' command: |
set -e
echo
if [ -e "$RECIPEDIR/manifest.dpkg.built-using.platform" ]; then
cp "$RECIPEDIR/manifest.dpkg.built-using.platform" "$ROOTDIR/usr"
fi
- action: run - action: run
label: copy manifest from platform label: copy manifest from platform
chroot: false chroot: false
command: 'echo; cp "$RECIPEDIR/manifest.platform.deb822.gz" "$ROOTDIR/usr"' command: |
set -e
echo
if [ -e "$RECIPEDIR/manifest.platform.deb822.gz" ]; then
cp "$RECIPEDIR/manifest.platform.deb822.gz" "$ROOTDIR/usr"
fi
{{ if and $debug_symbols $automatic_dbgsym }} {{ if and $debug_symbols $automatic_dbgsym }}
- action: run - action: run
label: collect-dbgsym label: collect-dbgsym
......
...@@ -243,6 +243,8 @@ class Builder: ...@@ -243,6 +243,8 @@ class Builder:
self.automatic_dbgsym = True self.automatic_dbgsym = True
self.collect_source_code = True self.collect_source_code = True
self.strict = False self.strict = False
self.do_platform = False
self.do_sdk = False
self.logger = logger.getChild('Builder') self.logger = logger.getChild('Builder')
...@@ -511,6 +513,24 @@ class Builder: ...@@ -511,6 +513,24 @@ class Builder:
help='Do not make various warnings fatal (default)', help='Do not make various warnings fatal (default)',
) )
parser.add_argument(
'--platform', action='store_true', default=None,
help='Build Platform image (default unless --sdk is used)',
)
parser.add_argument(
'--no-platform', action='store_false', dest='platform',
default=None,
help='Do not build Platform (default if --sdk is used)',
)
parser.add_argument(
'--sdk', action='store_true', default=None,
help='Build SDK image (default unless --platform is used)',
)
parser.add_argument(
'--no-sdk', action='store_false', dest='sdk', default=None,
help='Do not build SDK (default if --platform is used)',
)
subparser = subparsers.add_parser( subparser = subparsers.add_parser(
'base', 'base',
help='Build a fresh base tarball', help='Build a fresh base tarball',
...@@ -574,6 +594,23 @@ class Builder: ...@@ -574,6 +594,23 @@ class Builder:
self.ostree_mode = args.ostree_mode self.ostree_mode = args.ostree_mode
self.strict = args.strict self.strict = args.strict
if args.platform is None and args.sdk is None:
self.do_platform = True
self.do_sdk = True
elif args.sdk:
self.do_platform = bool(args.platform)
self.do_sdk = True
elif args.platform:
self.do_platform = True
self.do_sdk = bool(args.sdk)
else:
self.do_platform = bool(args.platform)
self.do_sdk = bool(args.sdk)
if not (self.do_sdk or self.do_platform):
parser.error(
'--no-sdk and --no-platform cannot work together')
if self.export_bundles and not self.ostree_commit: if self.export_bundles and not self.ostree_commit:
parser.error( parser.error(
'--export-bundles and --no-ostree-commit cannot ' '--export-bundles and --no-ostree-commit cannot '
...@@ -613,7 +650,13 @@ class Builder: ...@@ -613,7 +650,13 @@ class Builder:
else: else:
self.automatic_dbgsym = args.automatic_dbgsym self.automatic_dbgsym = args.automatic_dbgsym
self.collect_source_code = args.collect_source_code if self.do_sdk:
self.collect_source_code = args.collect_source_code
else:
# --no-sdk overrides --collect-source-code: if we are not
# building the SDK then we have no opportunity to collect
# the source code
self.collect_source_code = False
self.build_apt_sources = self.generate_apt_sources( self.build_apt_sources = self.generate_apt_sources(
add=args.add_apt_source + args.add_build_apt_source, add=args.add_apt_source + args.add_build_apt_source,
...@@ -969,6 +1012,12 @@ class Builder: ...@@ -969,6 +1012,12 @@ class Builder:
# Do the Platform first, because we download its source # Do the Platform first, because we download its source
# packages as part of preparing the Sdk # packages as part of preparing the Sdk
for sdk in (False, True): for sdk in (False, True):
if sdk and not self.do_sdk:
continue
if not sdk and not self.do_platform:
continue
packages = list(self.get_runtime_packages( packages = list(self.get_runtime_packages(
self.runtime_details.get('add_packages', []) self.runtime_details.get('add_packages', [])
)) ))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment