1
0
mirror of https://github.com/kellyjonbrazil/jc.git synced 2025-06-17 00:07:37 +02:00
Files
jc/docs/parsers/apt_get_sqq.md

202 lines
5.4 KiB
Markdown
Raw Permalink Normal View History

2024-03-01 14:25:33 -08:00
[Home](https://kellyjonbrazil.github.io/jc/)
<a id="jc.parsers.apt_get_sqq"></a>
2024-03-14 21:44:37 -07:00
# jc.parsers.apt_get_sqq
2024-03-01 14:25:33 -08:00
jc - JSON Convert `apt-get -sqq` command output parser
Requires the `-sqq` options in `apt-get`.
Usage (cli):
2024-04-28 13:10:38 -07:00
$ apt-get -sqq upgrade | jc --apt-get-sqq
2024-03-01 14:25:33 -08:00
or
2024-04-28 13:10:38 -07:00
$ jc apt-get -sqq full-upgrade
2024-03-01 14:25:33 -08:00
Usage (module):
import jc
result = jc.parse('apt_get_sqq', apt_get_sqq_command_output)
Schema:
[
{
"operation": string, # configure, remove, or unpack
"package": string,
"broken": string/null,
"proposed_pkg_ver": string,
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": string/null,
2024-03-01 14:25:33 -08:00
"architecture": string
}
]
Examples:
2024-04-28 13:10:38 -07:00
$ apt-get -sqq upgrade | jc --apt-get-sqq -p
2024-03-01 14:25:33 -08:00
[
{
"operation": "unpack",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "unpack",
"package": "dpkg",
"broken": null,
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "configure",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "remove",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "unpack",
"package": "base-files",
"broken": "10.3+deb10u4",
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": null,
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "configure",
"package": "base-files",
"broken": null,
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": null,
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "unpack",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "configure",
"package": "dpkg",
"broken": null,
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
}
]
2024-04-28 13:10:38 -07:00
$ apt-get -sqq upgrade | jc --apt-get-sqq -p -r
2024-03-01 14:25:33 -08:00
[
{
"operation": "Inst",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Inst",
"package": "dpkg",
"broken": null,
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Conf",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Remv",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Inst",
"package": "base-files",
"broken": "10.3+deb10u4",
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": null,
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Conf",
"package": "base-files",
"broken": null,
"proposed_pkg_ver": "10.3+deb10u13 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": null,
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Inst",
"package": "dpkg",
"broken": "1.19.7",
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
},
{
"operation": "Conf",
"package": "dpkg",
"broken": null,
"proposed_pkg_ver": "1.19.8 Debian:10.13/oldstable",
2024-03-14 21:44:37 -07:00
"existing_pkg_ver": "Debian-Security:10/oldstable",
2024-03-01 14:25:33 -08:00
"architecture": "amd64"
}
]
<a id="jc.parsers.apt_get_sqq.parse"></a>
### parse
```python
def parse(data: str,
raw: bool = False,
2024-03-14 21:44:37 -07:00
quiet: bool = False) -> List[Dict[str, Any]]
2024-03-01 14:25:33 -08:00
```
Main text parsing function
Parameters:
data: (string) text data to parse
raw: (boolean) unprocessed output if True
quiet: (boolean) suppress warning messages if True
Returns:
List of Dictionaries. Raw or processed structured data.
### Parser Information
2024-03-14 22:46:52 -07:00
Compatibility: linux
2024-03-01 14:25:33 -08:00
Source: [`jc/parsers/apt_get_sqq.py`](https://github.com/kellyjonbrazil/jc/blob/master/jc/parsers/apt_get_sqq.py)
2024-04-28 13:10:38 -07:00
Version 1.1 by Kelly Brazil (kellyjonbrazil@gmail.com)