diff options
author | Drew Moseley <drew_moseley@mentor.com> | 2014-06-25 09:51:38 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-07-15 15:02:28 +0200 |
commit | 54216335fc654ec46af01cb2a529cdfd9ddb2209 (patch) | |
tree | dbc98fcfe7d0781b96661720248cfb74e187cd2d /meta-oe/recipes-support/debianutils/debianutils_4.4.bb | |
parent | b5e7302953ee54da8b02246323e89bb5eb4ed87e (diff) | |
download | meta-openembedded-54216335fc654ec46af01cb2a529cdfd9ddb2209.tar.gz |
debianutils: Use update-alternatives class
Use the update-alternatives class rather than explicit
pkg_prerm_${PN} and pkg_postinst_${PN} tasks. This allows
the configuration to happen at build time rather than
on first boot.
Signed-off-by: Drew Moseley <drew_moseley@mentor.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/debianutils/debianutils_4.4.bb')
-rw-r--r-- | meta-oe/recipes-support/debianutils/debianutils_4.4.bb | 45 |
1 files changed, 11 insertions, 34 deletions
diff --git a/meta-oe/recipes-support/debianutils/debianutils_4.4.bb b/meta-oe/recipes-support/debianutils/debianutils_4.4.bb index c93c02653..346eaf16e 100644 --- a/meta-oe/recipes-support/debianutils/debianutils_4.4.bb +++ b/meta-oe/recipes-support/debianutils/debianutils_4.4.bb | |||
@@ -7,52 +7,29 @@ SRC_URI = "${DEBIAN_MIRROR}/main/d/${BPN}/${BPN}_${PV}.tar.gz" | |||
7 | SRC_URI[md5sum] = "c0cb076754d7f4eb1e3397d00916647f" | 7 | SRC_URI[md5sum] = "c0cb076754d7f4eb1e3397d00916647f" |
8 | SRC_URI[sha256sum] = "190850cdd6b5302e0a1ba1aaed1bc7074d67d3bd8d04c613f242f7145afa53a6" | 8 | SRC_URI[sha256sum] = "190850cdd6b5302e0a1ba1aaed1bc7074d67d3bd8d04c613f242f7145afa53a6" |
9 | 9 | ||
10 | inherit autotools | 10 | inherit autotools update-alternatives |
11 | 11 | ||
12 | do_configure_prepend() { | 12 | do_configure_prepend() { |
13 | sed -i -e 's:tempfile.1 which.1:which.1:g' ${S}/Makefile.am | 13 | sed -i -e 's:tempfile.1 which.1:which.1:g' ${S}/Makefile.am |
14 | } | 14 | } |
15 | 15 | ||
16 | do_install_append() { | 16 | do_install_append() { |
17 | for app in ${D}${sbindir}/* ${D}${bindir}/*; do | ||
18 | mv $app $app.${PN} | ||
19 | done | ||
20 | if [ "${base_bindir}" != "${bindir}" ]; then | 17 | if [ "${base_bindir}" != "${bindir}" ]; then |
21 | # Debian places some utils into ${base_bindir} as does busybox | 18 | # Debian places some utils into ${base_bindir} as does busybox |
22 | install -d ${D}${base_bindir} | 19 | install -d ${D}${base_bindir} |
23 | for app in run-parts.${PN} tempfile.${PN}; do | 20 | for app in run-parts tempfile; do |
24 | mv ${D}${bindir}/$app ${D}${base_bindir}/$app | 21 | mv ${D}${bindir}/$app ${D}${base_bindir}/$app |
25 | done | 22 | done |
26 | fi | 23 | fi |
27 | } | 24 | } |
28 | 25 | ||
29 | pkg_prerm_${PN} () { | 26 | ALTERNATIVE_PRIORITY="100" |
30 | if [ "x$D" != "x" ]; then | 27 | ALTERNATIVE_${PN} = "add-shell installkernel remove-shell run-parts savelog tempfile which" |
31 | echo "can't do u-a offline" ; exit 1 | ||
32 | else | ||
33 | for app in add-shell installkernel remove-shell run-parts savelog tempfile which ; do | ||
34 | update-alternatives --remove $app $app.${PN} | ||
35 | done | ||
36 | fi | ||
37 | } | ||
38 | |||
39 | pkg_postinst_${PN} () { | ||
40 | if [ "x$D" != "x" ]; then | ||
41 | echo "can't do u-a offline" ; exit 1 | ||
42 | else | ||
43 | for app in add-shell installkernel remove-shell ; do | ||
44 | update-alternatives --install ${sbindir}/$app $app $app.${PN} 100 | ||
45 | done | ||
46 | |||
47 | for app in savelog which ; do | ||
48 | update-alternatives --install ${bindir}/$app $app $app.${PN} 100 | ||
49 | done | ||
50 | |||
51 | for app in run-parts tempfile ; do | ||
52 | update-alternatives --install ${base_bindir}/$app $app $app.${PN} 100 | ||
53 | done | ||
54 | fi | ||
55 | } | ||
56 | |||
57 | |||
58 | 28 | ||
29 | ALTERNATIVE_LINK_NAME[add-shell]="${sbindir}/add-shell" | ||
30 | ALTERNATIVE_LINK_NAME[installkernel]="${sbindir}/installkernel" | ||
31 | ALTERNATIVE_LINK_NAME[remove-shell]="${sbindir}/remove-shell" | ||
32 | ALTERNATIVE_LINK_NAME[run-parts]="${base_bindir}/run-parts" | ||
33 | ALTERNATIVE_LINK_NAME[savelog]="${bindir}/savelog" | ||
34 | ALTERNATIVE_LINK_NAME[tempfile]="${base_bindir}/tempfile" | ||
35 | ALTERNATIVE_LINK_NAME[which]="${bindir}/which" | ||