Commit 71fd2ee5 authored by Simon McVittie's avatar Simon McVittie
Browse files

Drop support for pre-jessie foreign architecture configuration syntax



The only Ubuntu precise derivative I'm interested in is now
self-contained, so flatdeb doesn't need to be able to debootstrap
from precise any more.
Signed-off-by: Simon McVittie's avatarSimon McVittie <smcv@collabora.com>
parent 768c9888
#!/bin/bash
# Copyright © 2016-2017 Simon McVittie
# Copyright © 2017-2018 Collabora Ltd.
#
# SPDX-License-Identifier: MIT
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
set -e
set -u
set -o pipefail
me="$(basename "$0")"
if [ "$#" -lt 2 ] || [ "$1" = '--help' ] || [ "x$(id -u)" != x0 ] ||
! [ -d "$1" ]; then
echo "$me: Usage:" >&2
echo " $me SYSROOT [ARCHITECTURE...]" >&2
echo "" >&2
echo "Run this script as root." >&2
exit 2
fi
sysroot="$1"
cd "$sysroot"
shift
in_chroot () {
chroot "$sysroot" "$@"
}
set_file_contents () {
file="$1"
permissions="${2-0644}"
install -d "$sysroot/$(dirname "$file")"
rm -f "$sysroot/$file"
cat > "$sysroot/$file.dpkg-new"
chmod "$permissions" "$sysroot/$file.dpkg-new"
mv -f "$sysroot/$file.dpkg-new" "$sysroot/$file"
}
if in_chroot dpkg --add-architecture "$1"; then
echo "Using new architecture syntax (Debian jessie)" >&2
shift
for arch in "$@"; do
in_chroot dpkg --add-architecture "$arch"
done
else
# Older syntax for Ubuntu precise
# https://wiki.debian.org/Multiarch/HOWTO
echo "Using older architecture syntax (Ubuntu precise)" >&2
install -d "$sysroot/etc/dpkg/dpkg.cfg.d"
for arch in "$@"; do
echo "foreign-architecture $1"
done > "$sysroot/etc/dpkg/dpkg.cfg.d/architectures"
fi
# vim:set sts=4 sw=4 et:
......@@ -99,8 +99,12 @@ actions:
{{ if $foreignarchs }}
- action: run
label: add-foreign-architectures
chroot: false
command: 'echo; "$RECIPEDIR/add-foreign-architectures" "$ROOTDIR" {{ $foreignarchs }}'
chroot: true
command: |
set -eux
for a in {{ $foreignarchs }}; do
dpkg --add-architecture "$a"
done
{{ end }}
- action: run
......
......@@ -684,7 +684,6 @@ class Builder:
shutil.copyfile(_DEBOS_BASE_RECIPE, dest_recipe)
for helper in (
'add-foreign-architectures',
'clean-up-base',
'clean-up-before-pack',
'disable-services',
......
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