Add ALT Linux support
This commit is contained in:
parent
af18754224
commit
8bc333f3aa
37
.gear/apt-pkg-native.spec
Normal file
37
.gear/apt-pkg-native.spec
Normal file
@ -0,0 +1,37 @@
|
||||
Name: apt-pkg-native
|
||||
Version: 0.3.2
|
||||
Release: alt1
|
||||
|
||||
Summary: Rust bindings for libapt-pkg
|
||||
License: MIT
|
||||
Group: Development/Tools
|
||||
Url: https://github.com/FauxFaux/apt-pkg-native-rs
|
||||
|
||||
Source: %name-%version.tar
|
||||
|
||||
BuildRequires(pre): rpm-build-rust
|
||||
BuildRequires: /proc
|
||||
BuildRequires: rust-cargo
|
||||
|
||||
%description
|
||||
This crate provides bindings to libapt-pkg.
|
||||
|
||||
%prep
|
||||
%setup
|
||||
|
||||
%build
|
||||
%rust_build
|
||||
|
||||
%install
|
||||
%rust_install
|
||||
|
||||
%check
|
||||
%rust_test
|
||||
|
||||
%files
|
||||
%_bindir/*
|
||||
%doc LICENSE-MIT README.md
|
||||
|
||||
%changelog
|
||||
* Mon Jun 19 2023 Alexander Burmatov <thatman@altlinux.org> 0.3.2-alt1
|
||||
- Initial build for Sisyphus.
|
2
.gear/rules
Normal file
2
.gear/rules
Normal file
@ -0,0 +1,2 @@
|
||||
spec: .gear/apt-pkg-native.spec
|
||||
tar: .
|
3
.gear/upstream/remotes
Normal file
3
.gear/upstream/remotes
Normal file
@ -0,0 +1,3 @@
|
||||
[remote "upstream"]
|
||||
url = git@github.com:FauxFaux/apt-pkg-native-rs.git
|
||||
fetch = +refs/heads/*:refs/remotes/upstream/*
|
@ -30,3 +30,4 @@ itertools = "0.9"
|
||||
[features]
|
||||
default = []
|
||||
ye-olde-apt = []
|
||||
alt-linux = []
|
@ -175,6 +175,8 @@ void init_config_system() {
|
||||
pkgInitSystem(*_config, _system);
|
||||
}
|
||||
|
||||
#ifndef ALT_LINUX
|
||||
|
||||
PCache *pkg_cache_create() {
|
||||
pkgCacheFile *cache_file = new pkgCacheFile();
|
||||
pkgCache *cache = cache_file->GetPkgCache();
|
||||
@ -188,6 +190,8 @@ PCache *pkg_cache_create() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void pkg_cache_release(PCache *cache) {
|
||||
// TODO: is cache->cache cleaned up with cache->cache_file?
|
||||
delete cache->records;
|
||||
@ -214,6 +218,8 @@ PPkgIterator *pkg_cache_find_name(PCache *cache, const char *name) {
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
#ifndef ALT_LINUX
|
||||
|
||||
PPkgIterator *pkg_cache_find_name_arch(PCache *cache, const char *name, const char *arch) {
|
||||
PPkgIterator *wrapper = new PPkgIterator();
|
||||
wrapper->iterator = cache->cache->FindPkg(name, arch);
|
||||
@ -221,6 +227,8 @@ PPkgIterator *pkg_cache_find_name_arch(PCache *cache, const char *name, const ch
|
||||
return wrapper;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
void pkg_iter_release(PPkgIterator *wrapper) {
|
||||
delete wrapper;
|
||||
}
|
||||
@ -237,6 +245,8 @@ const char *pkg_iter_name(PPkgIterator *wrapper) {
|
||||
return wrapper->iterator.Name();
|
||||
}
|
||||
|
||||
#ifndef ALT_LINUX
|
||||
|
||||
const char *pkg_iter_arch(PPkgIterator *wrapper) {
|
||||
return wrapper->iterator.Arch();
|
||||
}
|
||||
@ -253,6 +263,8 @@ const char *pkg_iter_candidate_version(PPkgIterator *wrapper) {
|
||||
return it.VerStr();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
PVerIterator *pkg_iter_ver_iter(PPkgIterator *wrapper) {
|
||||
PVerIterator *new_wrapper = new PVerIterator();
|
||||
new_wrapper->iterator = wrapper->iterator.VersionList();
|
||||
@ -287,6 +299,7 @@ const char *ver_iter_priority_type(PVerIterator *wrapper) {
|
||||
}
|
||||
|
||||
#ifndef YE_OLDE_APT
|
||||
#ifndef ALT_LINUX
|
||||
|
||||
const char *ver_iter_source_package(PVerIterator *wrapper) {
|
||||
return wrapper->iterator.SourcePkgName();
|
||||
@ -302,6 +315,7 @@ int32_t ver_iter_priority(PVerIterator *wrapper) {
|
||||
return wrapper->cache->cache_file->GetPolicy()->GetPriority(wrapper->iterator);
|
||||
}
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
const char *ver_iter_arch(PVerIterator *wrapper) {
|
||||
@ -390,11 +404,15 @@ const char *ver_file_parser_maintainer(PVerFileParser *parser) {
|
||||
return to_c_string(maint);
|
||||
}
|
||||
|
||||
#ifndef ALT_LINUX
|
||||
|
||||
const char *ver_file_parser_homepage(PVerFileParser *parser) {
|
||||
std::string hp = parser->parser->Homepage();
|
||||
return to_c_string(hp);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
bool ver_file_iter_end(PVerFileIterator *wrapper) {
|
||||
return wrapper->iterator.end();
|
||||
}
|
||||
@ -433,10 +451,14 @@ const char *pkg_file_iter_origin(PPkgFileIterator *wrapper) {
|
||||
return wrapper->iterator.Origin();
|
||||
}
|
||||
|
||||
#ifndef ALT_LINUX
|
||||
|
||||
const char *pkg_file_iter_codename(PPkgFileIterator *wrapper) {
|
||||
return wrapper->iterator.Codename();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
const char *pkg_file_iter_label(PPkgFileIterator *wrapper) {
|
||||
return wrapper->iterator.Label();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user