[planet-web/oscp] Patch needed as the override_encoding is not a valid param for the bundled html5lib



commit 2c2bc1b77fb1559cc6e402e30a0d2f8803f7ad5f
Author: Andrea Veri <averi redhat com>
Date:   Wed Jan 20 18:37:20 2021 +0100

    Patch needed as the override_encoding is not a valid param for the bundled html5lib

 Dockerfile                                     |  6 +++++-
 patches/00_override_encoding_to_encoding.patch | 12 ++++++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/Dockerfile b/Dockerfile
index 85ef21c9..b90d02ae 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -2,7 +2,7 @@ FROM debian:10-slim
 ARG DEBIAN_FRONTEND=noninteractive
 
 RUN apt-get update && \
-    apt-get install -y --no-install-recommends planet-venus git nginx-light xsltproc && \
+    apt-get install -y --no-install-recommends planet-venus git nginx-light xsltproc patch && \
     apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
 
 RUN ln -sf /dev/stdout /var/log/nginx/access.log && \
@@ -14,6 +14,10 @@ RUN groupadd planet -g 1000510000 && useradd planet -g 1000510000 -u 1000510000
     mkdir /planet/vendor && mv /planet/venus/planet/vendor/html5lib /planet/vendor && rm -rf /planet/venus 
&& \
     chown -R 1000510000:100051000 /planet
 
+COPY patches/00_override_encoding_to_encoding.patch /planet/00_override_encoding_to_encoding.patch
+RUN cd /usr/lib/python2.7/dist-packages/planet && patch -p0 < /planet/00_override_encoding_to_encoding.patch 
&& \
+    rm /planet/00_override_encoding_to_encoding.patch
+
 RUN mkdir -p /var/cache/planet-venus/theme/common && \
     cp -r /usr/share/planet-venus/theme/common/* /var/cache/planet-venus/theme/common/ && \
     chown -R 1000510000:100051000 /var/cache/planet-venus/theme/common
diff --git a/patches/00_override_encoding_to_encoding.patch b/patches/00_override_encoding_to_encoding.patch
new file mode 100644
index 00000000..27e84d02
--- /dev/null
+++ b/patches/00_override_encoding_to_encoding.patch
@@ -0,0 +1,12 @@
+--- ./reconstitute.py  2018-10-25 13:43:54.000000000 +0000
++++ ./reconstitute.py  2021-01-20 17:28:45.665939626 +0000
+@@ -167,7 +167,7 @@
+ 
+     if detail.type.find('xhtml')<0 or bozo:
+         parser = html5parser.HTMLParser(tree=treebuilders.getTreeBuilder('dom'))
+-        html = parser.parse(xdiv % detail.value, override_encoding="utf-8")
++        html = parser.parse(xdiv % detail.value, encoding="utf-8")
+         for body in html.documentElement.childNodes:
+             if body.nodeType != Node.ELEMENT_NODE: continue
+             if body.nodeName != 'body': continue
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]