Skip to content

Commit 2d9e3e3

Browse files
authored
Merge branch 'main' into add-management-commands
2 parents a5271c3 + 807e5de commit 2d9e3e3

10 files changed

Lines changed: 30 additions & 28 deletions

File tree

debian/copyright

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Source: https://github.com/furlongm/patchman
66
Files: *
77
Copyright: 2011-2012 VPAC http://www.vpac.org
88
2013-2021 Marcus Furlong <[email protected]>
9-
License: GPL-3.0
9+
License: GPL-3.0-only
1010
This package is free software; you can redistribute it and/or modify
1111
it under the terms of the GNU General Public License as published by
1212
the Free Software Foundation; version 3 only.

hosts/templatetags/report_alert.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
# Copyright 2016-2021 Marcus Furlong <[email protected]>
1+
# Copyright 2016-2025 Marcus Furlong <[email protected]>
22
#
33
# This file is part of Patchman.
44
#
55
# Patchman is free software: you can redistribute it and/or modify
66
# it under the terms of the GNU General Public License as published by
7-
# the Free Software Foundation, either version 3 of the License, or
8-
# (at your option) any later version.
7+
# the Free Software Foundation, version 3 only.
98
#
109
# Patchman is distributed in the hope that it will be useful,
1110
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1211
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1312
# GNU General Public License for more details.
1413
#
1514
# You should have received a copy of the GNU General Public License
16-
# along with Patchman If not, see <http://www.gnu.org/licenses/>.
15+
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1716

1817
from datetime import timedelta
1918

modules/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
def get_or_create_module(name, stream, version, context, arch, repo):
2525
""" Get or create a module object
26-
Returns the module and a boolean for created
26+
Returns the module
2727
"""
2828
created = False
2929
m_arch, c = PackageArchitecture.objects.get_or_create(name=arch)
@@ -46,7 +46,7 @@ def get_or_create_module(name, stream, version, context, arch, repo):
4646
arch=m_arch,
4747
repo=repo,
4848
)
49-
return module, created
49+
return module
5050

5151

5252
def get_matching_modules(name, stream, version, context, arch):

packages/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,11 +195,11 @@ def __str__(self):
195195
rel = f'-{self.release}'
196196
else:
197197
rel = ''
198-
if self.packagetype == self.GENTOO:
198+
if self.packagetype == Package.GENTOO:
199199
return f'{self.category}/{self.name}-{epo}{self.version}{rel}-{self.arch}.{self.get_packagetype_display()}'
200-
elif self.packagetype in [self.DEB, self.ARCH]:
200+
elif self.packagetype in [Package.DEB, Package.ARCH]:
201201
return f'{self.name}_{epo}{self.version}{rel}_{self.arch}.{self.get_packagetype_display()}'
202-
elif self.packagetype == self.RPM:
202+
elif self.packagetype == Package.RPM:
203203
return f'{self.name}-{epo}{self.version}{rel}-{self.arch}.{self.get_packagetype_display()}'
204204
else:
205205
return f'{self.name}-{epo}{self.version}{rel}-{self.arch}.{self.get_packagetype_display()}'

repos/repo_types/yum.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def extract_module_metadata(data, url, repo):
9191
packages.add(package)
9292

9393
from modules.utils import get_or_create_module
94-
module, created = get_or_create_module(m_name, m_stream, m_version, m_context, arch, repo)
94+
module = get_or_create_module(m_name, m_stream, m_version, m_context, arch, repo)
9595

