Skip to content

Commit

Permalink
Allow tab aligned dpkg output
Browse files Browse the repository at this point in the history
  • Loading branch information
martenlienen authored and Fizzadar committed Feb 29, 2024
1 parent 3ebd9fa commit e8530f9
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyinfra/facts/deb.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class DebPackage(FactBase):
"""

_regexes = {
"name": r"^Package: ({0})$".format(DEB_PACKAGE_NAME_REGEX),
"version": r"^Version: ({0})$".format(DEB_PACKAGE_VERSION_REGEX),
"name": r"^Package:\s+({0})$".format(DEB_PACKAGE_NAME_REGEX),
"version": r"^Version:\s+({0})$".format(DEB_PACKAGE_VERSION_REGEX),
}

requires_command = "dpkg"
Expand Down
28 changes: 28 additions & 0 deletions tests/facts/deb.DebPackage/whitespace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"arg": "/root/tivsm-api64.amd64.deb",
"output": [
" new Debian package, version 2.0.",
" size 73275616 bytes: control archive=1079 bytes.",
" 123 bytes, 5 lines changelog",
" 2 bytes, 1 lines compat",
" 336 bytes, 9 lines control",
" 147 bytes, 4 lines copyright",
" 14 bytes, 1 lines install",
" 237 bytes, 10 lines * postinst #!/bin/sh",
" 377 bytes, 20 lines * prerm #!/bin/sh",
" 156 bytes, 11 lines * rules #!/usr/bin/make",
" Version:\t\t8.1.21-0",
" Maintainer:\t\tIBM",
" Section:\t\tUtilities/Archiving",
" Homepage:\t\thttp://www.ibm.com/software/tivoli/products/storage-mgr/",
" Package:\t\ttivsm-api64",
" Architecture:\t\tamd64",
" Description:\t\tThis is the IBM Storage Protect Linux API",
" Pre-Depends:\t\tgskcrypt64 (>= 8.0-55.31),",
" gskssl64 (>= 8.0-55.31)"
],
"fact": {
"name": "tivsm-api64",
"version": "8.1.21-0"
}
}

0 comments on commit e8530f9

Please sign in to comment.