From patchwork Thu Feb 7 18:04:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 157763 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp971804jaa; Thu, 7 Feb 2019 10:04:15 -0800 (PST) X-Google-Smtp-Source: AHgI3IaZu+/c8RuEGcqcVVeFCSx9xH8911WWpGKcqQc2wJ5daNBx4UD8oQTdxXd7KGTKslzfsiIc X-Received: by 2002:a17:902:a50e:: with SMTP id s14mr5859710plq.311.1549562655050; Thu, 07 Feb 2019 10:04:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549562655; cv=none; d=google.com; s=arc-20160816; b=b19/qBM90c9xgiX65Vkk7z2EFUpf7c15ZYmoBkRLXFuUrK8bGbH6FI/vUW9YxdWQI2 F24ygmczgq0BDorcJO55xjDs4ORUl1Fnl8JKr4DUyjfb7anx8WDCpCEvOpy15YVYp8LS nekX+6svZmHgCh8PLloDDPDKT74DvP2hkB30IjIPgydUpSe6z2p/X36HrnSUCqJ115Kh zjh7dZTfOU6uar5EXgcU2AGMPjOCj7AJAb3EW24/LGLD5f4yW1qKh9+Is2p8FDqNGeXH A8WvW2vMkG8sQ2GLrr18kZEf1hyh6W+IAeJHsB0ueYJ8oQDicJtFehRzhcs+wfh8tsEd iBJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:message-id:date:to:from:dkim-signature:delivered-to; bh=1ie25pKVGRUTuo7ko1p+lJA8bULRSI6e0ybZc6t7SGg=; b=VPjusY+u14B11T7pq8vYWPuqXL+wj9bs/svenxhOUYHFakK483wDJzPI7Kbsh7Ncme MKNvSD9u0VDerLwQUrGpHVOig+Hon/XnAm/QEfntkGGcZaOw1aJnqvYVNDbkFxyeNWpf ZJlMl3oKsDur+ger6LLxejddphQSPQ9fFgkXR84nduisufQXsxqGGh5atj19HdMLymfm w9XAP5aYN38lwboUkPKVfAaJR3j6vGX0jgmYYYph1dRjdi8k+McdS+4vRNg2Q2Ar7iLl z1c7vBGR3A/x3uJeBXmla++2BOeQxOxcD84mwBs1ZxkqMiUOwsYBME/ozdF4Kx4RvWjO Y84A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D6wpY1UU; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from mail.openembedded.org (mail.openembedded.org. [140.211.169.62]) by mx.google.com with ESMTP id 31si9999882plh.274.2019.02.07.10.04.14; Thu, 07 Feb 2019 10:04:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) client-ip=140.211.169.62; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b=D6wpY1UU; spf=pass (google.com: best guess record for domain of openembedded-core-bounces@lists.openembedded.org designates 140.211.169.62 as permitted sender) smtp.mailfrom=openembedded-core-bounces@lists.openembedded.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ec2-34-214-78-129.us-west-2.compute.amazonaws.com (localhost [127.0.0.1]) by mail.openembedded.org (Postfix) with ESMTP id E63717C4C3; Thu, 7 Feb 2019 18:04:11 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mail.openembedded.org (Postfix) with ESMTP id 36F727C4BF for ; Thu, 7 Feb 2019 18:04:11 +0000 (UTC) Received: by mail-pf1-f175.google.com with SMTP id c123so296901pfb.0 for ; Thu, 07 Feb 2019 10:04:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b4QE/+Kkormp824l/L7eIFESQA0U+0MxGrnRUhVxvyw=; b=D6wpY1UUxROgZ0FaXB2snLT5WGfh+3NHAqJ304C6O4u9m1MYCF5uuypGh6Y5ZgyH+k sIqpSwYUv1E2BJAZ6Q3Yo583vfWB7B8wA0Pp7VVA5Y23DQ4Z3+/zMK3P1lKun4AtH5/x bbxQVLHRuajtY4dnq1CLbbO+a2GPzD3z7jjaqn2G1CBQVcG3jU+5eyWyZAK8VjLsHQ3+ P+JygVVlf7FEDzE9PEINXvkgEpWNk36nkZCoqtjqKwCWGW4EEieyKFYWE1vjSLiReOK5 QZen2s1zJudJq4Jgyoi5XGoZSSNO5MTEO06tJeRn8tYSo+Oq+gipeqysX6BnO/KDYzNv Lsnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=b4QE/+Kkormp824l/L7eIFESQA0U+0MxGrnRUhVxvyw=; b=hsHwcWRefeW/rAuw+ouU3JwjkH0NL9a/A9QPIgqX19C6FNBmCEYd/QpCfI7fmVfAr8 r9irIwYEBcguQYH0vk47q7ErfnT/8tCoxN6eszwP7NmiE4qYmt/nqF+esGP+TXLzacGI 3aKZnRWIOjrg0TTc8sPP2R0z4Wlj6Ma0o+4SmmfhF03811qXpQsklrBZuY4bZudQATb0 SyRGESrjvFq4DcDQ5CRBlEnuJavjo1TJCSasQv7o5oqDe2T3eyGpsRpMUz6hvKSRYJxn nitAT12rCox+S3HmrcjXm2TnpyIr1e/R3VYG1HL0om2ZfT5jHzFh6BzPaaFHIyOwcFym XGfg== X-Gm-Message-State: AHQUAua/FqcAgbSfbN1Yy4curGcRnmxh3TAvkjAFxh8VTIVScnisz042 /NV9TqSfaYdCGrOT8hv1b3Xg8OuL X-Received: by 2002:a62:4bcf:: with SMTP id d76mr18126358pfj.170.1549562651390; Thu, 07 Feb 2019 10:04:11 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:8500:6bc6::a005]) by smtp.gmail.com with ESMTPSA id a13sm4308533pgw.34.2019.02.07.10.04.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 10:04:10 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Thu, 7 Feb 2019 10:04:03 -0800 Message-Id: <20190207180403.25571-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH V2] glibc-locale: Rewrite do_install using install utility instead of cp X-BeenThere: openembedded-core@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussions about the oe-core layer List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: openembedded-core-bounces@lists.openembedded.org Errors-To: openembedded-core-bounces@lists.openembedded.org 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 Signed-off-by: Khem Raj --- v2: Turn the common install loop into a shell function ( Thanks Peter Kjellerstedt) meta/recipes-core/glibc/glibc-locale.inc | 43 ++++++++++++------------ 1 file changed, 21 insertions(+), 22 deletions(-) -- 2.20.1 -- _______________________________________________ Openembedded-core mailing list Openembedded-core@lists.openembedded.org http://lists.openembedded.org/mailman/listinfo/openembedded-core diff --git a/meta/recipes-core/glibc/glibc-locale.inc b/meta/recipes-core/glibc/glibc-locale.inc index 6384f9cbf1..c51fa482a9 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" LOCALETREESRC = "${COMPONENTS_DIR}/${PACKAGE_ARCH}/glibc-stash-locale" -do_install () { - mkdir -p ${D}${bindir} ${D}${datadir} - if [ -n "$(ls ${LOCALETREESRC}/${bindir})" ]; then - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${bindir}/* ${D}${bindir} - fi - if [ -n "$(ls ${LOCALETREESRC}/${localedir})" ]; then - mkdir -p ${D}${localedir} - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${localedir}/* ${D}${localedir} - fi - if [ ${@d.getVar('PACKAGE_NO_GCONV')} -eq 0 ]; then - mkdir -p ${D}${libdir} - if [ -e ${LOCALETREESRC}/${libdir}/gconv ]; then - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${libdir}/gconv ${D}${libdir} - fi - if [ -e ${LOCALETREESRC}/${datadir}/i18n ]; then - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/i18n ${D}${datadir} - fi - fi - if [ -e ${LOCALETREESRC}/${datadir}/locale ]; then - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/${datadir}/locale ${D}${datadir} - fi - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/SUPPORTED ${WORKDIR} +copy_locale_files() { + local dir=$1 mode=$2 + + [ -e "${LOCALETREESRC}$dir" ] || return 0 + + for d in . $(find "${LOCALETREESRC}$dir" -type d -printf '%P '); do + install -d ${D}$dir/$d + find "${LOCALETREESRC}$dir/$d" -maxdepth 1 -type f \ + -exec install -m $mode -t "${D}$dir/$d" {} \; + done +} + +do_install() { + copy_locale_files ${bindir} 0755 + copy_locale_files ${localedir} 0644 + if [ ${PACKAGE_NO_GCONV} -eq 0 ]; then + copy_locale_files ${libdir}/gconv 0755 + copy_locale_files ${datadir}/i18n 0644 + fi + copy_locale_files ${datadir}/locale 0644 + install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED } inherit libc-package