diff options
author | Mark Hatle <mark.hatle@windriver.com> | 2012-05-15 18:34:39 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2012-05-30 10:43:42 +0100 |
commit | 4bed7f31535f16dbe1f8bbab58921f12f1696f6f (patch) | |
tree | c5e2da8784bf96b6d60ad7ebdfe6843f3d51b010 /meta | |
parent | fbbc96aed5086f853a1179f1478ccd252af24094 (diff) | |
download | openembedded-core-4bed7f31535f16dbe1f8bbab58921f12f1696f6f.tar.gz openembedded-core-4bed7f31535f16dbe1f8bbab58921f12f1696f6f.tar.bz2 openembedded-core-4bed7f31535f16dbe1f8bbab58921f12f1696f6f.zip |
coreutils: use new update-alternatives
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/coreutils/coreutils_6.9.bb | 46 | ||||
-rw-r--r-- | meta/recipes-core/coreutils/coreutils_8.14.bb | 49 |
2 files changed, 38 insertions, 57 deletions
diff --git a/meta/recipes-core/coreutils/coreutils_6.9.bb b/meta/recipes-core/coreutils/coreutils_6.9.bb index bbde63c697..6789b8c11d 100644 --- a/meta/recipes-core/coreutils/coreutils_6.9.bb +++ b/meta/recipes-core/coreutils/coreutils_6.9.bb @@ -38,59 +38,47 @@ bindir_progs = "base64 basename cksum comm csplit cut dir dircolors dirname du \ join link logname md5sum mkfifo nice nl nohup od paste pathchk \ pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \ sha384sum sha512sum shred shuf sort split stat sum tac tail tee test \ - tr tsort tty unexpand uniq unlink users vdir wc who whoami yes" + tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime" # hostname gets a special treatment and is not included in this base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \ - mknod mv pwd rm rmdir sleep stty sync touch true uname" + mknod mv pwd rm rmdir sleep stty sync touch true uname hostname" sbindir_progs= "chroot" do_install() { autotools_do_install - for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done - install -d ${D}${base_bindir} - for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done + [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done install -d ${D}${sbindir} - for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done + [ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done # [ requires special handling because [.coreutils will cause the sed stuff # in update-alternatives to fail, therefore use lbracket - the name used # for the actual source file. - mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN} - - # hostname and uptime separated. busybox's versions are preferred - mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN} - mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN} + mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} } -pkg_postinst_${PN} () { - for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done +inherit update-alternatives - for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done +ALTERNATIVE_PRIORITY = "100" - for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done - - # Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately. - update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10 - update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10 - update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100 -} +ALTERNATIVE_${PN} = "lbraket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}" -pkg_prerm_${PN} () { - for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done +ALTERNATIVE_PRIORITY[uptime] = "10" +ALTERNATIVE_PRIORITY[hostname] = "10" - for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done +ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" +ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" - for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done +python __anonymous() { + for prog in d.getVar('base_bindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) - # The special cases - update-alternatives --remove hostname hostname.${PN} - update-alternatives --remove uptime uptime.${PN} - update-alternatives --remove '[' 'lbracket.${PN}' + for prog in d.getVar('sbindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) } BBCLASSEXTEND = "native" diff --git a/meta/recipes-core/coreutils/coreutils_8.14.bb b/meta/recipes-core/coreutils/coreutils_8.14.bb index 688cec9458..214bedb886 100644 --- a/meta/recipes-core/coreutils/coreutils_8.14.bb +++ b/meta/recipes-core/coreutils/coreutils_8.14.bb @@ -7,7 +7,7 @@ BUGTRACKER = "http://debbugs.gnu.org/coreutils" LICENSE = "GPLv3+" LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad" -PR = "r3" +PR = "r4" DEPENDS = "gmp libcap" DEPENDS_virtclass-native = "" @@ -36,52 +36,45 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi sbindir_progs= "chroot" do_install_append() { - for i in ${bindir_progs} df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done + for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done install -d ${D}${base_bindir} - for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done + [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done install -d ${D}${sbindir} - for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done + [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done # [ requires special handling because [.coreutils will cause the sed stuff # in update-alternatives to fail, therefore use lbracket - the name used # for the actual source file. - mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN} + mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} install -d ${D}${libdir}/coreutils mv ${D}${libexecdir}/coreutils/libstdbuf.so ${D}${libdir}/coreutils } -pkg_postinst_${PN} () { - for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done +inherit update-alternatives - for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done +ALTERNATIVE_PRIORITY = "100" +ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df" - for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done +ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" +ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" - # Special cases. [ needs to be treated separately. - update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100 - - # Special cases. base64, mktemp and df need to be treated separately, because busybox have them in base_binding not bindir - update-alternatives --install ${base_bindir}/base64 base64 ${bindir}/base64.${PN} 100; - update-alternatives --install ${base_bindir}/mktemp mktemp ${bindir}/mktemp.${PN} 100; - update-alternatives --install ${base_bindir}/df df ${bindir}/df.${PN} 100; -} +ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" +ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" -pkg_prerm_${PN} () { - for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done +ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" +ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" - for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done +ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" +ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" - for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done +python __anonymous() { + for prog in d.getVar('base_bindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) - # The special cases - update-alternatives --remove hostname hostname.${PN} - update-alternatives --remove uptime uptime.${PN} - update-alternatives --remove '[' 'lbracket.${PN}' - update-alternatives --remove base64 ${bindir}/base64.${PN} - update-alternatives --remove mktemp ${bindir}/mktemp.${PN} - update-alternatives --remove df ${bindir}.df.${PN} + for prog in d.getVar('sbindir_progs', True).split(): + d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) } BBCLASSEXTEND = "native" |