Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] buku: update to 4.7.
@ 2022-11-14 11:38 Eloitor
  2022-11-14 16:39 ` [PR PATCH] [Merged]: " paper42
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Eloitor @ 2022-11-14 11:38 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

There is a new pull request by Eloitor against master on the void-packages repository

https://github.com/Eloitor/void-packages buku
https://github.com/void-linux/void-packages/pull/40526

buku: update to 4.7.
#### Testing the changes
- I tested the changes in this PR: **YES**

It currently gives this warning:

```
/bin/buku:22: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi
```

It will be fixed in a future update: https://github.com/jarun/buku/commit/5de3c11e559c5700f62c8961460ce0497e3275fe

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)


A patch file from https://github.com/void-linux/void-packages/pull/40526.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-buku-40526.patch --]
[-- Type: text/x-diff, Size: 3436 bytes --]

From b7415061a098e31b2798b8e507f5cfea7dbf53ef Mon Sep 17 00:00:00 2001
From: Eloi Torrents <eloitor@disroot.org>
Date: Mon, 14 Nov 2022 12:41:55 +0100
Subject: [PATCH] buku: update to 4.7.

---
 .../patches/0001-Use-system-cacerts.patch     | 57 -------------------
 srcpkgs/buku/template                         |  4 +-
 2 files changed, 2 insertions(+), 59 deletions(-)
 delete mode 100644 srcpkgs/buku/patches/0001-Use-system-cacerts.patch

diff --git a/srcpkgs/buku/patches/0001-Use-system-cacerts.patch b/srcpkgs/buku/patches/0001-Use-system-cacerts.patch
deleted file mode 100644
index 3c7251165752..000000000000
--- a/srcpkgs/buku/patches/0001-Use-system-cacerts.patch
+++ /dev/null
@@ -1,57 +0,0 @@
-From 1f4c9edaedbc4bd270993c5a28ef6db3a378efed Mon Sep 17 00:00:00 2001
-From: Nathan Owens <ndowens@artixlinux.org>
-Date: Mon, 30 Nov 2020 15:43:56 -0600
-Subject: [PATCH] Use system cacerts
-
----
- buku | 9 +++++----
- 1 file changed, 5 insertions(+), 4 deletions(-)
-
-diff --git buku buku
-index 936988a..079d3d2 100755
---- a/buku
-+++ b/buku
-@@ -45,7 +45,6 @@ import threading
- import time
- from typing import Any, Dict, Iterable, List, Optional, Tuple
- import webbrowser
--import certifi
- import urllib3
- from urllib3.exceptions import LocationParseError
- from urllib3.util import parse_url, make_headers, Retry
-@@ -105,6 +104,8 @@ LOGGER = logging.getLogger()
- LOGDBG = LOGGER.debug
- LOGERR = LOGGER.error
- 
-+def where():
-+    return '/etc/ssl/certs/ca-certificates.crt'
- 
- class BukuCrypt:
-     """Class to handle encryption and decryption of
-@@ -2656,7 +2657,7 @@ class BukuDb:
-         if MYPROXY is None:
-             gen_headers()
- 
--        ca_certs = os.getenv('BUKU_CA_CERTS', default=certifi.where())
-+        ca_certs = os.getenv('BUKU_CA_CERTS', default=where())
-         if MYPROXY:
-             manager = urllib3.ProxyManager(
-                 MYPROXY,
-@@ -3628,7 +3629,7 @@ def get_PoolManager():
-     ProxyManager or PoolManager
-         ProxyManager if https_proxy is defined, PoolManager otherwise.
-     """
--    ca_certs = os.getenv('BUKU_CA_CERTS', default=certifi.where())
-+    ca_certs = os.getenv('BUKU_CA_CERTS', default=where())
-     if MYPROXY:
-         return urllib3.ProxyManager(MYPROXY, num_pools=1, headers=MYHEADERS, timeout=15,
-                                     cert_reqs='CERT_REQUIRED', ca_certs=ca_certs)
-@@ -4523,7 +4524,7 @@ def check_upstream_release():
-     if MYPROXY is None:
-         gen_headers()
- 
--    ca_certs = os.getenv('BUKU_CA_CERTS', default=certifi.where())
-+    ca_certs = os.getenv('BUKU_CA_CERTS', default=where())
-     if MYPROXY:
-         manager = urllib3.ProxyManager(
-             MYPROXY,
diff --git a/srcpkgs/buku/template b/srcpkgs/buku/template
index b2c1962d9195..d23f9addf74f 100644
--- a/srcpkgs/buku/template
+++ b/srcpkgs/buku/template
@@ -1,6 +1,6 @@
 # Template file for 'buku'
 pkgname=buku
-version=4.6
+version=4.7
 revision=1
 depends="python3-urllib3 python3-BeautifulSoup4 python3-cryptography
  python3-html5lib"
@@ -9,7 +9,7 @@ maintainer="Diogo Leal <diogo@diogoleal.com>"
 license="GPL-3.0-or-later"
 homepage="https://github.com/jarun/Buku"
 distfiles="https://github.com/jarun/Buku/archive/v${version}.tar.gz"
-checksum=2e1968016d3856184db8ac49cdc92a6c70869f62846185f28c8c60ead0c42888
+checksum=11d0860e66e0eea6c2ce566962ae0f8e34c76dc2317d108a4ae4e5a47097d468
 
 do_install() {
 	vbin buku

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PR PATCH] [Merged]: buku: update to 4.7.
  2022-11-14 11:38 [PR PATCH] buku: update to 4.7 Eloitor
@ 2022-11-14 16:39 ` paper42
  2022-11-15  9:10 ` Vinfall
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paper42 @ 2022-11-14 16:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 595 bytes --]

There's a merged pull request on the void-packages repository

buku: update to 4.7.
https://github.com/void-linux/void-packages/pull/40526

Description:
#### Testing the changes
- I tested the changes in this PR: **YES**

It currently gives this warning:

```
/bin/buku:22: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi
```

It will be fixed in a future update: https://github.com/jarun/buku/commit/5de3c11e559c5700f62c8961460ce0497e3275fe

#### Local build testing
- I built this PR locally for my native architecture, (x86_64-glibc)


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: buku: update to 4.7.
  2022-11-14 11:38 [PR PATCH] buku: update to 4.7 Eloitor
  2022-11-14 16:39 ` [PR PATCH] [Merged]: " paper42
