add Emby Theater

This commit is contained in:
Mario Fetka
2021-08-20 15:58:48 +02:00
parent e265aa7331
commit 123ebbf1df
69 changed files with 2066 additions and 75 deletions

View File

@@ -0,0 +1,36 @@
From b9e17e16cd55a43af90ab310380085911c131565 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org>
Date: Tue, 17 Mar 2020 19:45:26 +0100
Subject: [PATCH] [entropy.client] fix equo pkg quickpkg
- Python 3 fix
- re-encoding the path actually made it skip files with funny names
---
lib/entropy/client/interfaces/methods.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git lib/entropy/client/interfaces/methods.py lib/entropy/client/interfaces/methods.py
index 487a61d1b..89a45bb0e 100644
--- lib/entropy/client/interfaces/methods.py
+++ lib/entropy/client/interfaces/methods.py
@@ -2215,16 +2215,13 @@ class MiscMixin:
# collect files
for orig_path in contents:
- # convert back to filesystem str
- encoded_path = orig_path
- orig_path = const_convert_to_rawstring(orig_path)
strip_orig_path = orig_path.lstrip(os.path.sep)
path = os.path.join(shiftpath, strip_orig_path)
try:
exist = os.lstat(path)
except OSError:
continue # skip file
- ftype = entropy_package_metadata['content'][encoded_path]
+ ftype = entropy_package_metadata['content'][orig_path]
if str(ftype) == '0':
# force match below, '0' means databases without ftype
ftype = 'dir'
--
2.24.1

View File

@@ -0,0 +1,43 @@
From 08da648a202d3c8587fedf7ef83f557fef41e2d5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org>
Date: Wed, 18 Dec 2019 22:20:29 +0100
Subject: [PATCH] [entropy.client] fixes for "dictionary changed size during
iteration"
---
lib/entropy/client/interfaces/db.py | 4 ++--
lib/entropy/client/interfaces/dep.py | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git lib/entropy/client/interfaces/db.py lib/entropy/client/interfaces/db.py
index 7e7856e65..2a03580da 100644
--- lib/entropy/client/interfaces/db.py
+++ lib/entropy/client/interfaces/db.py
@@ -2564,8 +2564,8 @@ class MaskableRepository(EntropyRepositoryBase):
# if we get here, it means we didn't find a match in repositories
# so we scan packages, last chance
- for keyword in keyword_pkg.keys():
- # use .keys() because keyword_pkg gets modified during iteration
+ for keyword in list(keyword_pkg.keys()):
+ # use list() because keyword_pkg gets modified during iteration
# first of all check if keyword is in mykeywords
if keyword not in mykeywords:
diff --git lib/entropy/client/interfaces/dep.py lib/entropy/client/interfaces/dep.py
index 52bc611c1..ecbae5e4d 100644
--- lib/entropy/client/interfaces/dep.py
+++ lib/entropy/client/interfaces/dep.py
@@ -2855,7 +2855,8 @@ class CalculatorsMixin:
change = False
# now try to deeply remove unused packages
# iterate over a copy
- for pkg_match in deep_dep_map.keys():
+ # list() because the dict gets modified in setup_revdeps()
+ for pkg_match in list(deep_dep_map.keys()):
deep_dep_map[pkg_match] -= flat_dep_tree
if (not deep_dep_map[pkg_match]) and \
(pkg_match not in flat_dep_tree):
--
2.23.0

View File

@@ -0,0 +1,44 @@
From c06eb76644b1edfcfd614a279fa77a1278e717b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org>
Date: Sun, 9 Feb 2020 22:18:26 +0100
Subject: [PATCH] [entropy.server] gpg related fix for Python 3
With Python 3, data in sqlite from packagesignatures.gpg column was binary on
read (because it was binary on write) but a string was actually required.
The problem was visible with GPG signed packages: when injected into database
using eit with Python 3, it would then explode during equo update/install on
client side.
error from Python 2:
File "/usr/lib64/python2.7/site-packages/entropy/client/interfaces/package/actions/fetch.py", line 1063, in do_signatures_validation
if hash_val in signatures:
TypeError: writable buffers are not hashable
error from Python 3:
File "/usr/lib64/python3.6/site-packages/entropy/client/interfaces/package/actions/fetch.py", line 1023, in do_compare_gpg
tmp_f.write(hash_val)
TypeError: write() argument must be str, not bytes
---
lib/entropy/server/interfaces/main.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git lib/entropy/server/interfaces/main.py lib/entropy/server/interfaces/main.py
index 4a7103ff6..cac4fdb7e 100644
--- lib/entropy/server/interfaces/main.py
+++ lib/entropy/server/interfaces/main.py
@@ -7126,7 +7126,8 @@ class Server(Client):
return None
gpg_sign_path = repo_sec.sign_file(repo, pkg_path)
# read file content and add to 'gpg' signature
- with open(gpg_sign_path, "rb") as gpg_f:
+ enc = etpConst['conf_encoding']
+ with codecs.open(gpg_sign_path, "r", encoding = enc) as gpg_f:
gpg_signature = gpg_f.read()
os.remove(gpg_sign_path)
return gpg_signature
--
2.24.1

View File

