summaryrefslogtreecommitdiffstats
path: root/pym/portage/tests/emerge
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2011-09-03 16:46:09 -0700
committerZac Medico <zmedico@gentoo.org>2011-09-03 16:46:09 -0700
commita62537685afbe492d4686cb6a636cbe556fe74d9 (patch)
tree6209e4af4841a29003f2485ae0654a0df9216ec0 /pym/portage/tests/emerge
parentfe01dc23324660ae18c732cfacd458c3faf50ad7 (diff)
downloadportage-a62537685afbe492d4686cb6a636cbe556fe74d9.tar.gz
portage-a62537685afbe492d4686cb6a636cbe556fe74d9.tar.bz2
portage-a62537685afbe492d4686cb6a636cbe556fe74d9.zip
Handle symlink content with bad encoding.
This will fix bug #381629. The case is tested in tests/emerge. During forced charset conversion, 'ascii' codec is forced, since otherwise we somehow end up with the wrongly encoded file names when running the test with Python 3.2 (which causes encoding problems for quickpkg when it calls tarfile.gettarinfo).
Diffstat (limited to 'pym/portage/tests/emerge')
-rw-r--r--pym/portage/tests/emerge/test_simple.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/pym/portage/tests/emerge/test_simple.py b/pym/portage/tests/emerge/test_simple.py
index 038192e01..cfb6cae55 100644
--- a/pym/portage/tests/emerge/test_simple.py
+++ b/pym/portage/tests/emerge/test_simple.py
@@ -23,8 +23,18 @@ src_install() {
einfo "installing something..."
# TODO: Add prefix support to shell code/helpers, so we
# can use things like dodir and doins here.
- mkdir -p "${ED}"/usr/lib/${P}
- echo "blah blah blah" > "${ED}"/usr/lib/${P}/regular-file
+ mkdir -p "${ED}"/usr/lib/${P} || die
+ echo "blah blah blah" > "${ED}"/usr/lib/${P}/regular-file || die
+ ln -s regular-file "${ED}"/usr/lib/${P}/symlink || die
+
+ # Test code for bug #381629, using a copyright symbol encoded with latin-1.
+ # We use $(printf "\\xa9") rather than $'\\xa9', since printf apparently
+ # works in any case, while $'\\xa9' transforms to \\xef\\xbf\\xbd under
+ # some conditions. TODO: Find out why it transforms to \\xef\\xbf\\xbd when
+ # running tests for Python 3.2 (even though it's bash that is ultimately
+ # responsible for performing the transformation).
+ echo "blah blah blah" > "${ED}"/usr/lib/${P}/latin-1-$(printf "\\xa9")-regular-file || die
+ ln -s latin-1-$(printf "\\xa9")-regular-file "${ED}"/usr/lib/${P}/latin-1-$(printf "\\xa9")-symlink || die
}
"""