git: 3a978f1c8a56 - main - ports-mgmt/distilator: Fix warnings emitted by python 3.8

Emanuel Haupt ehaupt at FreeBSD.org
Fri May 7 06:32:07 UTC 2021


The branch main has been updated by ehaupt:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3a978f1c8a56703f903ba1101cbeac47dcd84382

commit 3a978f1c8a56703f903ba1101cbeac47dcd84382
Author:     Emanuel Haupt <ehaupt at FreeBSD.org>
AuthorDate: 2021-05-07 06:29:51 +0000
Commit:     Emanuel Haupt <ehaupt at FreeBSD.org>
CommitDate: 2021-05-07 06:29:51 +0000

    ports-mgmt/distilator: Fix warnings emitted by python 3.8
    
    PR:             255672
    Reported by:    yuri
---
 ports-mgmt/distilator/Makefile                  |  1 +
 ports-mgmt/distilator/files/patch-distilator.py | 38 +++++++++++++++++++++++++
 2 files changed, 39 insertions(+)

diff --git a/ports-mgmt/distilator/Makefile b/ports-mgmt/distilator/Makefile
index 9e7542c8c867..ce221aae46bc 100644
--- a/ports-mgmt/distilator/Makefile
+++ b/ports-mgmt/distilator/Makefile
@@ -2,6 +2,7 @@
 
 PORTNAME=	distilator
 PORTVERSION=	1.3
+PORTREVISION=	1
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	https://critical.ch/distilator/ \
 		LOCAL/ehaupt
diff --git a/ports-mgmt/distilator/files/patch-distilator.py b/ports-mgmt/distilator/files/patch-distilator.py
new file mode 100644
index 000000000000..1a7cfdecbe17
--- /dev/null
+++ b/ports-mgmt/distilator/files/patch-distilator.py
@@ -0,0 +1,38 @@
+--- distilator.py.orig	2020-07-18 07:41:39 UTC
++++ distilator.py
+@@ -1,8 +1,6 @@
+ #!/usr/bin/env python
+ """Command-line script to check the availability of a ports distfiles."""
+ 
+-from __future__ import print_function  # Imports print_function from python 3
+-
+ from multiprocessing import Pool
+ from functools import partial
+ 
+@@ -38,7 +36,7 @@ class Distfiles:
+         valid_urls = []
+         for url in urls:
+             thisurl = urlparse(url)
+-            if thisurl.scheme is not "":
++            if thisurl.scheme != "":
+                 valid_urls.append(thisurl.geturl())
+         return valid_urls
+ 
+@@ -129,7 +127,7 @@ def resolve_or_timeout_error(url, urltype, args):
+ def validate_url_pool(args, iterable):
+     """Method to validate a list of URLs."""
+     for url, urltype in iterable.items():
+-        if urlparse(url).scheme is "http" or "https":
++        if urlparse(url).scheme == "http" or "https":
+             try:
+                 user_agent = "distilator/%s (%s)" % (__version__, os.uname()[0])
+                 headers = {"User-Agent": user_agent}
+@@ -160,7 +158,7 @@ def validate_url_pool(args, iterable):
+                 status_code = resolve_or_timeout_error(url, urltype, args)
+                 return {"status_code": status_code, "urltype": urltype, "url": url}
+ 
+-        if urlparse(url).scheme is "ftp":
++        if urlparse(url).scheme == "ftp":
+             try:
+                 requests_ftp.monkeypatch_session()
+                 session = requests.Session()


More information about the dev-commits-ports-all mailing list