kumquat-buildroot/support/scripts
Yann E. MORIN 5563a1c6a4 support/check-uniq-files: support weird locales and filenames
Currently, when a filename contains characters not representable in the
user's locale, we fail hard, especially when the host python is python3.

This is because python2 and python3 handle encoding/decoding strings
differently, with python3 presumable doing the right thing, but it
breaks on some systems, while python2 presumable does the wrong thing,
but it works everywhere. (Just joking, obviously...)

Part of the issue being that the csv reader in python2 is broken with
UTF8.

We fix the issue by ditching the csv reader, and simply read the file in
binary mode, manually partitioning the lines on the first comma.

Then, we use the binary-encoded (really, un-encoded) package names and
filenames as values and keys, respectively.

Finally, for each filename or package we need to print, we try to decode
them with the defaults for the user settings, but catch any decoding
exception and fall back to dumping the raw, binary values. Which codec
is used by default differs between Python version, but in all cases
something sane is printed at least.

Thanks a lot to Arnout for the live help doing this patch. :-)

Reported-by: Jaap Crezee <jaap@jcz.nl>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Arnout Vandecappelle <arnout@mind.be>
Cc: Jaap Crezee <jaap@jcz.nl>
[Arnout: commit log improvement]
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
2018-03-31 15:32:00 +02:00
..
apply-patches.sh support/scripts/apply-patches.sh: do not apply patches with renames 2017-09-19 22:51:25 +02:00
br2-external support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
brpkgutil.py graph-depends: fix code style 2018-01-29 23:14:24 +01:00
check-bin-arch support/check-bin-arch: exclude kernel modules for merged /usr 2018-03-07 23:03:52 +01:00
check-host-rpath support/check-rpath: recognise PIE 2017-09-27 00:13:55 +02:00
check-kernel-headers.sh
check-uniq-files support/check-uniq-files: support weird locales and filenames 2018-03-31 15:32:00 +02:00
eclipse-register-toolchain eclipse-register-toolchain: toolchain is no longer installed in $(HOST_DIR)/usr 2017-07-05 16:06:27 +02:00
expunge-gconv-modules
fix-configure-powerpc64.sh support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
fix-rpath support/scripts/fix-rpath: typo fix and unneeded "; " removed 2017-07-22 14:38:43 +02:00
genimage.sh support/scripts/genimage.sh: show usage when invoked incorrectly 2017-12-11 20:14:39 +01:00
graph-build-time graph-build-time: fix code style 2018-01-29 23:14:24 +01:00
graph-depends graph-depends: fix code style 2018-01-29 23:14:24 +01:00
hardlink-or-copy support/scripts: fix shebang with bash 2017-06-08 21:43:05 +02:00
mkmakefile Makefile: Remove 'quiet' variable 2015-10-29 00:04:05 +01:00
mkusers support/scripts: allow /etc/shadow to be symlinked 2017-06-24 17:49:48 +02:00
pkg-stats pkg-stats: add exception for nvidia-tegra23.mk 2017-07-06 21:46:04 +02:00
pycompile.py pycompile: fix code style 2018-01-29 23:14:24 +01:00
setlocalversion setlocalversion: fix detection of hg revision for untagged versions 2017-07-03 11:40:49 +02:00
size-stats size-stats: fix code style 2018-01-29 23:14:24 +01:00
xorg-release support/scripts: fix shebang with python 2017-06-07 21:55:10 +02:00