@ 2022-11-15  9:10 ` Vinfall
  2022-11-15  9:12 ` Vinfall
  2022-11-15  9:43 ` paper42
  3 siblings, 0 replies; 5+ messages in thread
From: Vinfall @ 2022-11-15  9:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2047 bytes --]

New comment by Vinfall on void-packages repository

https://github.com/void-linux/void-packages/pull/40526#issuecomment-1315007211

Comment:
Hi, I made the fix PR for buku and was intended to make a PR in Void too XD.

How can I apply the patch in the srcpkg template? I checked https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md but it's not mentioned there.

Here is the patch generated using diff (and I don't see why the deleted [0001-Use-system-cacerts.patch](https://github.com/void-linux/void-packages/pull/40526/files#diff-6e78ba16f5c2d7f44e64e468d85373294be40a96480f1215549e8f639c5a742b) uses a different format):

```patch
--- a/buku	2022-11-15 08:58:58.241422014 +0000
+++ b/buku	2022-11-15 09:04:34.221396456 +0000
@@ -19,10 +19,10 @@
 
 import argparse
 import calendar
-import cgi
 import codecs
 import collections
 import contextlib
+import email.message
 import json
 import locale
 import logging
@@ -3811,15 +3811,17 @@
         if soup.meta and soup.meta.get('charset') is not None:
             charset = soup.meta.get('charset')
         elif 'content-type' in resp.headers:
