4 releases
0.1.12 | May 31, 2021 |
---|---|
0.1.11 | May 31, 2021 |
0.1.1 | May 31, 2021 |
0.1.0 | May 31, 2021 |
#6 in #dpkg
8KB
73 lines
dpkg-query-json
A crate for parsing “dpkg-query” in json.
Examples
use dpkg_query_json::QueryFieldPackage;
let fields = vec![String::from("Package"),
String::from("Version"),
String::from("Architecture")];
let packages = vec![String::from("dpkg")];
QueryFieldPackage::new(fields, packages).json(); //Map<String, Value>
// {"dpkg": Object({"Architecture": String("amd64"), "Version": String("1.19.7ubuntu3")})}
use dpkg_query_json::QueryFieldPackage;
let fields = vec![String::from("Package"),
String::from("Version"),
String::from("Architecture")];
let packages = vec![String::from("dpkg")];
QueryFieldPackage::new(fields, packages).json_string(); //String
// "{\"dpkg\":{\"Architecture\":\"amd64\",\"Version\":\"1.19.7ubuntu3\"}}"
Package information fields
Architecture
Bugs
Conffiles
Config-Version
Conflicts
Breaks
Depends
Description
Enhances
Essential
Filename
Installed-Size
MD5sum
MSDOS-Filename
Maintainer
Origin
Package
Pre-Depends
Priority
Provides
Recommends
Replaces
Revision
Section
Size
Source
Status
Suggests
Version
Dependencies
~0.5–1MB
~20K SLoC