File: 01-override-yum-arch

package info (click to toggle)
python-diskimage-builder 3.37.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,572 kB
  • sloc: sh: 7,380; python: 6,444; makefile: 37
file content (44 lines) | stat: -rwxr-xr-x 943 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/bash

if [ ${DIB_DEBUG_TRACE:-0} -gt 0 ]; then
    set -x
fi
set -eu
set -o pipefail

if [[ "amd64 x86_64" =~ "$ARCH" ]]; then
    basearch=x86_64
    arch=x86_64
elif [[ "$ARCH" = "ppc64" ]]; then
    basearch=ppc64
    arch=ppc64
elif [[ "$ARCH" = "ppc64le" ]]; then
    basearch=ppc64le
    arch=ppc64le
elif [[ "arm64 aarch64" =~ "$ARCH" ]]; then
    basearch=aarch64
    arch=aarch64
else
    echo "********************"
    echo "Unknown arch '$ARCH'"
    echo "********************"
    exit 1
fi

if [[ ${YUM} == "dnf" ]]; then
    mkdir -p /etc/dnf/vars
    echo $basearch > /etc/dnf/vars/basearch
    echo $arch > /etc/dnf/vars/arch
else
    echo $basearch > /etc/yum/vars/basearch
    echo $arch > /etc/yum/vars/arch
fi

if [[ ${DISTRO_NAME} =~ "centos" ]]; then
    if [[ ${arch} == "x86_64" ]]; then
        contentdir=centos
    else
        contentdir=altarch
    fi
    echo $contentdir > /etc/${YUM}/vars/contentdir
fi