@@ -0,0 +1,28 @@
From 0869912ec4c630d2946e835b2585367e233c1c15 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org>
Date: Wed, 12 Feb 2020 21:44:01 +0100
Subject: [PATCH] [entropy.spm] Rigo related Python 3 fix
File "/usr/lib64/python3.6/site-packages/entropy/spm/plugins/interfaces/portage_plugin/__init__.py", line 101, in _pusher
self._std.buffer.write(chunk)
AttributeError: 'FakeOutFile' object has no attribute 'buffer'
---
lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
index a23e46290..d6d624fb0 100644
--- lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
+++ lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
@@ -97,7 +97,7 @@ class StdoutSplitter(object):
break
raise
try:
- if const_is_python3():
+ if const_is_python3() and isinstance(self._std, io.TextIOWrapper):
self._std.buffer.write(chunk)
else:
self._std.write(chunk)
--
2.24.1

View File

@@ -0,0 +1,43 @@
(part of the commit)
From 8700aade27cb4117bf102afc7bd22ba6acfd8aa8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C5=82awomir=20Nizio?= <slawomir.nizio@sabayon.org>
Date: Tue, 11 Feb 2020 22:25:08 +0100
Subject: [PATCH] [entropy.spm, rigo] Rigo related Python 3 fixes
1)
File "/usr/lib/python-exec/python3.6/RigoDaemon_app.py", line 362, in _pusher
fobj.write(chunk)
TypeError: write() argument must be str, not bytes
2)
File "/usr/lib64/python3.6/site-packages/entropy/spm/plugins/interfaces/portage_plugin/__init__.py", line 77, in __init__
self.buffer = Writer(self, self._std.buffer)
AttributeError: 'FakeOutFile' object has no attribute 'buffer'
---
lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py | 4 +++-
rigo/RigoDaemon/app/RigoDaemon_app.py | 2 +-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
index 83dca0b6e..a23e46290 100644
--- lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
+++ lib/entropy/spm/plugins/interfaces/portage_plugin/__init__.py
@@ -10,6 +10,7 @@
"""
import os
+import io
import errno
import bz2
import hashlib
@@ -74,7 +75,8 @@ class StdoutSplitter(object):
self._buf.flush()
self._parent.flush()
- self.buffer = Writer(self, self._std.buffer)
+ if isinstance(self._std, io.TextIOWrapper):
+ self.buffer = Writer(self, self._std.buffer)
def __iter__(self):
return self._std

View File

@@ -0,0 +1,100 @@
(part of)
commit 0019b6e68af9bda8b368a7073e5eb927607f00e2
Author: Sławomir Nizio <slawomir.nizio@sabayon.org>
Date: Sat Mar 21 22:08:50 2020 +0100
[entropy.misc, rigo] fix file-like objects with Python 3
FakeOutFile and LogFile need .buffer like Python 3 "text" file objects
which is needed when in rigo standard output/error is replaced, and then
it reaches Portage which does this:
if sys.hexversion >= 0x3000000 and fd in (sys.stdout, sys.stderr):
fd = fd.buffer
fd.write(mystr)
(/usr/lib64/python3.6/site-packages/portage/util/__init__.py).
Entropy internal code did not need this.
Note, after this commit, changes done previously:
1)
commit 0869912ec4c630d2946e835b2585367e233c1c15
[entropy.spm] Rigo related Python 3 fix
File "/usr/lib64/python3.6/site-packages/entropy/spm/plugins/interfaces/portage_plugin/__init__.py", line 101, in _pusher
self._std.buffer.write(chunk)
AttributeError: 'FakeOutFile' object has no attribute 'buffer'
2)
commit 8700aade27cb4117bf102afc7bd22ba6acfd8aa8
[entropy.spm, rigo] Rigo related Python 3 fixes
1)
File "/usr/lib/python-exec/python3.6/RigoDaemon_app.py", line 362, in _pusher
fobj.write(chunk)
TypeError: write() argument must be str, not bytes
2)
File "/usr/lib64/python3.6/site-packages/entropy/spm/plugins/interfaces/portage_plugin/__init__.py", line 77, in __init__
self.buffer = Writer(self, self._std.buffer)
AttributeError: 'FakeOutFile' object has no attribute 'buffer'
(...)
could be likely reverted; not tested, it could be better to have them anyway to
avoid futher re/encoding/checks if conversions are needed (subjective).
Fixes bug 5899.
diff --git lib/entropy/misc.py lib/entropy/misc.py
index bb4a94af8..d216bd693 100644
--- lib/entropy/misc.py
+++ lib/entropy/misc.py
@@ -35,7 +35,8 @@ import threading
from collections import deque
from entropy.const import etpConst, const_isunicode, \
- const_isfileobj, const_convert_log_level, const_setup_file
+ const_isfileobj, const_convert_log_level, const_setup_file, \
+ const_convert_to_unicode
from entropy.exceptions import EntropyException
import entropy.tools
@@ -1665,6 +1666,24 @@ class FastRSS(object):
const_setup_file(self.__file, etpConst['entropygid'], 0o664)
+class FileobjCompatBuffer:
+
+ """
+ Compatibility shim for file object with the buffer attribute.
+ To be used with classes whose write method expect strings.
+ """
+
+ def __init__(self, parent):
+ self._parent = parent
+
+ def write(self, msg):
+ msg_str = const_convert_to_unicode(msg)
+ self._parent.write(msg_str)
+
+ def flush(self):
+ self._parent.flush()
+
+
class LogFile:
""" Entropy simple logging interface, works as file object """
@@ -1715,6 +1734,9 @@ class LogFile:
LogFile.DATE_FORMAT))
self.__logger.addHandler(self.__handler)
+ if const_is_python3():
+ self.buffer = FileobjCompatBuffer(self)
+
def __enter__(self):
"""
Just return self, configuration is done in __init__