summaryrefslogtreecommitdiffstats
path: root/meta/packages/update-alternatives/update-alternatives-dpkg.inc
blob: 66232139d4a682174e92020e743117c607e40592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
LICENSE = "GPL"
SECTION = "base"
SRC_URI = "${DEBIAN_MIRROR}/main/d/dpkg/dpkg_${PV}.tar.gz"
S = "${WORKDIR}/dpkg-${PV}"
PACKAGE_ARCH = "all"
PR = "r1"

do_patch () {
    cat ${S}/scripts/update-alternatives.pl | \
        sed -n -e '
    /^\$admindir=.*staging/{
        x
        s/^.*$/$D=$ENV{"D"} || ""\;/;
        p;
        x;
        s,^\$admindir=.*staging.*$,$admindir="$D${localstatedir}/dpkg"\;,;
    };
    s,^\$altdir=.*$,$altdir="$D${sysconfdir}/alternatives"\;,;
    p;' > ${S}/scripts/update-alternatives
}