Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCHv3 02/12] toolchain-external: fix broken handling of 'usr/lib/locale'
Date: Tue,  7 Feb 2017 22:56:39 +0100	[thread overview]
Message-ID: <20170207215649.364-3-patrickdepinguin@gmail.com> (raw)
In-Reply-To: <20170207215649.364-1-patrickdepinguin@gmail.com>

From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

Function copy_toolchain_sysroot, which is in charge of copying the relevant
bits from the external toolchain to the staging directory, performs an rsync
loop of various directories and excludes the pattern 'usr/lib/locale' with
the intention of skipping the directory <toolchain>/usr/lib/locale.

However, while this worked in the original commit, commit
5628776c4a4d29d0715633ea463b64cc19e19c5a broke it inadvertently. The
relevant part of the diff:

-    rsync -au --chmod=Du+w --exclude 'usr/lib/locale' \
-          $${ARCH_SYSROOT_DIR}/$$i $(STAGING_DIR)/ ; \
+    rsync -au --chmod=Du+w --exclude 'usr/lib/locale' \
+          --exclude lib --exclude lib32 --exclude lib64 \
+          $${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \

Notice how the source directory now contains a trailing slash, which impacts
the way the exclude rules are interpreted. Previously, when 'i' was 'usr',
the exclude of 'usr/lib/locale' would find a match. With the trailing slash,
there will never be a match, unless for a directory 'usr/usr/lib/locale'.
The right rule would have been '--exclude lib/locale'.

However, just that fix does not solve the problem in all cases, in
particular in the (common) case where ARCH_LIB_DIR is 'lib'. This is due
another change in that commit, changing the iterated values of the above
rsync:

- for i in etc $${ARCH_LIB_DIR} sbin usr ; do \
+ for i in etc $${ARCH_LIB_DIR} sbin usr usr/$${ARCH_LIB_DIR}; do \

Due to the fact that we rsync both 'usr' as 'usr/lib' (assuming ARCH_LIB_DIR
is 'lib') we need to add the correct exclude in both cases. But the exclude
is different for both. When i == 'usr', the correct exclude rule would be
'--exclude lib/locale' while when i == 'usr/lib' the correct rule would be
'--exclude locale'.

Since we would like to avoid separate cases for this, use the following
exclude: '--exclude locale/'. The trailing slash will make sure only
directories called 'locale' will match. The targeted directories are then
usr/lib/locale and usr/share/locale. The latter directory was not matched
originally, but it should not hurt changing that.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
v3: new patch

 toolchain/helpers.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk
index 8cae996..6f87230 100644
--- a/toolchain/helpers.mk
+++ b/toolchain/helpers.mk
@@ -92,7 +92,7 @@ copy_toolchain_sysroot = \
 		if [ ! -d $${ARCH_SYSROOT_DIR}/$$i ] ; then \
 			continue ; \
 		fi ; \
-		rsync -au --chmod=u=rwX,go=rX --exclude 'usr/lib/locale' \
+		rsync -au --chmod=u=rwX,go=rX --exclude 'locale/' \
 			--include '/libexec*/' --exclude '/lib*/' \
 			$${ARCH_SYSROOT_DIR}/$$i/ $(STAGING_DIR)/$$i/ ; \
 	done ; \
-- 
2.10.2

  parent reply	other threads:[~2017-02-07 21:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 21:56 [Buildroot] [PATCHv3 00/12] toolchain: improvements to copy_toolchain_sysroot and copy_toolchain_lib_root Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 01/12] toolchain-external: reduce nesting in copy_toolchain_sysroot Thomas De Schampheleire
2017-03-01 22:22   ` Thomas Petazzoni
2017-02-07 21:56 ` Thomas De Schampheleire [this message]
2017-03-01 22:34   ` [Buildroot] [PATCHv3 02/12] toolchain-external: fix broken handling of 'usr/lib/locale' Thomas Petazzoni
2017-02-07 21:56 ` [Buildroot] [PATCHv3 03/12] toolchain-external: clarify rsync excludes in copy_toolchain_sysroot Thomas De Schampheleire
2017-02-07 23:03   ` Romain Naour
2017-02-08  9:22     ` Thomas De Schampheleire
2017-02-08  9:45       ` Thomas Petazzoni
2017-02-07 21:56 ` [Buildroot] [PATCHv3 04/12] toolchain-external: handle ld.so fixups centrally Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 05/12] toolchain helpers: introduce function relpath_prefix Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 06/12] toolchain-external: cover multilib toolchains with lib/<variant> layout Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 07/12] toolchain helpers: introduce simplify_symlink Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 08/12] toolchain-external: simplify previously-broken symbolic links Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 09/12] toolchain: copy_toolchain_lib_root: remove unused variable LIBDIR Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 10/12] toolchain: copy_toolchain_lib_root: clarify logic Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 11/12] toolchain: copy_toolchain_lib_root: clarify input parameter Thomas De Schampheleire
2017-02-07 21:56 ` [Buildroot] [PATCHv3 12/12] toolchain: copy_toolchain_lib_root: copy symlinks instead of recreating them Thomas De Schampheleire
2017-04-05 19:54 ` [Buildroot] [PATCHv3 00/12] toolchain: improvements to copy_toolchain_sysroot and copy_toolchain_lib_root Thomas Petazzoni
2017-04-05 20:15   ` Thomas De Schampheleire
2017-04-06 17:09     ` Thomas Petazzoni
2017-04-06 17:51       ` Thomas De Schampheleire

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207215649.364-3-patrickdepinguin@gmail.com \
    --to=patrickdepinguin@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox