diff options
author | Khem Raj <raj.khem@gmail.com> | 2019-02-07 16:56:11 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-02-08 23:15:32 +0000 |
commit | 84b1f0dcf75d1dbb8de0eb006946d0cd40a07a36 (patch) | |
tree | 008b8a36a208d90fc8fda7496ef20f2805335a08 | |
parent | 6fe6b31ee8521e53797d0a4120d37342a59c9219 (diff) | |
download | poky-84b1f0dcf75d1dbb8de0eb006946d0cd40a07a36.tar.gz |
glibc-locale: Rewrite do_install using install utility instead of cp
This has been a constant source of trouble for build failures due to host-user-contaminated QA
errors of sort
ERROR: QA Issue: glibc-locale: /glibc-binary-localedata-ca-es+valencia/usr/lib/locale/ca_ES@valencia/LC_MONETARY is owned by uid 3004, which is the same as the user running bitbake. This may be due to host contamination [host-user-contaminated]
So far we have tried to mould cp command into not carrying the build
user permissions into install area but it is never entirely fixed since
the issue keeps popping up in various scenes
This patch replaces use of cp with install utility and specifies install
mode for files explcitly
(From OE-Core rev: 92fdb64ac9689b9cac8a1229b1928b50338969be)
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/recipes-core/glibc/glibc-locale.inc | 41 |
1 files changed, 20 insertions, 21 deletions
diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc index 6384f9cbf1..a985d26c75 100644 --- a/meta/recipes-core/glibc/glibc-locale.inc +++ b/meta/recipes-core/glibc/glibc-locale.inc | |||
@@ -71,28 +71,27 @@ FILES_localedef = "${bindir}/localedef" | |||
71 | 71 | ||
72 | LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale" | 72 | LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale" |
73 | 73 | ||
74 | do_install () { | 74 | copy_locale_files() { |
75 | mkdir -p ${D}${bindir} ${D}${datadir} | 75 | local dir=$1 mode=$2 |
76 | if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then | 76 | |
77 | cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${bindir}/* ${D}${bindir} | 77 | [ -e "${LOCALETREESRC}$dir" ] || return 0 |
78 | fi | 78 | |
79 | if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then | 79 | for d in . $(find "${LOCALETREESRC}$dir" -type d -printf '%P '); do |
80 | mkdir -p ${D}${localedir} | 80 | install -d ${D}$dir/$d |
81 | cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${localedir}/* ${D}${localedir} | 81 | find "${LOCALETREESRC}$dir/$d" -maxdepth 1 -type f \ |
82 | fi | 82 | -exec install -m $mode -t "${D}$dir/$d" {} \; |
83 | if [ ${@d.getVar('PACKAGE_NO_GCONV')} -eq 0 ]; then | 83 | done |
84 | mkdir -p ${D}${libdir} | 84 | } |
85 | if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then | 85 | |
86 | cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir} | 86 | do_install() { |
87 | fi | 87 | copy_locale_files ${bindir} 0755 |
88 | if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then | 88 | copy_locale_files ${localedir} 0644 |
89 | cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir} | 89 | if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then |
90 | fi | 90 | copy_locale_files ${libdir}/gconv 0755 |
91 | fi | 91 | copy_locale_files ${datadir}/i18n 0644 |
92 | if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then | ||
93 | cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/locale ${D}${datadir} | ||
94 | fi | 92 | fi |
95 | cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/SUPPORTED ${WORKDIR} | 93 | copy_locale_files ${datadir}/locale 0644 |
94 | install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED | ||
96 | } | 95 | } |
97 | 96 | ||
98 | inherit libc-package | 97 | inherit libc-package |