Commit 86511668 authored by Simon McVittie's avatar Simon McVittie
Browse files

Merge branch 'wip/fdanis/add_pre_apt_script' into 'master'

Remove dependencies to Aptitude and add pre_apt_script

See merge request smcv/flatdeb!3
parents 296e95f8 8c2575b4
......@@ -4,6 +4,7 @@
{{- $suite := or .suite "stretch" -}}
{{- $flatpak_arch := or .flatpak_arch $architecture -}}
{{- $packages := or .packages "" -}}
{{- $pre_apt_script := or .pre_apt_script "" -}}
{{- $post_script := or .post_script "" -}}
{{- $sdk := or .sdk false -}}
{{- $sdk_packages := or .sdk_packages "" -}}
......@@ -54,6 +55,13 @@ actions:
chroot: false
command: 'echo; "$RECIPEDIR/prepare-runtime" "$ROOTDIR"'
{{ if $pre_apt_script }}
- action: run
label: pre_apt_script
chroot: true
script: '{{ $pre_apt_script }}'
{{ end }}
{{ if $packages }}
- action: run
label: apt-install
......
......@@ -69,17 +69,5 @@ install -d \
"$sysroot/var/lock" \
${NULL}
# We use aptitude to help prepare the Platform runtime, and
# it's a useful thing to have in the Sdk runtime
in_chroot apt-get -q -y --no-install-recommends install aptitude
# All packages will be removed from the platform runtime
# unless they are Essential, depended-on, or in the
# add_packages list.
in_chroot aptitude -y markauto '?installed'
# Ubuntu precise doesn't like apt being up for autoremoval.
in_chroot aptitude -y unmarkauto apt
# Required for openjdk-8-jre-headless
install -d "$sysroot/usr/share/man/man1"
......@@ -1123,6 +1123,20 @@ class Builder:
argv.append('-t')
argv.append('post_script:post_script')
pre_apt_script = self.runtime_details.get('pre_apt_script', '')
if pre_apt_script:
dest = os.path.join(scratch, 'pre_apt_script')
with open(dest, 'w', encoding='utf-8') as writer:
writer.write('#!/bin/sh\n')
writer.write(pre_apt_script)
writer.write('\n')
os.chmod(dest, 0o755)
argv.append('-t')
argv.append('pre_apt_script:pre_apt_script')
if sdk:
sources_tarball = sources_prefix + '.tar.gz'
......
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