Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
248 commits
Select commit Hold shift + click to select a range
931042e
Update version-utils from 0.3.0 to 0.3.2
pyup-bot May 6, 2022
a957f83
Update python-magic from 0.4.25 to 0.4.27
pyup-bot Jun 7, 2022
8fa1fbf
Update colorama from 0.4.4 to 0.4.6
pyup-bot Oct 25, 2022
3f3c676
Update python-debian from 0.1.43 to 0.1.49
pyup-bot Nov 20, 2022
f88d88b
Update chardet from 4.0.0 to 5.1.0
pyup-bot Dec 2, 2022
9f26b1e
Update django-extensions from 3.1.5 to 3.2.3
pyup-bot Jun 5, 2023
41ae867
Update pyyaml from 6.0.1 to 6.0.2
pyup-bot Aug 7, 2024
1cec161
Update humanize from 3.13.1 to 4.11.0
pyup-bot Oct 5, 2024
cfcc4aa
change compression format to support older rpm versions
furlongm Feb 26, 2025
745574f
Merge pull request #657 from furlongm/rpm-issues
furlongm Feb 26, 2025
bfd791e
auto-commit to update version
furlongm Feb 26, 2025
da76f60
auto-commit to update debian changelog
furlongm Feb 26, 2025
ae41fe2
add python3-yaml dependency
hdep Feb 27, 2025
6673880
update readme for depenency
hdep Feb 27, 2025
e0a00f5
Merge pull request #659 from hdep/debian_dep
furlongm Feb 27, 2025
fc3069b
auto-commit to update version
furlongm Feb 27, 2025
803a0bf
auto-commit to update debian changelog
furlongm Feb 27, 2025
fdeea13
recognize https mirrors in mirrorlists
furlongm Feb 28, 2025
8dcea75
Merge pull request #660 from furlongm/https-mirrorlists
furlongm Mar 1, 2025
9e32c7b
auto-commit to update version
furlongm Mar 1, 2025
dd46659
auto-commit to update debian changelog
furlongm Mar 1, 2025
67cc8d8
switch default branch from master to main
furlongm Mar 1, 2025
8cf653c
auto-commit to update version
furlongm Mar 1, 2025
c08e72a
auto-commit to update debian changelog
furlongm Mar 1, 2025
51f971a
support for timezone-aware datetimes
furlongm Jan 15, 2025
0936962
add function to check django settings
furlongm Feb 3, 2025
e021538
update os and osgroup to use os codenames
furlongm Jan 15, 2025
71c7893
switch from obsolete django-tagging to django-taggit
furlongm Jan 5, 2025
23ee057
additional errata sources and processing
furlongm Feb 7, 2025
25a8540
gentoo client support
furlongm Feb 11, 2025
f4d86f6
operatingsystem updates
furlongm Feb 11, 2025
2e1ff88
template, filter and view updates
furlongm Feb 11, 2025
1812ff7
flake8 fixes
furlongm Feb 11, 2025
e95765a
improve requests error handling
furlongm Feb 11, 2025
697b83f
clean up repo and mirror handling
furlongm Feb 11, 2025
0229e96
use timezone-aware datetimes by default
furlongm Feb 11, 2025
bc62c2b
flake8 fixes
furlongm Feb 11, 2025
f6d5ab8
workaround smart_str usage
furlongm Feb 11, 2025
6402e70
standardize fstrings
furlongm Feb 11, 2025
8030456
lowercase boolean querystring args
furlongm Feb 11, 2025
85ea6bc
remove extra comma
furlongm Feb 11, 2025
428d716
add icon to external links
furlongm Feb 11, 2025
59b9cea
return response for 404
furlongm Feb 11, 2025
483a81d
disable centos updates
furlongm Feb 12, 2025
e55bfce
switch to redis for caching and add celery tasks
furlongm Feb 12, 2025
972b626
standardize f-strings
furlongm Feb 12, 2025
39b290b
remove tagging requirement
furlongm Feb 12, 2025
314180d
submit CPE_NAME with client
furlongm Feb 12, 2025
3f6915b
remove unused os templates
furlongm Feb 12, 2025
035d3a7
simplify apt repo naming
furlongm Feb 13, 2025
d565cdb
improvements to errata downloading and processing
furlongm Feb 13, 2025
a01261f
template and view updates
furlongm Feb 13, 2025
fc068d1
celery and task updates
furlongm Feb 13, 2025
f3a5cf4
correctly filter periodic reports
furlongm Feb 24, 2025
9d2169f
celery tasks use id instead of non-serializable json
furlongm Feb 26, 2025
45387cf
add patchman-celery service
furlongm Feb 26, 2025
1a6d6a3
enable WAL mode for sqlite3 db
furlongm Feb 26, 2025
687e0f4
simplify osvariant deletion
furlongm Feb 26, 2025
929c4fb
add missing f-strings
furlongm Feb 26, 2025
8b4b686
add migrations for os and cves/cwes
furlongm Feb 26, 2025
695705e
create db cleaning celery task
furlongm Feb 26, 2025
4c0f743
ubuntu errata concurrent processing
furlongm Feb 26, 2025
4f62879
concurrrent arch linux errata processing
furlongm Feb 13, 2025
b88fc61
add helper function to get settings
furlongm Feb 26, 2025
fdd50b9
celery task updates
furlongm Feb 26, 2025
52cd127
update manage.py to match upstream
furlongm Feb 26, 2025
c910a2c
use BEGIN IMMEDIATE on sqlite3
furlongm Feb 26, 2025
91d2d93
remove extra space
furlongm Feb 26, 2025
1402ec2
concurrent errata processing updates
furlongm Feb 26, 2025
9b1c69b
simplify report cleaning
furlongm Feb 27, 2025
ad94317
switch to tqdm
furlongm Feb 27, 2025
1e476f1
add task to find host updates
furlongm Feb 27, 2025
1c691bc
bugfix for errata tasks
furlongm Feb 27, 2025
1824e47
show date without time
furlongm Feb 27, 2025
f96f0ac
make get requests args consistent
furlongm Feb 27, 2025
7deabb2
add space before glyphicon
furlongm Feb 27, 2025
c168a2b
flake8
furlongm Feb 27, 2025
9731054
improve package handling and duplicate removal
furlongm Feb 28, 2025
9ed44d4
use thread pool for celery to allow child concurrency
furlongm Feb 28, 2025
e4ea15d
add button to find host updates from ui
furlongm Feb 28, 2025
5d94250
imports at top of functions
furlongm Feb 28, 2025
e5b0b49
improve mirror list processing
furlongm Feb 28, 2025
442441e
handle amazon linux repos not adding package count
furlongm Feb 28, 2025
8a6f74a
use bootstrap template tags consistently
furlongm Feb 28, 2025
eec921d
pyflakes
furlongm Feb 28, 2025
388ea4b
add migrations for tz-aware DataTimeFields
furlongm Feb 28, 2025
4b90b8f
update TODO list
furlongm Mar 1, 2025
cfcefa1
update erratum creation function
furlongm Mar 1, 2025
da1438f
update progress bar type
furlongm Mar 1, 2025
002c541
don't retry ConnectionErrors
furlongm Mar 1, 2025
02c1a52
consistent formatting
furlongm Mar 1, 2025
6376a41
add more cases to tz_aware_datetime
furlongm Mar 1, 2025
b47d298
add category to package duplicate detection
furlongm Mar 1, 2025
629bdb6
update progressbars
furlongm Mar 1, 2025
9f8c18e
update erratum creation
furlongm Mar 1, 2025
f28dc8d
add task to update rpm errata
furlongm Mar 1, 2025
3108df3
formatting updates
furlongm Mar 1, 2025
0528af1
rename checksum and add module/errata checksums
furlongm Mar 1, 2025
9daa639
refactor repo handling to add rpm errata support
furlongm Mar 1, 2025
32cc5ec
add missing import
furlongm Mar 1, 2025
5ea8baf
rename progress bars signals and receivers
furlongm Mar 1, 2025
850b53c
allow hosts with no tags
furlongm Mar 1, 2025
28e6e09
add imports on same lines
furlongm Mar 1, 2025
7fe2dcf
fix order on zypper repos
furlongm Mar 3, 2025
d968a8b
add awk and additional rh cdn urls
furlongm Mar 3, 2025
c95ca88
use ID_LIKE for suse os detection
furlongm Mar 3, 2025
87bcb2d
update TODO
furlongm Mar 3, 2025
aed84da
allow errata fuzzy date-matching
furlongm Mar 3, 2025
00c3cd7
standardize errata progressbar text
furlongm Mar 3, 2025
c25bc8f
rename function
furlongm Mar 3, 2025
fc3f3a8
add yum errata checking to defaults
furlongm Mar 3, 2025
59abc71
shortern more bugzilla urls
furlongm Mar 3, 2025
37d4eae
add os filter for errata
furlongm Mar 3, 2025
f7f0acb
update os templates
furlongm Mar 3, 2025
c4257a1
explicitely install awk
furlongm Mar 3, 2025
aadddb3
refactor report processing
furlongm Mar 3, 2025
dfe73ca
add cdn-ubi redhat url
furlongm Mar 3, 2025
f96b9fe
improve mirror checksum handling
furlongm Mar 3, 2025
5d76b86
refactor and improve repo type handling
furlongm Mar 3, 2025
a51a987
update .gitignore
furlongm Mar 3, 2025
b3a80ed
add migration for blank host tags
furlongm Mar 3, 2025
113e48c
add support for parsing yum updateinfo errata repos
furlongm Mar 3, 2025
139a166
use more descriptive variable name
furlongm Mar 4, 2025
bf93e96
remove transaction.atomic where not needed
furlongm Mar 4, 2025
be73fa2
show url for authenticated mirrors
furlongm Mar 4, 2025
846fff5
add option to specify errata type on command line
furlongm Mar 4, 2025
070beaf
standardize model options format
furlongm Mar 4, 2025
c1a7138
remove unneeded saves
furlongm Mar 5, 2025
2c337c5
remove unneeded DatabaseError exception catching
furlongm Mar 5, 2025
5faaeeb
use existing function for module creation
furlongm Mar 5, 2025
8f293b3
add a default gentoo repo for all gentoo hosts
furlongm Mar 5, 2025
5e00709
function import at beginning of function
furlongm Mar 5, 2025
c9605ab
don't allow duplicate erratum references
furlongm Mar 5, 2025
3db85b3
move function to create host from report
furlongm Mar 5, 2025
380e5f8
add helper functions to create osrelease and osvariants
furlongm Mar 5, 2025
c25ab18
add cli option to remove package duplicates
furlongm Mar 5, 2025
679150c
add more info to cve template
furlongm Mar 5, 2025
a956456
add transaction.atomic for package creation
furlongm Mar 5, 2025
7ca8e8d
move reference objects under security
furlongm Mar 5, 2025
a1a639e
default to 25 ProcessPoolWorkers
furlongm Mar 5, 2025
89949ad
add incorrect erratum type to error output
furlongm Mar 5, 2025
0c99dd3
fix incorrect variable
furlongm Mar 5, 2025
6701f2e
update first.org link
furlongm Mar 5, 2025
6be5069
add NIST CVE data download for CVSS scores and references
furlongm Mar 5, 2025
3c662d2
flake8
furlongm Mar 6, 2025
58af5fc
prefer fetch over download
furlongm Mar 6, 2025
2c512d4
don't create osvariant with no arch
furlongm Mar 6, 2025
6ccf5af
handle cvss v2 scores better
furlongm Mar 6, 2025
d2d7782
use upstream nvd cpe names
furlongm Mar 6, 2025
57f8d66
fix metalink detection
furlongm Mar 9, 2025
79a4a7a
remove square brackets from urls
furlongm Mar 9, 2025
c4fb3be
use python etree for centos
furlongm Mar 9, 2025
22c42e3
don't create all-arch packages
furlongm Mar 9, 2025
20a8e56
add support for Amazon Linux 1
furlongm Mar 9, 2025
385ac0d
move smaller fixup url functions
furlongm Mar 9, 2025
fdb97f9
use reverse-date ordering for cves and errata
furlongm Mar 9, 2025
9378543
better cve mismatch message
furlongm Mar 9, 2025
6538fc7
handle irregularly-named CVEs
furlongm Mar 9, 2025
6d66c40
get debian DSCs from package file maps
furlongm Mar 9, 2025
7489754
improve get_matching_packages
furlongm Mar 9, 2025
14485b1
use package-specific display options
furlongm Mar 9, 2025
14129b1
add concurrent processing for yum repo errata
furlongm Mar 9, 2025
ef36646
additional options for yum repo errata handling
furlongm Mar 9, 2025
f77806e
remove errata view ordering
furlongm Mar 9, 2025
423ca73
use arch_id for packages
furlongm Mar 10, 2025
89b3f1a
add distro-specific references to errata
furlongm Mar 10, 2025
084840e
don't use acronym, keep flake8 happy
furlongm Mar 10, 2025
3eb2d94
update gentoo repo handling
furlongm Mar 11, 2025
6964bed
add errata affected and fixed packages
furlongm Mar 12, 2025
1e7790a
tweak yum reference handling
furlongm Mar 12, 2025
f6d7567
add osv.dev reference to errata detail page
furlongm Mar 12, 2025
93dbdcf
make packagestring distro-specific handling match package
furlongm Mar 12, 2025
487a3ca
add host errata migration
furlongm Mar 12, 2025
e09037c
bump to latest 4.2 django
furlongm Mar 12, 2025
c1001df
updates for cvss and cve handling
furlongm Mar 12, 2025
c3fe0e9
allow search to keep existing filters
furlongm Mar 12, 2025
bb0fc18
Merge pull request #654 from furlongm/develop
furlongm Mar 20, 2025
b0482d2
Merge pull request #661 from furlongm/develop (patchman 4)
furlongm Mar 21, 2025
651e89e
fix up rpm/deb package builds
furlongm Mar 22, 2025
fc84328
Merge pull request #662 from furlongm/develop
furlongm Mar 22, 2025
8f6495f
add missing dependencies
furlongm Mar 22, 2025
2c5da76
Bump djangorestframework from 3.13.1 to 3.15.2
dependabot[bot] Mar 22, 2025
830aa87
Merge pull request #663 from furlongm/develop
furlongm Mar 22, 2025
bc1eb2e
Merge branch 'master' into pyup-update-humanize-3.13.1-to-4.11.0
furlongm Mar 22, 2025
f7580a2
Merge branch 'master' into pyup-update-pyyaml-6.0.1-to-6.0.2
furlongm Mar 22, 2025
79360ca
Merge pull request #598 from furlongm/dependabot/pip/djangorestframew…
furlongm Mar 22, 2025
69679f7
Merge branch 'master' into pyup-update-django-extensions-3.1.5-to-3.2.3
furlongm Mar 22, 2025
743ba74
Merge branch 'master' into pyup-update-chardet-4.0.0-to-5.1.0
furlongm Mar 22, 2025
1b9f397
Merge pull request #604 from furlongm/pyup-update-pyyaml-6.0.1-to-6.0.2
furlongm Mar 22, 2025
eee18f6
Merge branch 'main' into pyup-update-humanize-3.13.1-to-4.11.0
furlongm Mar 22, 2025
a0a5e9c
Merge pull request #494 from furlongm/pyup-update-django-extensions-3…
furlongm Mar 22, 2025
a5cb5ae
Merge branch 'main' into pyup-update-chardet-4.0.0-to-5.1.0
furlongm Mar 22, 2025
f1b2f69
Merge pull request #613 from furlongm/pyup-update-humanize-3.13.1-to-…
furlongm Mar 22, 2025
08ce687
Merge branch 'main' into pyup-update-python-debian-0.1.43-to-0.1.49
furlongm Mar 22, 2025
956a149
Merge branch 'main' into pyup-update-colorama-0.4.4-to-0.4.6
furlongm Mar 22, 2025
a31f79d
Merge pull request #444 from furlongm/pyup-update-chardet-4.0.0-to-5.1.0
furlongm Mar 22, 2025
ca27728
Merge branch 'main' into pyup-update-python-magic-0.4.25-to-0.4.27
furlongm Mar 22, 2025
324bdb4
Merge pull request #442 from furlongm/pyup-update-python-debian-0.1.4…
furlongm Mar 22, 2025
a251239
Merge branch 'main' into pyup-update-version-utils-0.3.0-to-0.3.2
furlongm Mar 22, 2025
30da6df
Merge pull request #439 from furlongm/pyup-update-colorama-0.4.4-to-0…
furlongm Mar 22, 2025
d3ac55b
Merge pull request #414 from furlongm/pyup-update-python-magic-0.4.25…
furlongm Mar 22, 2025
23e0c45
Merge branch 'main' into pyup-update-version-utils-0.3.0-to-0.3.2
furlongm Mar 22, 2025
bf4253e
Merge pull request #410 from furlongm/pyup-update-version-utils-0.3.0…
furlongm Mar 22, 2025
cb96685
packaging updates
furlongm Mar 22, 2025
1c82cb5
Merge pull request #664 from furlongm/develop
furlongm Mar 22, 2025
8cf8564
remove dh-systemd build dependency
furlongm Mar 22, 2025
65c2cca
Merge pull request #665 from furlongm/develop
furlongm Mar 22, 2025
7bb69c0
add missing module __init__s
furlongm Mar 22, 2025
f6c46ee
Merge pull request #666 from furlongm/develop
furlongm Mar 22, 2025
4f3d69f
debian packaging updates
furlongm Mar 22, 2025
9ecc58d
Merge pull request #667 from furlongm/develop
furlongm Mar 22, 2025
d47a3b9
fix db permissions for celery
furlongm Mar 22, 2025
bdcc3f9
Merge pull request #668 from furlongm/develop
furlongm Mar 22, 2025
ed005e5
fix rpm building
furlongm Apr 16, 2025
ceab20b
remove unnessecary globals to appease flake8
furlongm Apr 17, 2025
8aebcde
Merge pull request #674 from furlongm/develop
furlongm Apr 18, 2025
6596588
remove unused cve title field
furlongm Apr 20, 2025
77bc10e
handle existing duplicate packages in get_or_create
furlongm Apr 20, 2025
697ffb2
speed up errata processing
furlongm Apr 20, 2025
6a13d6f
correctly parse newer dsc representation
furlongm Apr 20, 2025
c877223
handle subprocesses closing db connections
furlongm Apr 20, 2025
71e46f9
Merge pull request #676 from furlongm/cve-title
furlongm Apr 20, 2025
f213021
Merge pull request #677 from furlongm/packages-dupes
furlongm Apr 20, 2025
061c936
Merge pull request #679 from furlongm/debian-dsc-parsing
furlongm Apr 20, 2025
ec881bb
Merge pull request #680 from furlongm/db-connection-closing
furlongm Apr 20, 2025
aa7f00d
Merge pull request #678 from furlongm/errata-speedups
furlongm Apr 20, 2025
d44a2ce
handle duplicate CVSSes better
Apr 23, 2025
08faacd
Merge pull request #681 from furlongm/cvss-fix
furlongm Apr 23, 2025
bf626c9
reduce max charfield length for mysql
furlongm Apr 8, 2025
382cd29
further reduce charfield size for mysql
furlongm Apr 18, 2025
20a42ed
reduce URLField max_length to 765
furlongm Apr 29, 2025
33d15b2
Merge pull request #673 from furlongm/bug/mysql-max-col-length
furlongm Apr 30, 2025
bf5478c
Bump django from 4.2.20 to 4.2.21
dependabot[bot] May 8, 2025
d9c6df7
Merge pull request #682 from furlongm/dependabot/pip/django-4.2.21
furlongm May 8, 2025
57e5c0d
Bump django from 4.2.21 to 4.2.22
dependabot[bot] Jun 6, 2025
6a45e90
Bump requests from 2.32.3 to 2.32.4
dependabot[bot] Jun 10, 2025
64b1920
Merge pull request #684 from furlongm/dependabot/pip/django-4.2.22
furlongm Jun 10, 2025
334af8f
Merge pull request #685 from furlongm/dependabot/pip/requests-2.32.4
furlongm Jun 10, 2025
5674853
Remove unused dependency 'chardet' from requirements.txt
vtalos Jul 17, 2025
cf8c77f
Merge pull request #689 from vtalos/remove-unused-chardet
furlongm Jul 17, 2025
94fcb04
get_or_create_module only returns module
furlongm Aug 6, 2025
1480468
Bump django from 4.2.22 to 4.2.24
dependabot[bot] Sep 10, 2025
36cefb1
Merge pull request #700 from furlongm/dependabot/pip/django-4.2.24
furlongm Sep 10, 2025
6aee812
Merge pull request #693 from furlongm/module-creation
furlongm Sep 10, 2025
b616296
Package types are in the Package class
willfurnell Sep 12, 2025
3f8756c
Merge pull request #701 from willfurnell/package-fix
furlongm Sep 15, 2025
2c8de5a
Merge upstream/master into feature/rebase-upstream
hafkensite Oct 3, 2025
3420802
Merge remote-tracking branch 'upstream/main' into feature/rebase-upst…
hafkensite Oct 3, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: "Code Scanning - Action"

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

