-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix C-API calls to resolve some failures with local/offline databases (…
…#45) - Making the codebase work with offline databases. - Passing DBIndexTag to rpmtsInitIterator instead of the previous Tag. Added tests
- Loading branch information
Tomer Lev
authored
Nov 12, 2023
1 parent
d06b744
commit cc7e7c9
Showing
33 changed files
with
205 additions
and
385 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,20 @@ | ||
[package] | ||
name = "librpmbuild-sys" | ||
description = "rpmbuild library FFI bindings (librpmbuild.so)" | ||
version = "0.1.1" | ||
license = "MPL-2.0" | ||
authors = ["Tony Arcieri <tony@iqlusion.io>"] | ||
categories = ["external-ffi-bindings", "os"] | ||
keywords = ["rpm", "linux", "redhat", "fedora", "centos"] | ||
readme = "README.md" | ||
homepage = "https://github.com/rpm-software-management/librpm.rs/" | ||
repository = "https://github.com/rpm-software-management/librpm.rs/tree/master/librpmbuild-sys" | ||
name = "librpmbuild-sys" | ||
description = "rpmbuild library FFI bindings (librpmbuild.so)" | ||
version = "0.2.0-pre" | ||
license = "MPL-2.0" | ||
authors = ["Tony Arcieri <tony@iqlusion.io>"] | ||
categories = ["external-ffi-bindings", "os"] | ||
keywords = ["rpm", "linux", "redhat", "fedora", "centos"] | ||
readme = "README.md" | ||
homepage = "https://github.com/rpm-software-management/librpm.rs/" | ||
repository = "https://github.com/rpm-software-management/librpm.rs/tree/master/librpmbuild-sys" | ||
documentation = "https://rustrpm.org/librpmbuild_sys/" | ||
edition = "2018" | ||
edition = "2021" | ||
|
||
[badges] | ||
travis-ci = { repository = "rpm-software-management/librpm.rs" } | ||
maintenance = { status = "passively-maintained" } | ||
|
||
[build-dependencies] | ||
bindgen = "0.59.1" | ||
|
||
bindgen = "0.69.1" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# Test Data Files | ||
|
||
## Create test files from the command line | ||
|
||
Within this directory, run the following commands to create new test files: | ||
|
||
```bash | ||
# Fetching the centos:7 rpm databases | ||
id=$(docker create centos:7) | ||
docker cp $id:/var/lib/rpm centos7 | ||
docker rm -v $id | ||
``` |
Empty file.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
use std::{ | ||
path::{Path, PathBuf}, | ||
sync::Once, | ||
}; | ||
|
||
use librpm::config; | ||
|
||
static CONFIGURE: Once = Once::new(); | ||
|
||
// Read the default config | ||
pub fn configure() { | ||
CONFIGURE.call_once(|| { | ||
config::read_file(None).unwrap(); | ||
}); | ||
} | ||
|
||
pub fn get_assets_path() -> PathBuf { | ||
Path::new(env!("CARGO_MANIFEST_DIR")).join("testdata") | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
use librpm::{config::set_db_path, db::installed_packages, Package}; | ||
|
||
mod common; | ||
|
||
#[test] | ||
fn test_centos_7_rpm_database() { | ||
common::configure(); | ||
set_db_path(&common::get_assets_path().join("centos7")).unwrap(); | ||
|
||
let mut packages: Vec<Package> = installed_packages().collect(); | ||
packages.sort_by_key(|p| p.name().to_string()); | ||
|
||
assert_eq!(packages.len(), 148); | ||
let sample_package = &packages[0]; | ||
assert_eq!(sample_package.name(), "acl"); | ||
assert_eq!(sample_package.epoch(), None); | ||
assert_eq!(sample_package.version(), "2.2.51"); | ||
assert_eq!(sample_package.release(), "15.el7"); | ||
assert_eq!(sample_package.arch(), Some("x86_64")); | ||
assert_eq!(sample_package.license(), "GPLv2+"); | ||
assert_eq!(sample_package.summary(), "Access control list utilities"); | ||
assert_eq!( | ||
sample_package.description(), | ||
"This package contains the getfacl and setfacl utilities needed for\nmanipulating access control lists." | ||
); | ||
} |
Oops, something went wrong.