diff options
Diffstat (limited to 'meta/recipes-core/coreutils/coreutils_6.9.bb')
-rw-r--r-- | meta/recipes-core/coreutils/coreutils_6.9.bb | 46 |
1 files changed, 17 insertions, 29 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" |