diff options
author | Ross Burton <ross.burton@intel.com> | 2016-07-05 17:41:24 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-07-10 14:12:17 +0100 |
commit | 586249ac8387885a29315e8fe332fab475c7a2da (patch) | |
tree | d02d87954ffb9019e561f1d1afa4b7aeb11c5012 | |
parent | e2a150b1f957a669e0d6c9b908cf2234447e5dd4 (diff) | |
download | poky-586249ac8387885a29315e8fe332fab475c7a2da.tar.gz |
classes/libc-package: remove pointless copying when running localedef
localedef handles attempts to read/write the archive in parallel correctly by
creating the file atomically, gracefully handling racing to create, and has
exclusive locks when writing. Therefore I can't see any purpose to copying the
archive to /tmp and back again when manipulating it.
(From OE-Core rev: 016e4a53e3251ffcdb3c260dd2837507b520ffa6)
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | meta/classes/libc-package.bbclass | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/meta/classes/libc-package.bbclass b/meta/classes/libc-package.bbclass index 8349c2d3c0..c1781c64b4 100644 --- a/meta/classes/libc-package.bbclass +++ b/meta/classes/libc-package.bbclass | |||
@@ -47,7 +47,6 @@ python __anonymous () { | |||
47 | 47 | ||
48 | OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}" | 48 | OVERRIDES_append = ":${TARGET_ARCH}-${TARGET_OS}" |
49 | 49 | ||
50 | # indentation removed on purpose | ||
51 | locale_base_postinst() { | 50 | locale_base_postinst() { |
52 | #!/bin/sh | 51 | #!/bin/sh |
53 | 52 | ||
@@ -55,33 +54,14 @@ if [ "x$D" != "x" ]; then | |||
55 | exit 1 | 54 | exit 1 |
56 | fi | 55 | fi |
57 | 56 | ||
58 | rm -rf ${TMP_LOCALE} | 57 | localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s %s |
59 | mkdir -p ${TMP_LOCALE} | ||
60 | if [ -f ${localedir}/locale-archive ]; then | ||
61 | cp ${localedir}/locale-archive ${TMP_LOCALE}/ | ||
62 | fi | ||
63 | localedef --inputfile=${datadir}/i18n/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
64 | mkdir -p ${localedir}/ | ||
65 | mv ${TMP_LOCALE}/locale-archive ${localedir}/ | ||
66 | rm -rf ${TMP_LOCALE} | ||
67 | } | 58 | } |
68 | 59 | ||
69 | # indentation removed on purpose | ||
70 | locale_base_postrm() { | 60 | locale_base_postrm() { |
71 | #!/bin/sh | 61 | #!/bin/sh |
72 | 62 | localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s %s | |
73 | rm -rf ${TMP_LOCALE} | ||
74 | mkdir -p ${TMP_LOCALE} | ||
75 | if [ -f ${localedir}/locale-archive ]; then | ||
76 | cp ${localedir}/locale-archive ${TMP_LOCALE}/ | ||
77 | fi | ||
78 | localedef --delete-from-archive --inputfile=${datadir}/locales/%s --charmap=%s --prefix=/tmp/locale %s | ||
79 | mv ${TMP_LOCALE}/locale-archive ${localedir}/ | ||
80 | rm -rf ${TMP_LOCALE} | ||
81 | } | 63 | } |
82 | 64 | ||
83 | |||
84 | TMP_LOCALE="/tmp/locale${localedir}" | ||
85 | LOCALETREESRC ?= "${PKGD}" | 65 | LOCALETREESRC ?= "${PKGD}" |
86 | 66 | ||
87 | do_prep_locale_tree() { | 67 | do_prep_locale_tree() { |