diff --git a/.travis.yml b/.travis.yml index b2049a675..0cb37cfe8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,11 @@ before_install: script: - > docker run -v $TRAVIS_BUILD_DIR:/entropy sabayon/base-amd64 - bash -c "equo i dev-util/bsdiff; cd /entropy/lib/tests && LC_ALL=en_US.UTF-8 USERNAME=root ETP_TESTS_NONINTERACTIVE=1 ./run" + bash -c "python2 --version; python3 --version" +- > + docker run -v $TRAVIS_BUILD_DIR:/entropy sabayon/base-amd64 + env LC_ALL=en_US.UTF-8 USERNAME=root ETP_TESTS_NONINTERACTIVE=1 + bash -c 'equo i dev-util/bsdiff; cd /entropy/lib/tests && ret=0 && { python2 ./run || ret=$?; python3 ./run || ret=$?; }; exit $ret' notifications: irc: "chat.freenode.net#sabayon-infra" diff --git a/lib/entropy/tools.py b/lib/entropy/tools.py index dbec9d7ea..ee31d9b94 100644 --- a/lib/entropy/tools.py +++ b/lib/entropy/tools.py @@ -1098,7 +1098,7 @@ def universal_uncompress(compressed_file, dest_path, catch_empty = False): for tarinfo in directories: epath = os.path.join(dest_path, tarinfo.name) try: - tar.chown(tarinfo, epath) + _tarfile_chown(tar, tarinfo, epath) # this is mandatory on uid/gid that don't exist # and in this strict order !! @@ -2036,6 +2036,13 @@ def _fix_uid_gid(tarinfo, epath): except OSError: pass +def _tarfile_chown(tar, tarinfo, targetpath): + if const_is_python3(): + return tar.chown(tarinfo, targetpath, + numeric_owner=False) + else: + return tar.chown(tarinfo, targetpath) + def apply_tarball_ownership(filepath, prefix_path): """ Given an already extracted tarball available at prefix_path, and the @@ -2064,7 +2071,7 @@ def apply_tarball_ownership(filepath, prefix_path): epath = os.path.join(encoded_path, tarinfo.name) try: - tar.chown(tarinfo, epath) + _tarfile_chown(tar, tarinfo, epath) _fix_uid_gid(tarinfo, epath) if not os.path.islink(epath): # make sure we keep the same permissions @@ -2107,7 +2114,7 @@ def uncompress_tarball(filepath, extract_path = None, catch_empty = False): def _setup_file_metadata(tarinfo, epath): try: - tar.chown(tarinfo, epath) + _tarfile_chown(tar, tarinfo, epath) _fix_uid_gid(tarinfo, epath) # no longer touch utime using Tarinfo, behaviour seems diff --git a/lib/tests/db.py b/lib/tests/db.py index 6d851d479..fec0a7f36 100644 --- a/lib/tests/db.py +++ b/lib/tests/db.py @@ -873,7 +873,7 @@ class EntropyRepositoryTest(unittest.TestCase): assert set(data.keys()) == set(db_data.keys()) for k, v in data.items(): if v != db_data[k]: - print k, v, "vs", db_data[k] + print(k, v, "vs", db_data[k]) self.assertEqual(data, db_data) set_mute(True)