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 12:04:41 +0100 |
commit | 3f810e24628764413a0672e668953667dc62794f (patch) | |
tree | 2f279d78c3d898099e40d02c86f35eccb7118559 | |
parent | 92482cb4962fd79a07078f0fea372fdc200ed76c (diff) | |
download | poky-3f810e24628764413a0672e668953667dc62794f.tar.gz |
coreutils: use new update-alternatives
(From OE-Core rev: 4bed7f31535f16dbe1f8bbab58921f12f1696f6f)
Signed-off-by: Mark Hatle <mark.hatle@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 \ | |||
38 | join link logname md5sum mkfifo nice nl nohup od paste pathchk \ | 38 | join link logname md5sum mkfifo nice nl nohup od paste pathchk \ |
39 | pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \ | 39 | pinky pr printenv printf ptx readlink seq sha1sum sha224sum sha256sum \ |
40 | sha384sum sha512sum shred shuf sort split stat sum tac tail tee test \ | 40 | sha384sum sha512sum shred shuf sort split stat sum tac tail tee test \ |
41 | tr tsort tty unexpand uniq unlink users vdir wc who whoami yes" | 41 | tr tsort tty unexpand uniq unlink users vdir wc who whoami yes uptime" |
42 | 42 | ||
43 | # hostname gets a special treatment and is not included in this | 43 | # hostname gets a special treatment and is not included in this |
44 | base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \ | 44 | base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdir \ |
45 | mknod mv pwd rm rmdir sleep stty sync touch true uname" | 45 | mknod mv pwd rm rmdir sleep stty sync touch true uname hostname" |
46 | 46 | ||
47 | sbindir_progs= "chroot" | 47 | sbindir_progs= "chroot" |
48 | 48 | ||
49 | do_install() { | 49 | do_install() { |
50 | autotools_do_install | 50 | autotools_do_install |
51 | 51 | ||
52 | for i in ${bindir_progs}; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done | ||
53 | |||
54 | install -d ${D}${base_bindir} | 52 | install -d ${D}${base_bindir} |
55 | for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done | 53 | [ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done |
56 | 54 | ||
57 | install -d ${D}${sbindir} | 55 | install -d ${D}${sbindir} |
58 | for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done | 56 | [ "${bindir}" != "${sbindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i; done |
59 | 57 | ||
60 | # [ requires special handling because [.coreutils will cause the sed stuff | 58 | # [ requires special handling because [.coreutils will cause the sed stuff |
61 | # in update-alternatives to fail, therefore use lbracket - the name used | 59 | # in update-alternatives to fail, therefore use lbracket - the name used |
62 | # for the actual source file. | 60 | # for the actual source file. |
63 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN} | 61 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} |
64 | |||
65 | # hostname and uptime separated. busybox's versions are preferred | ||
66 | mv ${D}${bindir}/hostname ${D}${base_bindir}/hostname.${PN} | ||
67 | mv ${D}${bindir}/uptime ${D}${bindir}/uptime.${PN} | ||
68 | } | 62 | } |
69 | 63 | ||
70 | pkg_postinst_${PN} () { | 64 | inherit update-alternatives |
71 | for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done | ||
72 | 65 | ||
73 | for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done | 66 | ALTERNATIVE_PRIORITY = "100" |
74 | 67 | ||
75 | for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done | 68 | ALTERNATIVE_${PN} = "lbraket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs}" |
76 | |||
77 | # Special cases. uptime and hostname is broken, prefer busybox's version. [ needs to be treated separately. | ||
78 | update-alternatives --install ${bindir}/uptime uptime uptime.${PN} 10 | ||
79 | update-alternatives --install ${base_bindir}/hostname hostname hostname.${PN} 10 | ||
80 | update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100 | ||
81 | } | ||
82 | 69 | ||
83 | pkg_prerm_${PN} () { | 70 | ALTERNATIVE_PRIORITY[uptime] = "10" |
84 | for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done | 71 | ALTERNATIVE_PRIORITY[hostname] = "10" |
85 | 72 | ||
86 | for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done | 73 | ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" |
74 | ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" | ||
87 | 75 | ||
88 | for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done | 76 | python __anonymous() { |
77 | for prog in d.getVar('base_bindir_progs', True).split(): | ||
78 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) | ||
89 | 79 | ||
90 | # The special cases | 80 | for prog in d.getVar('sbindir_progs', True).split(): |
91 | update-alternatives --remove hostname hostname.${PN} | 81 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) |
92 | update-alternatives --remove uptime uptime.${PN} | ||
93 | update-alternatives --remove '[' 'lbracket.${PN}' | ||
94 | } | 82 | } |
95 | 83 | ||
96 | BBCLASSEXTEND = "native" | 84 | 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" | |||
7 | LICENSE = "GPLv3+" | 7 | LICENSE = "GPLv3+" |
8 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ | 8 | LIC_FILES_CHKSUM = "file://COPYING;md5=d32239bcb673463ab874e80d47fae504\ |
9 | file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad" | 9 | file://src/ls.c;startline=5;endline=16;md5=e1a509558876db58fb6667ba140137ad" |
10 | PR = "r3" | 10 | PR = "r4" |
11 | DEPENDS = "gmp libcap" | 11 | DEPENDS = "gmp libcap" |
12 | DEPENDS_virtclass-native = "" | 12 | DEPENDS_virtclass-native = "" |
13 | 13 | ||
@@ -36,52 +36,45 @@ base_bindir_progs = "cat chgrp chmod chown cp date dd echo false kill ln ls mkdi | |||
36 | sbindir_progs= "chroot" | 36 | sbindir_progs= "chroot" |
37 | 37 | ||
38 | do_install_append() { | 38 | do_install_append() { |
39 | for i in ${bindir_progs} df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${PN}; done | 39 | for i in df mktemp base64; do mv ${D}${bindir}/$i ${D}${bindir}/$i.${BPN}; done |
40 | 40 | ||
41 | install -d ${D}${base_bindir} | 41 | install -d ${D}${base_bindir} |
42 | for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${PN}; done | 42 | [ "${base_bindir}" != "${bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i.${BPN}; done |
43 | 43 | ||
44 | install -d ${D}${sbindir} | 44 | install -d ${D}${sbindir} |
45 | for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${PN}; done | 45 | [ "${sbindir}" != "${bindir}" ] && for i in ${sbindir_progs}; do mv ${D}${bindir}/$i ${D}${sbindir}/$i.${BPN}; done |
46 | 46 | ||
47 | # [ requires special handling because [.coreutils will cause the sed stuff | 47 | # [ requires special handling because [.coreutils will cause the sed stuff |
48 | # in update-alternatives to fail, therefore use lbracket - the name used | 48 | # in update-alternatives to fail, therefore use lbracket - the name used |
49 | # for the actual source file. | 49 | # for the actual source file. |
50 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${PN} | 50 | mv ${D}${bindir}/[ ${D}${bindir}/lbracket.${BPN} |
51 | install -d ${D}${libdir}/coreutils | 51 | install -d ${D}${libdir}/coreutils |
52 | mv ${D}${libexecdir}/coreutils/libstdbuf.so ${D}${libdir}/coreutils | 52 | mv ${D}${libexecdir}/coreutils/libstdbuf.so ${D}${libdir}/coreutils |
53 | } | 53 | } |
54 | 54 | ||
55 | pkg_postinst_${PN} () { | 55 | inherit update-alternatives |
56 | for i in ${bindir_progs}; do update-alternatives --install ${bindir}/$i $i $i.${PN} 100; done | ||
57 | 56 | ||
58 | for i in ${base_bindir_progs}; do update-alternatives --install ${base_bindir}/$i $i $i.${PN} 100; done | 57 | ALTERNATIVE_PRIORITY = "100" |
58 | ALTERNATIVE_${PN} = "lbracket ${bindir_progs} ${base_bindir_progs} ${sbindir_progs} base64 mktemp df" | ||
59 | 59 | ||
60 | for i in ${sbindir_progs}; do update-alternatives --install ${sbindir}/$i $i $i.${PN} 100; done | 60 | ALTERNATIVE_LINK_NAME[base64] = "${base_bindir}/base64" |
61 | ALTERNATIVE_TARGET[base64] = "${bindir}/base64.${BPN}" | ||
61 | 62 | ||
62 | # Special cases. [ needs to be treated separately. | 63 | ALTERNATIVE_LINK_NAME[mktemp] = "${base_bindir}/mktemp" |
63 | update-alternatives --install '${bindir}/[' '[' 'lbracket.${PN}' 100 | 64 | ALTERNATIVE_TARGET[mktemp] = "${bindir}/mktemp.${BPN}" |
64 | |||
65 | # Special cases. base64, mktemp and df need to be treated separately, because busybox have them in base_binding not bindir | ||
66 | update-alternatives --install ${base_bindir}/base64 base64 ${bindir}/base64.${PN} 100; | ||
67 | update-alternatives --install ${base_bindir}/mktemp mktemp ${bindir}/mktemp.${PN} 100; | ||
68 | update-alternatives --install ${base_bindir}/df df ${bindir}/df.${PN} 100; | ||
69 | } | ||
70 | 65 | ||
71 | pkg_prerm_${PN} () { | 66 | ALTERNATIVE_LINK_NAME[df] = "${base_bindir}/df" |
72 | for i in ${bindir_progs}; do update-alternatives --remove $i $i.${PN}; done | 67 | ALTERNATIVE_TARGET[df] = "${bindir}/df.${BPN}" |
73 | 68 | ||
74 | for i in ${base_bindir_progs}; do update-alternatives --remove $i $i.${PN}; done | 69 | ALTERNATIVE_LINK_NAME[lbracket] = "${bindir}/[" |
70 | ALTERNATIVE_TARGET[lbracket] = "${bindir}/lbracket.${BPN}" | ||
75 | 71 | ||
76 | for i in ${sbindir_progs}; do update-alternatives --remove $i $i.${PN}; done | 72 | python __anonymous() { |
73 | for prog in d.getVar('base_bindir_progs', True).split(): | ||
74 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog)) | ||
77 | 75 | ||
78 | # The special cases | 76 | for prog in d.getVar('sbindir_progs', True).split(): |
79 | update-alternatives --remove hostname hostname.${PN} | 77 | d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('sbindir', True), prog)) |
80 | update-alternatives --remove uptime uptime.${PN} | ||
81 | update-alternatives --remove '[' 'lbracket.${PN}' | ||
82 | update-alternatives --remove base64 ${bindir}/base64.${PN} | ||
83 | update-alternatives --remove mktemp ${bindir}/mktemp.${PN} | ||
84 | update-alternatives --remove df ${bindir}.df.${PN} | ||
85 | } | 78 | } |
86 | 79 | ||
87 | BBCLASSEXTEND = "native" | 80 | BBCLASSEXTEND = "native" |