From patchwork Fri Feb 8 00:56:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 157787 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp1339439jaa; Thu, 7 Feb 2019 16:56:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IZmTPsnHlCgH8JU9Sm6Kc4k+qmd5PGer/n3/OGThgpXbTCpocb3b4D/DVU0VFxRVoveorIG X-Received: by 2002:a63:2e88:: with SMTP id u130mr17878206pgu.9.1549587389389; Thu, 07 Feb 2019 16:56:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549587389; cv=none; d=google.com; s=arc-20160816; b=j5Yskd/5a/AP+Jj+ptk0j5TLwIL427as0o5WQRM2G7qzbCkcAjBEB4EAxhmOmPMQUy DwTm69Ca7BoYZ9YkbZZsWg40XIZwt9qjehuXFb+4keHh13tpQPBvZfNk9pcOgr/ihAl7 uJ1Y432FSroZB1BA0Uzm2kxjxt+X+J3Q+j1dg9/GaEkyfOrDlt3voQXiAS/xQutz4EOs Ox525xHayHdafrQ/48WdzTg3AGmKG14fy0DYnd/boOflb7C3EKlQEJY3wblt2UCD2HDo M004e8gQCSO8LgL+9fP4GmpAFx6XP8FQkDty9XiZCkU8hrgba4n84PiwvLOMZ9tjHRn3 QaHQ== 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=rvN/9yjLicmuSE7vSdHQLJajiSuK//4VRqMc30DH4SI=; b=Bqu0TIrOa6OSxTC4iPO0Q5EEPxDeFt35bmIs/lU7JQo+M8Ek7wks1aiAxgEGE4bp8X Lz9TrOTr2NLJnd4B+lrnC8lU6U9XrE2mTWddBuwc5hGqciMA+tZICInzpU/lC5bW2WJb y7XQXBjidCwPjU8nMZExsTlcbANiyqEnJnE64OqIVNJxFHWv594TbtRxj8VzpG9In7Cg KwKFODuC2KFzbKzmNWMT1WqgcL1IkiDTw4Hsovjq7R77uMr3Y6ZsmrstvH7OKpibtaHT jBbP/VAn9637h73G75nTwtEHQqjWyMSFG0gMAWuRsQnsNpPsOE3NzcR7jtbV3OOI1C9c Y0Jg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@gmail.com header.s=20161025 header.b="dx8WGx/V"; 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 133si574851pfc.61.2019.02.07.16.56.28; Thu, 07 Feb 2019 16:56:29 -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="dx8WGx/V"; 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 9DC487C4C3; Fri, 8 Feb 2019 00:56:22 +0000 (UTC) X-Original-To: openembedded-core@lists.openembedded.org Delivered-To: openembedded-core@lists.openembedded.org Received: from mail-pg1-f195.google.com (mail-pg1-f195.google.com [209.85.215.195]) by mail.openembedded.org (Postfix) with ESMTP id 7EF9C6B005 for ; Fri, 8 Feb 2019 00:56:20 +0000 (UTC) Received: by mail-pg1-f195.google.com with SMTP id y1so780049pgk.11 for ; Thu, 07 Feb 2019 16:56:21 -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=yiGxStsGSyUPp76ZCoXq2FVrJw2g8d7UFbsUiocjU5c=; b=dx8WGx/V9InE2BOat1Zy8L7hR3Z48sQTEN6YM6d2YaI+bDW5+YOlQD4InpAqykO7L+ VKsdpfphXUSdxKXBWTUc8AsiBWKTq0XCEzyyHBuh9osItA7ElIUizNhtYemDthakrsgH h/sA6suNlaQBEiQWH5n6TdWJgFpEQP9f+Tw8V7Jxwv8P0NaD4iBbCQReLsfc+/RLl9vR 39tvKK2MMNjV9Q3ft7RFn3Pv1hJU4L9Ld67TYpbm7o/Xe5BVzSZqLW3/SBfdgNYb0Ok9 MEJXOSyfYn8ikYbFMxwE0dwkrWZg6MjEnNqLqMt7cY2gzD8ckxpLXrvdlIZ7jmvWqjTM 1KSg== 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=yiGxStsGSyUPp76ZCoXq2FVrJw2g8d7UFbsUiocjU5c=; b=Eu7zBV8nMn0Y0jK2PMS6f5QrFRDYLSb14YO5CHXSasheI4x+7Kve3J9yGNwakqaiWY XpqFQSE7xjc2s63NiiKCEgKsksPhYHcX1N1KG+c/eBbESjCrMxnNutT1fk+O6lfJRLJL 4dc6fkbZZQWBVYlg1mbpiw2Q83/ADmPCqyOANoa+7ubrcRYHskYGr0UxuUkAUOR3zAwN rjIxP2QcT9HuJKw6EmJtILEiUouBHS0ALX79thh50Vf1/oS6vayybpRFbUdFJDW/4T4g 7wR4f0ARWOJA3mr/bqkH/7owVPHR8fJNeZDWfmtzwfe7tm8Ubt7TdTRqiEG7PVFtlrIS mJvw== X-Gm-Message-State: AHQUAuY5D7dT7RpgDuC9VH3xzTa2kW7L0276XqoDTz3OV9G25YSYsAUC oXqS3Fz4BlbFHgbWUfKQ4Oo3hQYZ X-Received: by 2002:a63:e051:: with SMTP id n17mr17731835pgj.258.1549587380992; Thu, 07 Feb 2019 16:56:20 -0800 (PST) Received: from apollo.hsd1.ca.comcast.net ([2601:646:8500:6bc6::a005]) by smtp.gmail.com with ESMTPSA id a13sm359113pgq.65.2019.02.07.16.56.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 Feb 2019 16:56:20 -0800 (PST) From: Khem Raj To: openembedded-core@lists.openembedded.org Date: Thu, 7 Feb 2019 16:56:11 -0800 Message-Id: <20190208005611.8039-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [OE-core] [PATCH] 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 --- meta/recipes-core/glibc/glibc-locale.inc | 41 ++++++++++++------------ 1 file changed, 20 insertions(+), 21 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..9cce61bf0b 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} +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 - cp -R --no-dereference --preserve=mode,links ${LOCALETREESRC}/SUPPORTED ${WORKDIR} + copy_locale_files ${datadir}/locale 0644 + install -m 0644 ${LOCALETREESRC}/SUPPORTED ${WORKDIR}/SUPPORTED } inherit libc-package