jobs:
CodeQL-Build:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/create-release-and-upload-assets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
ref: main
- name: git fetch --all
run: |
git fetch --all
Expand Down Expand Up @@ -40,7 +40,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
ref: main
- name: git fetch --all
run: |
git fetch --all
Expand All @@ -62,7 +62,7 @@ jobs:
echo "${{ github.ref }}" | cut -dv -f2 > VERSION.txt
git add VERSION.txt
git diff --quiet && git diff --staged --quiet || git commit -m "${COMMIT_MSG}"
git push origin master
git push origin main
- name: Update debian changelog
env:
EMAIL: [email protected]
Expand All @@ -72,7 +72,7 @@ jobs:
skip-checks: true
run: |
gbp dch --new-version=$(cat VERSION.txt)-1 --release --distribution=stable --spawn-editor=never --commit --commit-msg="${COMMIT_MSG}"
git push origin master
git push origin main
build-and-upload-deb-assets:
needs: update-version-and-changelog
runs-on: ubuntu-latest
Expand All @@ -91,7 +91,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
ref: main
- name: git fetch --all
run: |
git config --global --add safe.directory /__w/patchman/patchman
Expand Down Expand Up @@ -156,7 +156,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: master
ref: main
- name: git fetch --all
run: |
git config --global --add safe.directory /__w/patchman/patchman
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ dist
run
pyvenv.cfg
.vscode
.venv
*.xml
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,7 @@ recursive-include packages *
recursive-include repos *
recursive-include reports *
recursive-include modules *
recursive-include errata *
recursive-include security *
recursive-include sbin *
recursive-include etc *
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ python3-requests
python3-colorama
python3-magic
python3-humanize
python3-yaml
```

The server can optionally make use of celery to asynchronously process the
Expand Down
18 changes: 12 additions & 6 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
* allow sending updates from Red Hat / SuSE machines
* web interface support for updating repos, finding updates
* add checkrestart-style options to see which services need restarting
* CVE/OVAL apps
* OVAL/OSCAP apps
* CA support (tinyca?)
* native python client, using apt/yum/debian libraries
* native python/go client, using apt/yum/debian libraries
* record the history of installed packages on a host
* also store package descriptions/tags/urls
* check for unused repos
* suggest names for repos with the same checksum
* helper script to change paths (e.g. /usr/lib/python3/dist-packages/patchman)
* Dockerfile/Dockerimage
* compressed reports
* add cronjobs to built packages
* install celery/rabbit/memcache with packages
* add cronjobs to build packages
* dnf5 support
* proxy support
* GLSA support
* only use date for errata issue date?
* parallelize package extraction
* use django-tables2
* autonaming for deb repos
* associate repos with gentoo hosts
* populate authenticated repos with package lists from hosts?
2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.15
3.0.19
52 changes: 52 additions & 0 deletions arch/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright 2025 Marcus Furlong <[email protected]>
#
# This file is part of Patchman.
#
# Patchman is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, version 3 only.
#
# Patchman is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Patchman. If not, see <http://www.gnu.org/licenses/>

from arch.models import PackageArchitecture, MachineArchitecture
from patchman.signals import info_message


def clean_package_architectures():
""" Remove package architectures that are no longer in use
"""
parches = PackageArchitecture.objects.filter(package__isnull=True)
plen = parches.count()
if plen == 0:
info_message.send(sender=None, text='No orphaned PackageArchitectures found.')
else:
info_message.send(sender=None, text=f'Removing {plen} orphaned PackageArchitectures')
parches.delete()


def clean_machine_architectures():
""" Remove machine architectures that are no longer in use
"""
marches = MachineArchitecture.objects.filter(
host__isnull=True,
repository__isnull=True,
)
mlen = marches.count()
if mlen == 0:
info_message.send(sender=None, text='No orphaned MachineArchitectures found.')
else:
info_message.send(sender=None, text=f'Removing {mlen} orphaned MachineArchitectures')
marches.delete()


def clean_architectures():
""" Remove architectures that are no longer in use
"""
clean_package_architectures()
clean_machine_architectures()
85 changes: 76 additions & 9 deletions client/patchman-client
Original file line number Diff line number Diff line change
Expand Up @@ -297,10 +297,20 @@ get_installed_archlinux_packages() {
fi
}

get_installed_gentoo_packages() {
if check_command_exists qkeyword ; then
gentoo_package_arch=$(qkeyword -A)
fi
if check_command_exists qlist ; then
qlist -Ic -F "'%{PN}' '%{SLOT}' '%{PV}' REL'%{PR}' '${gentoo_package_arch}' 'gentoo' '%{CAT}' '%{REPO}'" | sed -e "s/REL'r/'/g" >> "${tmpfile_pkg}"
fi
}

get_packages() {
get_installed_rpm_packages
get_installed_deb_packages
get_installed_archlinux_packages
get_installed_gentoo_packages
}

get_modules() {
Expand Down Expand Up @@ -346,7 +356,9 @@ get_host_data() {
os="${PRETTY_NAME}"
elif [ "${ID}" == "arch" ] ; then
os="${NAME}"
elif [[ "${ID}" =~ "suse" ]] ; then
elif [ "${ID}" == "gentoo" ] ; then
os="${PRETTY_NAME} ${VERSION_ID}"
elif [[ "${ID_LIKE}" =~ "suse" ]] ; then
os="${PRETTY_NAME}"
elif [ "${ID}" == "astra" ] ; then
os="${NAME} $(cat /etc/astra_version)"
Expand Down Expand Up @@ -386,6 +398,9 @@ get_host_data() {
fi
done
fi
if [ ! -z "${CPE_NAME}" ] ; then
os="${os} [${CPE_NAME}]"
fi
if ${verbose} ; then
echo "Kernel: ${host_kernel}"
echo "Arch: ${host_arch}"
Expand Down Expand Up @@ -452,7 +467,7 @@ get_repos() {
fi
# replace this with a dedicated awk or simple python script?
yum_repolist=$(yum repolist enabled --verbose 2>/dev/null | sed -e "s/:\? *([0-9]\+ more)$//g" -e "s/ ([0-9]\+$//g" -e "s/:\? more)$//g" -e "s/'//g" -e "s/%/%%/g")
for i in $(echo "${yum_repolist}" | awk '{ if ($1=="Repo-id") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'"'"' "} if ($1=="Repo-name") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'" ${host_arch}'"' "} if ($1=="Repo-mirrors" || $1=="Repo-metalink:") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'"'"' "} if ($1=="Repo-baseurl" || $1=="Repo-baseurl:") { url=1; comma=match($NF,","); if (comma) out=substr($NF,1,comma-1); else out=$NF; printf "'"'"'"out"'"'"' "; } else { if (url==1) { if ($1==":") { comma=match($NF,","); if (comma) out=substr($NF,1,comma-1); else out=$NF; printf "'"'"'"out"'"'"' "; } else {url=0; print "";} } } }' | sed -e "s/\/'/'/g" | sed -e "s/ ' /' /") ; do
for i in $(echo "${yum_repolist}" | awk '{ if ($1=="Repo-id") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'"'"' "} if ($1=="Repo-name") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'" ${host_arch}'"' "} if ($1=="Repo-mirrors" || $1=="Repo-metalink") {printf "'"'"'"; for (i=3; i<NF; i++) printf $i " "; printf $NF"'"'"' "} if ($1=="Repo-baseurl" || $1=="Repo-baseurl:") { url=1; comma=match($NF,","); if (comma) out=substr($NF,1,comma-1); else out=$NF; printf "'"'"'"out"'"'"' "; } else { if (url==1) { if ($1==":") { comma=match($NF,","); if (comma) out=substr($NF,1,comma-1); else out=$NF; printf "'"'"'"out"'"'"' "; } else {url=0; print "";} } } }' | sed -e "s/\/'/'/g" | sed -e "s/ ' /' /") ; do
full_id=$(echo ${i} | cut -d \' -f 2)
id=$(echo ${i} | cut -d \' -f 2 | cut -d \/ -f 1)
name=$(echo ${i} | cut -d \' -f 4)
Expand All @@ -463,7 +478,7 @@ get_repos() {
if [ "${priority}" == "" ] ; then
priority=99
fi
redhat_repo=$(echo ${i} | grep -e "https://.*/XMLRPC.*\|https://cdn.redhat.com/.*")
redhat_repo=$(echo ${i} | grep -e "https://.*/XMLRPC.*\|https://cdn[-[a-z]*]*.redhat.com/.*")
if [ ${?} == 0 ] || ${local_updates} ; then
if ${verbose} ; then
echo "Finding updates locally for ${id}"
Expand All @@ -473,7 +488,7 @@ get_repos() {
if [ ! -z ${CPE_NAME} ] ; then
id="${CPE_NAME}-${id}"
fi
j=$(echo ${i} | sed -e "s#'${full_id}' '${name}'#'${name}' '${id}' '${priority}'#")
j=$(echo ${i} | sed -e "s#'${full_id}' '${name}'#'${name}' '${id}' '${priority}'#" | sed -e "s/'\[/'/g" -e "s/\]'/'/g")
echo "'rpm' ${j}" >> "${tmpfile_rep}"
unset priority
done
Expand All @@ -484,7 +499,8 @@ get_repos() {
if ${verbose} ; then
echo 'Finding apt repos...'
fi
IFS=${FULL_IFS} read -r osname shortversion <<<$(echo "${os}" | awk '{print $1,$2}' | cut -d . -f 1,2)
osname=$(echo ${os} | cut -d " " -f 1)
shortversion=${VERSION_ID}
repo_string="'deb\' \'${osname} ${shortversion} ${host_arch} repo at"
repos=$(apt-cache policy | grep -v Translation | grep -E "^ *[0-9]{1,5}" | grep -E " mirror\+file|http(s)?:" | sed -e "s/^ *//g" -e "s/ *$//g" | cut -d " " -f 1,2,3,4)
non_mirror_repos=$(echo "${repos}" | grep -Ev "mirror\+file")
Expand All @@ -510,11 +526,11 @@ get_repos() {
echo 'Finding zypper repos...'
fi
if [ $(zypper -q --no-refresh lr --details | head -n 1 | grep Keep) ] ; then
zypper_lr_cols="2,3,8,10"
zypper_lr_cols='{print "${os}" $3 "|" $2 "|" $8 "|" $10}'
else
zypper_lr_cols="2,3,7,9"
zypper_lr_cols='{print "${os}" $3 "|" $2 "|" $7 "|" $9}'
fi
for i in $(zypper -q --no-refresh lr -E -u --details | grep -v ^$ | tail -n +3 | cut -d "|" -f ${zypper_lr_cols} | sed -e "s/ *|/ ${host_arch} |/" -e "s/\?[a-zA-Z0-9_-]* *$//" -e "s/^ /'/g" -e "s/ *| */' '/g" -e "s/ *$/'/g") ; do
for i in $(zypper -q --no-refresh lr -E -u --details | grep -v ^$ | tail -n +3 | awk -F"|" "${zypper_lr_cols}" | sed -e "s/\${os}/${PRETTY_NAME}/" -e "s/ *|/ ${host_arch} |/" -e "s/\?[a-zA-Z0-9_-]* *$//" -e "s/^/'/g" -e "s/ *| */' '/g" -e "s/ *$/'/g") ; do
echo \'rpm\' ${i} >> "${tmpfile_rep}"
id=$(echo ${i} | cut -d \' -f 4)
suse_repo=$(echo ${i} | grep -e "https://updates.suse.com/.*")
Expand Down Expand Up @@ -557,6 +573,56 @@ get_repos() {
done
fi

# Gentoo
if [[ "${os}" =~ "Gentoo" ]] ; then
if [ ${verbose} == 1 ] ; then
echo 'Finding portage repos...'
fi
declare -A repo_info
repos_output=$(portageq repos_config /)
repo_name=""
priority=""
sync_uri=""

while IFS= read -r line; do
# if the line starts with a section header (e.g., [gentoo], [guru]), it's the repo name
if [[ "${line}" =~ ^\[(.*)\] ]]; then
# if we already have a repo_name, save the previous entry
if [[ -n "${repo_name}" && -n "${sync_uri}" ]]; then
repo_info["${repo_name}"]="${priority},${sync_uri}"
fi
# else start new repo parsing, resetting vars
repo_name="${BASH_REMATCH[1]}"
priority=""
sync_uri=""
fi

# if the line contains "priority", extract the value, 0 if it doesnt exist
if [[ "${line}" =~ "priority" ]]; then
priority=$(echo "${line}" | cut -d'=' -f2 | xargs)
fi

# if the line contains "sync-uri", extract the value
if [[ "${line}" =~ "sync-uri" ]]; then
sync_uri=$(echo "${line}" | cut -d'=' -f2 | xargs)
fi
done <<< "${repos_output}"

# save the last repository entry if it's available
if [[ -n "${repo_name}" && -n "${sync_uri}" ]]; then
repo_info["${repo_name}"]="${priority},${sync_uri}"
fi

for repo in "${!repo_info[@]}"; do
priority=$(echo ${repo_info[$repo]} | cut -d',' -f1)
sync_uri=$(echo ${repo_info[$repo]} | cut -d',' -f2)
if [ "${priority}" == "" ] ; then
priority=0
fi
echo "'gentoo' 'Gentoo Linux ${repo} Repo ${host_arch}' '${repo}' '${priority}' '${sync_uri}'" >> "${tmpfile_rep}"
done
fi

IFS=${FULL_IFS}

sed -i -e '/^$/d' "${tmpfile_rep}"
Expand Down Expand Up @@ -629,10 +695,11 @@ post_data() {
}

if ! check_command_exists which || \
! check_command_exists awk || \
! check_command_exists mktemp || \
! check_command_exists curl || \
! check_command_exists flock ; then
echo "which, mktemp, flock or curl was not found, exiting."
echo "which, awk, mktemp, flock or curl was not found, exiting."
exit 1
fi

Expand Down
32 changes: 32 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
patchman (3.0.19-1) stable; urgency=medium

* switch default branch from master to main
* auto-commit to update version skip-checks: true

-- Marcus Furlong <[email protected]> Sat, 01 Mar 2025 20:45:02 +0000

patchman (3.0.18-1) stable; urgency=medium

* recognize https mirrors in mirrorlists
* auto-commit to update version skip-checks: true

-- Marcus Furlong <[email protected]> Sat, 01 Mar 2025 20:36:58 +0000

patchman (3.0.17-1) stable; urgency=medium

[ Hugo Deprez ]
* add python3-yaml dependency
* update readme for depenency

[ Marcus Furlong ]
* auto-commit to update version skip-checks: true

-- Marcus Furlong <[email protected]> Thu, 27 Feb 2025 16:07:15 +0000

patchman (3.0.16-1) stable; urgency=medium

* change compression format to support older rpm versions
* auto-commit to update version skip-checks: true

-- Marcus Furlong <[email protected]> Wed, 26 Feb 2025 05:25:29 +0000

patchman (3.0.15-1) stable; urgency=medium

[ Vladimir Lettiev ]
Expand Down
Loading