Commit 6a0cb3cb authored by Simon McVittie's avatar Simon McVittie

collect-source-code: Generate Sources.gz

Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent c205e304
......@@ -310,6 +310,28 @@ def main():
parent = args.output or os.path.join(args.sysroot, 'src', 'files')
with open(
os.path.join(parent, 'Sources'), 'w'
) as writer:
subprocess.check_call(in_chroot + [
'sh', '-euc',
'dir="$1"; shift; mkdir -p "$dir"; cd "$dir"; "$@"',
'sh', # argv[0]
'/src/files', # working directory
'dpkg-scansources',
'.',
], stdout=writer)
with open(
os.path.join(parent, 'Sources.gz'), 'wb'
) as binary_writer:
subprocess.check_call([
'pigz', '-c', '-n', '--rsyncable',
os.path.join(parent, 'Sources'),
], stdout=binary_writer)
os.remove(os.path.join(parent, 'Sources'))
try:
with open(
os.path.join(parent, 'sources.txt'), 'r'
......
......@@ -344,12 +344,12 @@ actions:
- action: run
label: list of included source code
chroot: false
command: >
set -e;
cd "$ARTIFACTDIR";
dir="{{ or $sources_directory "$ROOTDIR/src/files" }}";
cp -v "$dir/sources.txt"
"{{ $sources_prefix }}.sources.txt"
command: |
set -e
cd "$ARTIFACTDIR"
dir="{{ or $sources_directory "$ROOTDIR/src/files" }}"
cp -v "$dir/Sources.gz" "{{ $sources_prefix }}.deb822.gz"
cp -v "$dir/sources.txt" "{{ $sources_prefix }}.sources.txt"
- action: run
label: list of missing source code
......
......@@ -1131,6 +1131,11 @@ class Builder:
multiarch=True,
))
# We probably have this anyway, but we need it for
# dpkg-scansources
if 'dpkg-dev' not in sdk_packages:
sdk_packages.append('dpkg-dev')
if sdk_packages:
logger.info('Installing extra packages for SDK:')
sdk_packages.sort()
......
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