-            _, params = cgi.parse_header(resp.headers['content-type'])
-            if params.get('charset') is not None:
-                charset = params.get('charset')
+            m = email.message.Message()
+            m['content-type'] = resp.headers['content-type']
+            if m.get_param('charset') is not None:
+                charset = m.get_param('charset')
 
         if not charset and soup:
             meta_tag = soup.find('meta', attrs={'http-equiv': 'Content-Type'})
             if meta_tag:
-                _, params = cgi.parse_header(meta_tag.attrs['content'])
-                charset = params.get('charset', charset)
+                m = email.message.Message()
+                m['content'] = meta_tag.attrs['content']
+                charset = m.get_param('charset', charset)
 
         if charset:
             LOGDBG('charset: %s', charset)
```


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: buku: update to 4.7.
  2022-11-14 11:38 [PR PATCH] buku: update to 4.7 Eloitor
  2022-11-14 16:39 ` [PR PATCH] [Merged]: " paper42
  2022-11-15  9:10 ` Vinfall
@ 2022-11-15  9:12 ` Vinfall
  2022-11-15  9:43 ` paper42
  3 siblings, 0 replies; 5+ messages in thread
From: Vinfall @ 2022-11-15  9:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1825 bytes --]

New comment by Vinfall on void-packages repository

https://github.com/void-linux/void-packages/pull/40526#issuecomment-1315007211

Comment:
Hi, I made the fix PR for buku and was intended to make a PR in Void too XD.

How can I apply the patch in the srcpkg template? I checked https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md but it's not mentioned there.

Here is the patch generated using diff:

```patch
--- a/buku	2022-11-15 08:58:58.241422014 +0000
+++ b/buku	2022-11-15 09:04:34.221396456 +0000
@@ -19,10 +19,10 @@
 
 import argparse
 import calendar
-import cgi
 import codecs
 import collections
 import contextlib
+import email.message
 import json
 import locale
 import logging
@@ -3811,15 +3811,17 @@
         if soup.meta and soup.meta.get('charset') is not None:
             charset = soup.meta.get('charset')
         elif 'content-type' in resp.headers:
-            _, params = cgi.parse_header(resp.headers['content-type'])
-            if params.get('charset') is not None:
-                charset = params.get('charset')
+            m = email.message.Message()
+            m['content-type'] = resp.headers['content-type']
+            if m.get_param('charset') is not None:
+                charset = m.get_param('charset')
 
         if not charset and soup:
             meta_tag = soup.find('meta', attrs={'http-equiv': 'Content-Type'})
             if meta_tag:
-                _, params = cgi.parse_header(meta_tag.attrs['content'])
-                charset = params.get('charset', charset)
+                m = email.message.Message()
+                m['content'] = meta_tag.attrs['content']
+                charset = m.get_param('charset', charset)
 
         if charset:
             LOGDBG('charset: %s', charset)
```


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: buku: update to 4.7.
  2022-11-14 11:38 [PR PATCH] buku: update to 4.7 Eloitor
                   ` (2 preceding siblings ...)
  2022-11-15  9:12 ` Vinfall
@ 2022-11-15  9:43 ` paper42
  3 siblings, 0 replies; 5+ messages in thread
From: paper42 @ 2022-11-15  9:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 224 bytes --]

New comment by paper42 on void-packages repository

https://github.com/void-linux/void-packages/pull/40526#issuecomment-1315050684

Comment:
Manual.md -> Handling patches

And please describe what the patch does at the top.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-11-15  9:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14 11:38 [PR PATCH] buku: update to 4.7 Eloitor
2022-11-14 16:39 ` [PR PATCH] [Merged]: " paper42
2022-11-15  9:10 ` Vinfall
2022-11-15  9:12 ` Vinfall
2022-11-15  9:43 ` paper42

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).