9696
package_ids = []
9797
for package in packages:

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
Django==4.2.20
1+
Django==4.2.25
22
django-taggit==4.0.0
33
django-extensions==3.2.3
44
django-bootstrap3==23.1
55
python-debian==1.0.1
66
defusedxml==0.7.1
77
PyYAML==6.0.2
8-
chardet==5.2.0
9-
requests==2.32.3
8+
requests==2.32.4
109
colorama==0.4.6
1110
djangorestframework==3.15.2
1211
django-filter==25.1
@@ -16,7 +15,7 @@ python-magic==0.4.27
1615
gitpython==3.1.44
1716
tenacity==8.2.3
1817
celery==5.4.0
19-
redis==5.2.1
18+
redis==6.4.0
2019
django-celery-beat==2.7.0
2120
tqdm==4.67.1
2221
cvss==3.4

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env python3
22
#
3-
# Copyright 2013-2021 Marcus Furlong <[email protected]>
3+
# Copyright 2013-2025 Marcus Furlong <[email protected]>
44
#
55
# This file is part of Patchman.
66
#

util/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import magic
2121
import zlib
2222
import lzma
23+
import os
2324
from datetime import datetime, timezone
2425
from enum import Enum
2526
from hashlib import md5, sha1, sha256, sha512
@@ -28,17 +29,23 @@
2829
from time import time
2930
from tqdm import tqdm
3031

31-
from patchman.signals import error_message, info_message, debug_message
32-
3332
from django.utils.timezone import make_aware
3433
from django.utils.dateparse import parse_datetime
3534
from django.conf import settings
3635

36+
from patchman.signals import error_message, info_message, debug_message
3737

3838
pbar = None
3939
verbose = None
4040
Checksum = Enum('Checksum', 'md5 sha sha1 sha256 sha512')
4141

42+
http_proxy = os.getenv('http_proxy')
43+
https_proxy = os.getenv('https_proxy')
44+
proxies = {
45+
'http': http_proxy,
46+
'https': https_proxy,
47+
}
48+
4249

4350
def get_verbosity():
4451
""" Get the global verbosity level
@@ -113,7 +120,7 @@ def get_url(url, headers={}, params={}):
113120
response = None
114121
try:
115122
debug_message.send(sender=None, text=f'Trying {url} headers:{headers} params:{params}')
116-
response = requests.get(url, headers=headers, params=params, stream=True, timeout=30)
123+
response = requests.get(url, headers=headers, params=params, stream=True, proxies=proxies, timeout=30)
117124
debug_message.send(sender=None, text=f'{response.status_code}: {response.headers}')
118125
if response.status_code in [403, 404]:
119126
return response

util/filterspecs.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
# Copyright 2010 VPAC
2-
# Copyright 2014-2021 Marcus Furlong <[email protected]>
2+
# Copyright 2014-2025 Marcus Furlong <[email protected]>
33
#
44
# This file is part of Patchman.
55
#
66
# Patchman is free software: you can redistribute it and/or modify
77
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
8+
# the Free Software Foundation, version 3 only.
109
#
1110
# Patchman is distributed in the hope that it will be useful,
1211
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1312
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1413
# GNU General Public License for more details.
1514
#
1615
# You should have received a copy of the GNU General Public License
17-
# along with Patchman If not, see <http://www.gnu.org/licenses/>.
16+
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1817

1918
from django.utils.safestring import mark_safe
2019
from django.db.models.query import QuerySet

util/templatetags/common.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,18 @@
1-
# Copyright 2010 VPAC
2-
# Copyright 2013-2021 Marcus Furlong <[email protected]>
1+
# Copyright 2013-2025 Marcus Furlong <[email protected]>
32
#
43
# This file is part of Patchman.
54
#
65
# Patchman is free software: you can redistribute it and/or modify
76
# it under the terms of the GNU General Public License as published by
8-
# the Free Software Foundation, either version 3 of the License, or
9-
# (at your option) any later version.
7+
# the Free Software Foundation, version 3 only.
108
#
119
# Patchman is distributed in the hope that it will be useful,
1210
# but WITHOUT ANY WARRANTY; without even the implied warranty of
1311
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1412
# GNU General Public License for more details.
1513
#
1614
# You should have received a copy of the GNU General Public License
17-
# along with Patchman If not, see <http://www.gnu.org/licenses/>.
15+
# along with Patchman. If not, see <http://www.gnu.org/licenses/>
1816

1917
import re
2018

0 commit comments

Comments
 (0)