static int result_callback(pakfire_ctx* ctx, struct pakfire* pakfire,
pakfire_build* build, pakfire_archive* archive, void* data) {
const struct cli_local_args* local_args = data;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
struct pakfire_repo* local = NULL;
char path[PATH_MAX];
int r;
#include "dump.h"
-int cli_dump_package(struct pakfire_package* package, int flags) {
+int cli_dump_package(pakfire_package* package, int flags) {
char* p = NULL;
// Dump the package information
return 0;
}
-static int __cli_dump_package(pakfire_ctx* ctx, struct pakfire_package* package, void* p) {
+static int __cli_dump_package(pakfire_ctx* ctx, pakfire_package* package, void* p) {
int flags = *(int*)p;
#if 0
#include <pakfire/pakfire.h>
#include <pakfire/repolist.h>
-int cli_dump_package(struct pakfire_package* package, int flags);
+int cli_dump_package(pakfire_package* package, int flags);
int cli_dump_packagelist(pakfire_packagelist* list, int flags);
int cli_dump_repolist(struct pakfire_repolist* list, int flags);
}
static int cli_linter_result(pakfire_ctx* ctx, pakfire_archive* archive,
- struct pakfire_package* package, pakfire_file* file, int priority,
+ pakfire_package* package, pakfire_file* file, int priority,
const char* result, void* data) {
const char* nevra = pakfire_package_get_string(package, PAKFIRE_PKG_NEVRA);
FILE* f;
struct stat stat;
- struct pakfire_package* package;
+ pakfire_package* package;
// metadata
unsigned int format;
return NULL;
}
-static struct pakfire_package* pakfire_archive_get_package(pakfire_archive* archive) {
+static pakfire_package* pakfire_archive_get_package(pakfire_archive* archive) {
if (!archive->package) {
int r = pakfire_archive_make_package(archive, NULL, &archive->package);
if (r)
static int __pakfire_archive_extract(pakfire_archive* archive,
const char* path, int flags, struct pakfire_progress* parent) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
char prefix[PATH_MAX] = "/";
struct archive* writer = NULL;
struct archive* a = NULL;
}
const char* pakfire_archive_get_filename(pakfire_archive* self) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
const char* filename = NULL;
// Fetch the package
}
static int pakfire_archive_import_filelist_from_json(
- pakfire_archive* archive, struct pakfire_package* package) {
+ pakfire_archive* archive, pakfire_package* package) {
struct json_object* array = NULL;
int r;
}
static int pakfire_archive_make_package_from_json(pakfire_archive* archive,
- struct pakfire_repo* repo, struct pakfire_package** package) {
- struct pakfire_package* pkg = NULL;
+ struct pakfire_repo* repo, pakfire_package** package) {
+ pakfire_package* pkg = NULL;
char path[PATH_MAX];
int r;
Copy all metadata from this archive to the package object
*/
int pakfire_archive_make_package(pakfire_archive* archive,
- struct pakfire_repo* repo, struct pakfire_package** package) {
+ struct pakfire_repo* repo, pakfire_package** package) {
struct pakfire_repo* dummy = NULL;
int r;
const enum pakfire_hash_type type, const unsigned char* checksum, const size_t length);
int pakfire_archive_make_package(pakfire_archive* archive,
- struct pakfire_repo* repo, struct pakfire_package** package);
+ struct pakfire_repo* repo, pakfire_package** package);
int pakfire_archive_lint(pakfire_archive* archive,
pakfire_linter_result_callback callback, void* data);
struct pakfire_find_deps_ctx {
pakfire_build* build;
- struct pakfire_package* pkg;
+ pakfire_package* pkg;
pakfire_filelist* filelist;
};
-static int pakfire_build_process_pkgconfig_dep(struct pakfire_package* pkg,
+static int pakfire_build_process_pkgconfig_dep(pakfire_package* pkg,
const enum pakfire_package_key key, const char* line, const size_t length) {
char buffer[PATH_MAX];
int r;
return 0;
}
-static int pakfire_build_add_perl_dep(pakfire_ctx* ctx, struct pakfire_package* pkg,
+static int pakfire_build_add_perl_dep(pakfire_ctx* ctx, pakfire_package* pkg,
const enum pakfire_package_key key, const char* line, size_t length) {
// Add the dependency
return pakfire_package_add_dep(pkg, key, "%.*s", (int)length, line);
static int pakfire_build_add_perl_provides(pakfire_ctx* ctx, void* data,
const enum pakfire_jail_output_stream stream, const char* line, size_t length) {
- struct pakfire_package* pkg = data;
+ pakfire_package* pkg = data;
switch (stream) {
// Process output
static int pakfire_build_add_perl_requires(pakfire_ctx* ctx, void* data,
const enum pakfire_jail_output_stream stream, const char* line, size_t length) {
- struct pakfire_package* pkg = data;
+ pakfire_package* pkg = data;
switch (stream) {
// Process output
}
static int pakfire_build_find_perl_deps(pakfire_build* build,
- struct pakfire_package* pkg, pakfire_filelist* filelist) {
+ pakfire_package* pkg, pakfire_filelist* filelist) {
pakfire_filelist* perlfiles = NULL;
const char* args[] = {
build->buildroot,
static int pakfire_build_find_dependencies(pakfire_build* build,
struct pakfire_parser* makefile, const char* namespace,
- struct pakfire_package* pkg, pakfire_filelist* filelist) {
+ pakfire_package* pkg, pakfire_filelist* filelist) {
char* filter_provides = NULL;
char* filter_requires = NULL;
int r;
static int pakfire_build_package_add_files(pakfire_build* build,
struct pakfire_parser* makefile, const char* buildroot, const char* namespace,
- struct pakfire_package* pkg, pakfire_packager* packager) {
+ pakfire_package* pkg, pakfire_packager* packager) {
pakfire_filelist* filelist = NULL;
char** includes = NULL;
char** excludes = NULL;
}
static int pakfire_build_add_scriptlet_requires(pakfire_build* build,
- struct pakfire_package* pkg, struct pakfire_scriptlet* scriptlet) {
+ pakfire_package* pkg, struct pakfire_scriptlet* scriptlet) {
struct pakfire_input_buffer buffer = {};
int r;
}
static int pakfire_build_package_add_scriptlet(pakfire_build* build,
- struct pakfire_package* pkg, pakfire_packager* packager,
+ pakfire_package* pkg, pakfire_packager* packager,
const char* type, const char* data) {
struct pakfire_scriptlet* scriptlet = NULL;
char* shell = NULL;
static int pakfire_build_package_add_scriptlets(pakfire_build* build,
struct pakfire_parser* makefile, const char* namespace,
- struct pakfire_package* pkg, pakfire_packager* packager) {
+ pakfire_package* pkg, pakfire_packager* packager) {
char name[NAME_MAX];
int r;
static int pakfire_build_package(pakfire_build* build, struct pakfire_parser* makefile,
const char* buildroot, const char* namespace) {
pakfire_archive* archive = NULL;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
pakfire_packager* packager = NULL;
int r = 1;
}
static int pakfire_build_package_dump(pakfire_ctx* ctx,
- struct pakfire_package* pkg, void* p) {
+ pakfire_package* pkg, void* p) {
pakfire_build* build = p;
char* dump = pakfire_package_dump(pkg, PAKFIRE_PKG_DUMP_LONG);
}
static int pakfire_build_read_makefile(pakfire_build* build,
- struct pakfire_parser** parser, struct pakfire_package* package) {
+ struct pakfire_parser** parser, pakfire_package* package) {
char path[PATH_MAX];
int r;
}
static int pakfire_build_install_package(pakfire_ctx* ctx,
- struct pakfire_package* pkg, void* p) {
+ pakfire_package* pkg, void* p) {
struct pakfire_transaction* transaction = (struct pakfire_transaction*)p;
return pakfire_transaction_request_package(transaction,
}
static int pakfire_build_init(pakfire_build* build,
- struct pakfire_package* package, const char** packages) {
+ pakfire_package* package, const char** packages) {
struct pakfire_transaction* transaction = NULL;
char* problems = NULL;
int r;
}
static int pakfire_build_lint_archive(
- pakfire_ctx* ctx, struct pakfire_package* pkg, pakfire_archive* archive, void* data) {
+ pakfire_ctx* ctx, pakfire_package* pkg, pakfire_archive* archive, void* data) {
return pakfire_archive_lint(archive, NULL, NULL);
}
void* data;
} pakfire_build_result;
-static int __pakfire_build_result(pakfire_ctx* ctx, struct pakfire_package* pkg,
+static int __pakfire_build_result(pakfire_ctx* ctx, pakfire_package* pkg,
pakfire_archive* archive, void* data) {
const pakfire_build_result* result = data;
pakfire_build* build = result->build;
int pakfire_build_exec(pakfire_build* build, const char* path,
pakfire_build_result_callback result_callback, void* data) {
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
struct pakfire_parser* makefile = NULL;
char* problems = NULL;
char duration[TIME_STRING_MAX];
queue_push2(&pool->pooljobs, SOLVER_USERINSTALLED|SOLVER_SOLVABLE_NAME, id);
}
-static int pakfire_db_add_dependencies(pakfire_db* db, unsigned long id, struct pakfire_package* pkg) {
+static int pakfire_db_add_dependencies(pakfire_db* db, unsigned long id, pakfire_package* pkg) {
sqlite3_stmt* stmt = NULL;
char** list = NULL;
int r = 1;
}
int pakfire_db_add_package(pakfire_db* db,
- struct pakfire_package* pkg, pakfire_archive* archive, int userinstalled) {
+ pakfire_package* pkg, pakfire_archive* archive, int userinstalled) {
enum pakfire_hash_type hash_type = PAKFIRE_HASH_UNDEFINED;
const unsigned char* checksum = NULL;
size_t checksum_length = 0;
return r;
}
-int pakfire_db_remove_package(pakfire_db* db, struct pakfire_package* pkg) {
+int pakfire_db_remove_package(pakfire_db* db, pakfire_package* pkg) {
sqlite3_stmt* stmt = NULL;
int r = 1;
}
struct pakfire_scriptlet* pakfire_db_get_scriptlet(pakfire_db* db,
- struct pakfire_package* pkg, const char* type) {
+ pakfire_package* pkg, const char* type) {
struct pakfire_scriptlet* scriptlet = NULL;
sqlite3_stmt* stmt = NULL;
int r = 1;
}
static int pakfire_db_load_package(pakfire_db* db, struct pakfire_repo* repo, sqlite3_stmt* stmt) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int r = 1;
// Name
}
int pakfire_db_package_filelist(pakfire_db* db, pakfire_filelist** filelist,
- struct pakfire_package* pkg) {
+ pakfire_package* pkg) {
pakfire_filelist* fl = NULL;
sqlite3_stmt* stmt = NULL;
int r = 1;
ssize_t pakfire_db_packages(pakfire_db* db);
-int pakfire_db_add_package(pakfire_db* db, struct pakfire_package* pkg,
+int pakfire_db_add_package(pakfire_db* db, pakfire_package* pkg,
pakfire_archive* archive, int userinstalled);
-int pakfire_db_remove_package(pakfire_db* db, struct pakfire_package* pkg);
+int pakfire_db_remove_package(pakfire_db* db, pakfire_package* pkg);
int pakfire_db_load(pakfire_db* db, struct pakfire_repo* repo);
struct pakfire_scriptlet* pakfire_db_get_scriptlet(
- pakfire_db* db, struct pakfire_package* pkg, const char* type);
+ pakfire_db* db, pakfire_package* pkg, const char* type);
int pakfire_db_filelist(pakfire_db* db, pakfire_filelist** filelist);
int pakfire_db_package_filelist(pakfire_db* db, pakfire_filelist** filelist,
- struct pakfire_package* pkg);
+ pakfire_package* pkg);
#endif /* PAKFIRE_DB_H */
return id;
}
-int pakfire_str2deps(struct pakfire* pakfire, struct pakfire_package* pkg,
+int pakfire_str2deps(struct pakfire* pakfire, pakfire_package* pkg,
const enum pakfire_package_key key, const char* deps) {
char* p = NULL;
int r = 0;
const char* pakfire_dep2str(struct pakfire* pakfire, Id id);
Id pakfire_str2dep(struct pakfire* pakfire, const char* s);
-int pakfire_str2deps(struct pakfire* pakfire, struct pakfire_package* pkg,
+int pakfire_str2deps(struct pakfire* pakfire, pakfire_package* pkg,
const enum pakfire_package_key key, const char* deps);
#endif /* PAKFIRE_DEPENDENCIES_H */
}
static int pakfire_dist_add_source(struct pakfire* pakfire, pakfire_packager* packager,
- struct pakfire_package* pkg, pakfire_ctx* ctx,
+ pakfire_package* pkg, pakfire_ctx* ctx,
pakfire_mirrorlist* mirrorlist, const char* filename) {
char archive_path[PATH_MAX];
char cache_path[PATH_MAX];
}
static int pakfire_dist_add_sources(pakfire_ctx* ctx, struct pakfire* pakfire,
- pakfire_packager* packager, struct pakfire_package* pkg, struct pakfire_parser* makefile) {
+ pakfire_packager* packager, pakfire_package* pkg, struct pakfire_parser* makefile) {
pakfire_mirrorlist* mirrorlist = NULL;
char* sources = NULL;
char* p = NULL;
int pakfire_dist(struct pakfire* pakfire,
const char* path, pakfire_archive** archive) {
pakfire_packager* packager = NULL;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
struct pakfire_parser* makefile = NULL;
struct pakfire_parser_error* error = NULL;
pakfire_archive* a = NULL;
static int pakfire_job_result(pakfire_ctx* ctx, struct pakfire* pakfire,
pakfire_build* build, pakfire_archive* archive, void* data) {
pakfire_job* self = data;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
const char* filename = NULL;
const char* nevra = NULL;
char path[PATH_MAX];
pakfire_archive* archive;
// Package
- struct pakfire_package* pkg;
+ pakfire_package* pkg;
// Filelist
pakfire_filelist* filelist;
};
typedef int (*pakfire_linter_result_callback)(pakfire_ctx* ctx,
- pakfire_archive* archive, struct pakfire_package* package,
+ pakfire_archive* archive, pakfire_package* package,
pakfire_file* file, int priority, const char* message, void* data);
typedef struct pakfire_linter pakfire_linter;
} filters;
};
-static Solvable* get_solvable(struct pakfire_package* pkg) {
+static Solvable* get_solvable(pakfire_package* pkg) {
Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
return pool_id2solvable(pool, pkg->id);
return 0;
}
-static int pakfire_package_add_depid(struct pakfire_package* pkg,
+static int pakfire_package_add_depid(pakfire_package* pkg,
const enum pakfire_package_key key, Id dep) {
Solvable* s = get_solvable(pkg);
int r;
return 0;
}
-static int pakfire_package_add_self_provides(struct pakfire_package* pkg) {
+static int pakfire_package_add_self_provides(pakfire_package* pkg) {
// Fetch the solvable
Solvable* s = get_solvable(pkg);
if (!s)
return pakfire_package_add_depid(pkg, PAKFIRE_PKG_PROVIDES, dep);
}
-int pakfire_package_create_from_solvable(struct pakfire_package** package,
+int pakfire_package_create_from_solvable(pakfire_package** package,
struct pakfire* pakfire, struct pakfire_repo* repo, Id id) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
// Allocate some memory
pkg = calloc(1, sizeof(*pkg));
return 0;
}
-int pakfire_package_create(struct pakfire_package** package,
+int pakfire_package_create(pakfire_package** package,
struct pakfire* pakfire, struct pakfire_repo* repo,
const char* name, const char* evr, const char* arch) {
struct pakfire_repo* dummy = NULL;
return r;
}
-static void pakfire_package_free(struct pakfire_package* pkg) {
+static void pakfire_package_free(pakfire_package* pkg) {
if (pkg->filters.requires)
pcre2_code_free(pkg->filters.requires);
if (pkg->filters.provides)
free(pkg);
}
-struct pakfire_package* pakfire_package_ref(struct pakfire_package* pkg) {
+pakfire_package* pakfire_package_ref(pakfire_package* pkg) {
pkg->nrefs++;
return pkg;
}
-struct pakfire_package* pakfire_package_unref(struct pakfire_package* pkg) {
+pakfire_package* pakfire_package_unref(pakfire_package* pkg) {
if (--pkg->nrefs > 0)
return pkg;
/*
Destroys the package (i.e. removes its membership from any repository)
*/
-int pakfire_package_destroy(struct pakfire_package* self) {
+int pakfire_package_destroy(pakfire_package* self) {
Solvable* s = get_solvable(self);
// Remove the reference to the repository
return 0;
}
-struct pakfire* pakfire_package_get_pakfire(struct pakfire_package* pkg) {
+struct pakfire* pakfire_package_get_pakfire(pakfire_package* pkg) {
return pakfire_ref(pkg->pakfire);
}
-int pakfire_package_eq(struct pakfire_package* pkg1, struct pakfire_package* pkg2) {
+int pakfire_package_eq(pakfire_package* pkg1, pakfire_package* pkg2) {
return pkg1->id == pkg2->id;
}
-int pakfire_package_cmp(struct pakfire_package* pkg1, struct pakfire_package* pkg2) {
+int pakfire_package_cmp(pakfire_package* pkg1, pakfire_package* pkg2) {
Pool* pool = pakfire_get_solv_pool(pkg1->pakfire);
Solvable* s1 = get_solvable(pkg1);
return strcmp(str1, str2);
}
-int pakfire_package_evr_cmp(struct pakfire_package* pkg1, struct pakfire_package* pkg2) {
+int pakfire_package_evr_cmp(pakfire_package* pkg1, pakfire_package* pkg2) {
Pool* pool = pakfire_get_solv_pool(pkg1->pakfire);
Solvable* s1 = get_solvable(pkg1);
return pool_evrcmp(pool, s1->evr, s2->evr, EVRCMP_COMPARE);
}
-unsigned int pakfire_package_id(struct pakfire_package* pkg) {
+unsigned int pakfire_package_id(pakfire_package* pkg) {
return pkg->id;
}
return buffer;
}
-int pakfire_package_is_source(struct pakfire_package* pkg) {
+int pakfire_package_is_source(pakfire_package* pkg) {
const char* arch = pakfire_package_get_string(pkg, PAKFIRE_PKG_ARCH);
if (!arch)
return 1;
return (strcmp(arch, "src") == 0);
}
-static void pakfire_package_internalize_repo(struct pakfire_package* pkg) {
+static void pakfire_package_internalize_repo(pakfire_package* pkg) {
struct pakfire_repo* repo = pakfire_package_get_repo(pkg);
if (repo) {
pakfire_repo_internalize(repo, 0);
}
}
-static void pakfire_package_has_changed(struct pakfire_package* pkg) {
+static void pakfire_package_has_changed(pakfire_package* pkg) {
struct pakfire_repo* repo = pakfire_package_get_repo(pkg);
if (repo) {
pakfire_repo_has_changed(repo);
return evr;
}
-const char* pakfire_package_get_filename(struct pakfire_package* pkg) {
+const char* pakfire_package_get_filename(pakfire_package* pkg) {
int r;
if (!*pkg->filename) {
return pkg->filename;
}
-static int pakfire_package_make_path_internal(struct pakfire_package* self) {
+static int pakfire_package_make_path_internal(pakfire_package* self) {
const char* path = NULL;
// Fetch the path
return pakfire_string_set(self->local_path, path);
}
-static int pakfire_package_make_path_local(struct pakfire_package* self, struct pakfire_repo* repo) {
+static int pakfire_package_make_path_local(pakfire_package* self, struct pakfire_repo* repo) {
const char* path = NULL;
// Fetch the path
return pakfire_repo_path(repo, self->local_path, "%s", path);
}
-static int pakfire_package_make_path_cache(struct pakfire_package* self) {
+static int pakfire_package_make_path_cache(pakfire_package* self) {
const char* path = NULL;
// Fetch the cache path
/*
Returns the path this package is or should be stored.
*/
-const char* pakfire_package_get_path(struct pakfire_package* self) {
+const char* pakfire_package_get_path(pakfire_package* self) {
struct pakfire_repo* repo = NULL;
int r;
return (r == 0) ? self->local_path : NULL;
}
-static int pakfire_package_make_cache_path(struct pakfire_package* pkg) {
+static int pakfire_package_make_cache_path(pakfire_package* pkg) {
const char* nevra = pakfire_package_get_string(pkg, PAKFIRE_PKG_NEVRA);
// Fetch the filename
return pakfire_cache_path(pkg->pakfire, pkg->cache_path, "%s/%s", uuid, filename);
}
-void pakfire_package_unset(struct pakfire_package* pkg,
+void pakfire_package_unset(pakfire_package* pkg,
const enum pakfire_package_key key) {
Id id = ID_NULL;
}
char** pakfire_package_get_strings(
- struct pakfire_package* pkg, const enum pakfire_package_key key) {
+ pakfire_package* pkg, const enum pakfire_package_key key) {
char** ret = NULL;
const char* str = NULL;
Queue strings;
return ret;
}
-int pakfire_package_set_strings(struct pakfire_package* pkg,
+int pakfire_package_set_strings(pakfire_package* pkg,
const enum pakfire_package_key key, const char** values) {
int r;
return 0;
}
-int pakfire_package_set_strings_from_string(struct pakfire_package* pkg,
+int pakfire_package_set_strings_from_string(pakfire_package* pkg,
const enum pakfire_package_key key, const char* value) {
char* buffer = NULL;
char* p = NULL;
}
const char* pakfire_package_get_string(
- struct pakfire_package* pkg, const enum pakfire_package_key key) {
+ pakfire_package* pkg, const enum pakfire_package_key key) {
const char* ret = NULL;
int r;
}
int pakfire_package_set_string(
- struct pakfire_package* pkg, const enum pakfire_package_key key, const char* value) {
+ pakfire_package* pkg, const enum pakfire_package_key key, const char* value) {
char basename[PATH_MAX];
char dirname[PATH_MAX];
Id id = ID_NULL;
return 0;
}
-int pakfire_package_add_string(struct pakfire_package* pkg,
+int pakfire_package_add_string(pakfire_package* pkg,
const enum pakfire_package_key key, const char* value) {
Id key_id = ID_NULL;
Id value_id = ID_NULL;
return 0;
}
-int pakfire_package_get_uuid(struct pakfire_package* pkg,
+int pakfire_package_get_uuid(pakfire_package* pkg,
const enum pakfire_package_key key, uuid_t uuid) {
const char* buffer = NULL;
int r;
}
}
-int pakfire_package_set_uuid(struct pakfire_package* pkg,
+int pakfire_package_set_uuid(pakfire_package* pkg,
const enum pakfire_package_key key, const uuid_t uuid) {
char buffer[UUID_STR_LEN];
}
}
-unsigned long long pakfire_package_get_num(struct pakfire_package* pkg,
+unsigned long long pakfire_package_get_num(pakfire_package* pkg,
const enum pakfire_package_key key, unsigned long long notfound) {
Id id = ID_NULL;
return solvable_lookup_num(s, id, notfound);
}
-int pakfire_package_set_num(struct pakfire_package* pkg,
+int pakfire_package_set_num(pakfire_package* pkg,
const enum pakfire_package_key key, unsigned long long num) {
Id id = ID_NULL;
return 0;
}
-int pakfire_package_get_checksum(struct pakfire_package* pkg,
+int pakfire_package_get_checksum(pakfire_package* pkg,
enum pakfire_hash_type* hash, const unsigned char** checksum, size_t* length) {
Solvable* s = get_solvable(pkg);
Id id = 0;
return 0;
}
-int pakfire_package_set_checksum(struct pakfire_package* pkg,
+int pakfire_package_set_checksum(pakfire_package* pkg,
const enum pakfire_hash_type hash, const unsigned char* digest, const size_t length) {
struct pakfire_repo* repo = NULL;
Id id = ID_NULL;
/*
This function checks if the archive is available.
*/
-int pakfire_package_is_available(struct pakfire_package* self) {
+int pakfire_package_is_available(pakfire_package* self) {
const char* path = NULL;
struct stat st = {};
int r;
return 1;
}
-int pakfire_package_is_installed(struct pakfire_package* pkg) {
+int pakfire_package_is_installed(pakfire_package* pkg) {
Pool* pool = pakfire_get_solv_pool(pkg->pakfire);
Solvable* s = get_solvable(pkg);
return pool->installed == s->repo;
}
-size_t pakfire_package_get_size(struct pakfire_package* pkg) {
+size_t pakfire_package_get_size(pakfire_package* pkg) {
if (pakfire_package_is_installed(pkg))
return pakfire_package_get_num(pkg, PAKFIRE_PKG_INSTALLSIZE, 0);
// Build
-int pakfire_package_supports_build_arch(struct pakfire_package* pkg, const char* arch) {
+int pakfire_package_supports_build_arch(pakfire_package* pkg, const char* arch) {
int supported = 0;
// Fetch all supported arches for this package
// Dependencies
-char** pakfire_package_get_deps(struct pakfire_package* pkg,
+char** pakfire_package_get_deps(pakfire_package* pkg,
const enum pakfire_package_key key) {
Solvable* s = get_solvable(pkg);
char** ret = NULL;
return ret;
}
-int pakfire_package_add_dep_filter(struct pakfire_package* pkg,
+int pakfire_package_add_dep_filter(pakfire_package* pkg,
const enum pakfire_package_key key, const char* pattern) {
pcre2_code* filter = NULL;
int r;
return 0;
}
-static int pakfire_package_filter_dep(struct pakfire_package* pkg,
+static int pakfire_package_filter_dep(pakfire_package* pkg,
const pcre2_code* filter, const char* dep) {
pcre2_match_data* match = NULL;
char error[120];
return r;
}
-int pakfire_package_add_dep(struct pakfire_package* pkg,
+int pakfire_package_add_dep(pakfire_package* pkg,
const enum pakfire_package_key key, const char* format, ...) {
char buffer[PATH_MAX];
va_list args;
return pakfire_package_add_depid(pkg, key, id);
}
-int pakfire_package_get_reverse_requires(struct pakfire_package* pkg,
+int pakfire_package_get_reverse_requires(pakfire_package* pkg,
pakfire_packagelist** ret) {
pakfire_packagelist* list = NULL;
Queue matches;
}
static int pakfire_package_has_rich_deps_in_deparray(
- struct pakfire_package* pkg, Id type) {
+ pakfire_package* pkg, Id type) {
int r = 0;
Solvable* s = get_solvable(pkg);
return r;
}
-int pakfire_package_has_rich_deps(struct pakfire_package* pkg) {
+int pakfire_package_has_rich_deps(pakfire_package* pkg) {
const Id types[] = {
// Requires (includes pre-requires)
SOLVABLE_REQUIRES,
return 0;
}
-static int pakfire_package_matches_depid(struct pakfire_package* pkg,
+static int pakfire_package_matches_depid(pakfire_package* pkg,
const enum pakfire_package_key key, const Id dep) {
int r;
return solvable_matchesdep(s, id, dep, marker);
}
-int pakfire_package_matches_dep(struct pakfire_package* pkg,
+int pakfire_package_matches_dep(pakfire_package* pkg,
const enum pakfire_package_key key, const char* dep) {
// Get the dependency
Id id = pakfire_str2dep(pkg->pakfire, dep);
return pakfire_package_matches_depid(pkg, key, id);
}
-struct pakfire_repo* pakfire_package_get_repo(struct pakfire_package* pkg) {
+struct pakfire_repo* pakfire_package_get_repo(pakfire_package* pkg) {
int r;
// Open the repository if not done, yet
return strcmp(dep1, dep2);
}
-char* pakfire_package_dump(struct pakfire_package* pkg, int flags) {
+char* pakfire_package_dump(pakfire_package* pkg, int flags) {
enum pakfire_hash_type hash = PAKFIRE_HASH_UNDEFINED;
const unsigned char* checksum = NULL;
size_t checksum_length = 0;
return NULL;
}
-int pakfire_package_get_archive(struct pakfire_package* pkg, pakfire_archive** archive) {
+int pakfire_package_get_archive(pakfire_package* pkg, pakfire_archive** archive) {
const char* path = NULL;
int r;
return 0;
}
-struct pakfire_package_filelist_search {
+typedef struct pakfire_package_filelist_search {
struct pakfire* pakfire;
pakfire_filelist* filelist;
int r;
-};
+} pakfire_package_filelist_search;
static int __pakfire_package_fetch_filelist(void* data, Solvable* s, Repodata* repodata,
Repokey* key, struct s_KeyValue* kv) {
- struct pakfire_package_filelist_search* search = (struct pakfire_package_filelist_search*)data;
+ pakfire_package_filelist_search* search = (pakfire_package_filelist_search*)data;
pakfire_file* file = NULL;
int r;
return r;
}
-static int pakfire_package_fetch_filelist(struct pakfire_package* pkg, pakfire_filelist* filelist) {
- struct pakfire_package_filelist_search search = {
+static int pakfire_package_fetch_filelist(pakfire_package* pkg, pakfire_filelist* filelist) {
+ pakfire_package_filelist_search search = {
.pakfire = pkg->pakfire,
.filelist = filelist,
.r = 0,
return search.r;
}
-pakfire_filelist* pakfire_package_get_filelist(struct pakfire_package* pkg) {
+pakfire_filelist* pakfire_package_get_filelist(pakfire_package* pkg) {
pakfire_filelist* filelist = NULL;
// Create a new filelist
return NULL;
}
-int pakfire_package_append_file(struct pakfire_package* pkg, const char* path) {
+int pakfire_package_append_file(pakfire_package* pkg, const char* path) {
char basename[PATH_MAX];
char dirname[PATH_MAX];
int r;
static int __pakfire_package_set_filelist(
pakfire_ctx* ctx, pakfire_file* file, void* data) {
- struct pakfire_package* pkg = data;
+ pakfire_package* pkg = data;
// Fetch the path
const char* path = pakfire_file_get_path(file);
}
int pakfire_package_set_filelist(
- struct pakfire_package* pkg, pakfire_filelist* filelist) {
+ pakfire_package* pkg, pakfire_filelist* filelist) {
return pakfire_filelist_walk(filelist, __pakfire_package_set_filelist, pkg, 0, NULL);
}
-int pakfire_package_set_filelist_from_string(struct pakfire_package* pkg, const char* files) {
+int pakfire_package_set_filelist_from_string(pakfire_package* pkg, const char* files) {
char* p = NULL;
int r = 0;
}
static int _pakfire_package_add_json_dependencies(
- struct pakfire_package* pkg,
+ pakfire_package* pkg,
struct json_object* json,
const char* name,
const enum pakfire_package_key key) {
}
static int pakfire_package_add_json_dependencies(
- struct pakfire_package* pkg, struct json_object* md) {
+ pakfire_package* pkg, struct json_object* md) {
int r = 0;
// Create new dependencies object
}
static int pakfire_package_add_json_filelist(
- struct pakfire_package* pkg, struct json_object* md) {
+ pakfire_package* pkg, struct json_object* md) {
pakfire_filelist* filelist = NULL;
struct json_object* object = NULL;
int r;
}
static int __pakfire_package_add_build_packages(pakfire_ctx* ctx,
- struct pakfire_package* pkg, void* p) {
+ pakfire_package* pkg, void* p) {
struct json_object* object = (struct json_object*)p;
int r;
return 0;
}
-static int pakfire_package_add_build_packages(struct pakfire_package* pkg,
+static int pakfire_package_add_build_packages(pakfire_package* pkg,
struct json_object* md) {
struct pakfire_repo* repo = NULL;
struct json_object* object = NULL;
return r;
}
-static int pakfire_package_add_build_metadata(struct pakfire_package* pkg,
+static int pakfire_package_add_build_metadata(pakfire_package* pkg,
struct json_object* md) {
int r;
return r;
}
-int pakfire_package_to_json(struct pakfire_package* pkg, struct json_object** json) {
+int pakfire_package_to_json(pakfire_package* pkg, struct json_object** json) {
struct json_object* md = NULL;
int r = 0;
return r;
}
-int pakfire_package_installcheck(struct pakfire_package* pkg,
+int pakfire_package_installcheck(pakfire_package* pkg,
char** problem, int flags) {
struct pakfire_transaction* transaction = NULL;
char* p = NULL;
#include <uuid/uuid.h>
-struct pakfire_package;
+typedef struct pakfire_package pakfire_package;
#include <pakfire/filelist.h>
#include <pakfire/hashes.h>
PAKFIRE_PKG_ENHANCES,
};
-int pakfire_package_create(struct pakfire_package** package, struct pakfire* pakfire,
+int pakfire_package_create(pakfire_package** package, struct pakfire* pakfire,
struct pakfire_repo* repo, const char* name, const char* evr, const char* arch);
-struct pakfire_package* pakfire_package_ref(struct pakfire_package* pkg);
-struct pakfire_package* pakfire_package_unref(struct pakfire_package* pkg);
+pakfire_package* pakfire_package_ref(pakfire_package* pkg);
+pakfire_package* pakfire_package_unref(pakfire_package* pkg);
// Destroy
-int pakfire_package_destroy(struct pakfire_package* self);
+int pakfire_package_destroy(pakfire_package* self);
-struct pakfire* pakfire_package_get_pakfire(struct pakfire_package* pkg);
+struct pakfire* pakfire_package_get_pakfire(pakfire_package* pkg);
-int pakfire_package_eq(struct pakfire_package* pkg1, struct pakfire_package* pkg2);
-int pakfire_package_cmp(struct pakfire_package* pkg1, struct pakfire_package* pkg2);
-int pakfire_package_evr_cmp(struct pakfire_package* pkg1, struct pakfire_package* pkg2);
+int pakfire_package_eq(pakfire_package* pkg1, pakfire_package* pkg2);
+int pakfire_package_cmp(pakfire_package* pkg1, pakfire_package* pkg2);
+int pakfire_package_evr_cmp(pakfire_package* pkg1, pakfire_package* pkg2);
-unsigned int pakfire_package_id(struct pakfire_package* pkg);
+unsigned int pakfire_package_id(pakfire_package* pkg);
-void pakfire_package_unset(struct pakfire_package* pkg,
+void pakfire_package_unset(pakfire_package* pkg,
const enum pakfire_package_key key);
// String
-const char* pakfire_package_get_string(struct pakfire_package* pkg,
+const char* pakfire_package_get_string(pakfire_package* pkg,
const enum pakfire_package_key key);
-int pakfire_package_set_string(struct pakfire_package* pkg,
+int pakfire_package_set_string(pakfire_package* pkg,
const enum pakfire_package_key key, const char* value);
// String Arrays
-char** pakfire_package_get_strings(struct pakfire_package* pkg,
+char** pakfire_package_get_strings(pakfire_package* pkg,
const enum pakfire_package_key key);
-int pakfire_package_set_strings(struct pakfire_package* pkg,
+int pakfire_package_set_strings(pakfire_package* pkg,
const enum pakfire_package_key key, const char** values);
-int pakfire_package_add_string(struct pakfire_package* pkg,
+int pakfire_package_add_string(pakfire_package* pkg,
const enum pakfire_package_key key, const char* value);
// UUID
-int pakfire_package_get_uuid(struct pakfire_package* pkg,
+int pakfire_package_get_uuid(pakfire_package* pkg,
const enum pakfire_package_key key, uuid_t uuid);
-int pakfire_package_set_uuid(struct pakfire_package* pkg,
+int pakfire_package_set_uuid(pakfire_package* pkg,
const enum pakfire_package_key key, const uuid_t uuid);
// Numeric
-unsigned long long pakfire_package_get_num(struct pakfire_package* pkg,
+unsigned long long pakfire_package_get_num(pakfire_package* pkg,
const enum pakfire_package_key key, unsigned long long notfound);
-int pakfire_package_set_num(struct pakfire_package* pkg,
+int pakfire_package_set_num(pakfire_package* pkg,
const enum pakfire_package_key key, unsigned long long num);
// Dependencies
-char** pakfire_package_get_deps(struct pakfire_package* pkg,
+char** pakfire_package_get_deps(pakfire_package* pkg,
const enum pakfire_package_key key);
// Checksum
-int pakfire_package_get_checksum(struct pakfire_package* pkg,
+int pakfire_package_get_checksum(pakfire_package* pkg,
enum pakfire_hash_type* hash, const unsigned char** checksum, size_t* length);
-int pakfire_package_set_checksum(struct pakfire_package* pkg,
+int pakfire_package_set_checksum(pakfire_package* pkg,
const enum pakfire_hash_type hash, const unsigned char* digest, const size_t length);
-size_t pakfire_package_get_size(struct pakfire_package* pkg);
+size_t pakfire_package_get_size(pakfire_package* pkg);
-int pakfire_package_get_reverse_requires(struct pakfire_package* pkg,
+int pakfire_package_get_reverse_requires(pakfire_package* pkg,
pakfire_packagelist** list);
-struct pakfire_repo* pakfire_package_get_repo(struct pakfire_package* pkg);
+struct pakfire_repo* pakfire_package_get_repo(pakfire_package* pkg);
-char* pakfire_package_dump(struct pakfire_package* pkg, int flags);
+char* pakfire_package_dump(pakfire_package* pkg, int flags);
-int pakfire_package_get_archive(struct pakfire_package* pkg, pakfire_archive** archive);
+int pakfire_package_get_archive(pakfire_package* pkg, pakfire_archive** archive);
-pakfire_filelist* pakfire_package_get_filelist(struct pakfire_package* pkg);
-int pakfire_package_set_filelist(struct pakfire_package* pkg, pakfire_filelist* filelist);
-int pakfire_package_set_filelist_from_string(struct pakfire_package* pkg, const char* files);
+pakfire_filelist* pakfire_package_get_filelist(pakfire_package* pkg);
+int pakfire_package_set_filelist(pakfire_package* pkg, pakfire_filelist* filelist);
+int pakfire_package_set_filelist_from_string(pakfire_package* pkg, const char* files);
enum pakfire_package_dump_flags {
PAKFIRE_PKG_DUMP_FILELIST = 1 << 0,
};
// Installcheck
-int pakfire_package_installcheck(struct pakfire_package* pkg, char** problem, int flags);
+int pakfire_package_installcheck(pakfire_package* pkg, char** problem, int flags);
-int pakfire_package_create_from_solvable(struct pakfire_package** package,
+int pakfire_package_create_from_solvable(pakfire_package** package,
struct pakfire* pakfire, struct pakfire_repo* repo, Id id);
-int pakfire_package_set_strings_from_string(struct pakfire_package* pkg,
+int pakfire_package_set_strings_from_string(pakfire_package* pkg,
const enum pakfire_package_key key, const char* value);
-const char* pakfire_package_get_filename(struct pakfire_package* pkg);
-const char* pakfire_package_get_path(struct pakfire_package* self);
+const char* pakfire_package_get_filename(pakfire_package* pkg);
+const char* pakfire_package_get_path(pakfire_package* self);
-int pakfire_package_is_source(struct pakfire_package* pkg);
-int pakfire_package_supports_build_arch(struct pakfire_package* pkg, const char* arch);
+int pakfire_package_is_source(pakfire_package* pkg);
+int pakfire_package_supports_build_arch(pakfire_package* pkg, const char* arch);
char* pakfire_package_join_evr(const char* e, const char* v, const char* r);
-int pakfire_package_is_available(struct pakfire_package* self);
-int pakfire_package_is_installed(struct pakfire_package* pkg);
+int pakfire_package_is_available(pakfire_package* self);
+int pakfire_package_is_installed(pakfire_package* pkg);
// Filelist
-int pakfire_package_append_file(struct pakfire_package* pkg, const char* path);
+int pakfire_package_append_file(pakfire_package* pkg, const char* path);
// Dependencies
-int pakfire_package_add_dep_filter(struct pakfire_package* pkg,
+int pakfire_package_add_dep_filter(pakfire_package* pkg,
const enum pakfire_package_key key, const char* pattern);
-int pakfire_package_add_dep(struct pakfire_package* pkg,
+int pakfire_package_add_dep(pakfire_package* pkg,
const enum pakfire_package_key key, const char* format, ...)
__attribute__((format(printf, 3, 4)));
-int pakfire_package_has_rich_deps(struct pakfire_package* pkg);
-int pakfire_package_matches_dep(struct pakfire_package* pkg,
+int pakfire_package_has_rich_deps(pakfire_package* pkg);
+int pakfire_package_matches_dep(pakfire_package* pkg,
const enum pakfire_package_key key, const char* dep);
-int pakfire_package_to_json(struct pakfire_package* pkg, struct json_object** json);
+int pakfire_package_to_json(pakfire_package* pkg, struct json_object** json);
#endif /* PAKFIRE_PACKAGE_H */
pakfire_ctx* ctx;
int nrefs;
- struct pakfire_package** packages;
+ pakfire_package** packages;
unsigned int num_packages;
};
return self->num_packages;
}
-struct pakfire_package* pakfire_packagelist_get(pakfire_packagelist* self, unsigned int index) {
+pakfire_package* pakfire_packagelist_get(pakfire_packagelist* self, unsigned int index) {
// Check that index is in range
if (index >= self->num_packages) {
errno = ERANGE;
return pakfire_package_ref(self->packages[index]);
}
-static int pakfire_packagelist_search(pakfire_packagelist* self, struct pakfire_package* pkg) {
+static int pakfire_packagelist_search(pakfire_packagelist* self, pakfire_package* pkg) {
int i;
int r;
return lo;
}
-int pakfire_packagelist_add(pakfire_packagelist* self, struct pakfire_package* pkg) {
+int pakfire_packagelist_add(pakfire_packagelist* self, pakfire_package* pkg) {
// Find the index where the package should go
int pos = pakfire_packagelist_search(self, pkg);
int pakfire_packagelist_import_solvables(pakfire_packagelist* self,
struct pakfire* pakfire, Queue* q) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int r;
// Walk through all elements on the queue
}
static int __pakfire_packagelist_has_path(
- pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) {
+ pakfire_ctx* ctx, pakfire_package* pkg, void* data) {
const char* path = data;
// Fetch the path where we would expect this package to be
pakfire_packagelist* pakfire_packagelist_unref(pakfire_packagelist* list);
size_t pakfire_packagelist_length(pakfire_packagelist* list);
-struct pakfire_package* pakfire_packagelist_get(pakfire_packagelist* list, unsigned int index);
+pakfire_package* pakfire_packagelist_get(pakfire_packagelist* list, unsigned int index);
-int pakfire_packagelist_add(pakfire_packagelist* list, struct pakfire_package* pkg);
+int pakfire_packagelist_add(pakfire_packagelist* list, pakfire_package* pkg);
int pakfire_packagelist_add_list(pakfire_packagelist* self, pakfire_packagelist* other);
typedef int (*pakfire_packagelist_walk_callback)
- (pakfire_ctx* ctx, struct pakfire_package* pkg, void* p);
+ (pakfire_ctx* ctx, pakfire_package* pkg, void* p);
enum pakfire_packagelist_walk_flags {
PAKFIRE_PACKAGELIST_KEEPGOING = (1 << 0),
time_t time_created;
- struct pakfire_package* pkg;
+ pakfire_package* pkg;
char filename[PATH_MAX];
// Reader
}
int pakfire_packager_create(pakfire_packager** packager,
- struct pakfire* pakfire, struct pakfire_package* pkg) {
+ struct pakfire* pakfire, pakfire_package* pkg) {
pakfire_packager* p = NULL;
char hostname[HOST_NAME_MAX];
int r = 1;
typedef struct pakfire_packager pakfire_packager;
int pakfire_packager_create(pakfire_packager** packager,
- struct pakfire* pakfire, struct pakfire_package* pkg);
+ struct pakfire* pakfire, pakfire_package* pkg);
pakfire_packager* pakfire_packager_ref(pakfire_packager* packager);
pakfire_packager* pakfire_packager_unref(pakfire_packager* packager);
Convenience function to dist() a package on the fly
*/
static int pakfire_commandline_dist(struct pakfire* pakfire, struct pakfire_repo* repo,
- const char* path, struct pakfire_package** pkg) {
+ const char* path, pakfire_package** pkg) {
pakfire_archive* archive = NULL;
int r;
Convenience function to add a package to the @commandline repository
*/
int pakfire_commandline_add(struct pakfire* pakfire, const char* path,
- struct pakfire_package** package) {
+ pakfire_package** package) {
struct pakfire_repo* repo = NULL;
int r;
return 0;
}
-static int __pakfire_whatrequires(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) {
+static int __pakfire_whatrequires(pakfire_ctx* ctx, pakfire_package* pkg, void* data) {
pakfire_packagelist* reverse = NULL;
pakfire_packagelist* list = data;
int r;
struct pakfire_repo* pakfire_get_installed_repo(struct pakfire* pakfire);
int pakfire_commandline_add(struct pakfire* pakfire, const char* path,
- struct pakfire_package** package);
+ pakfire_package** package);
typedef int (*pakfire_repo_walk_callback)
(struct pakfire* pakfire, struct pakfire_repo* repo, void* p);
}
int pakfire_parser_create_package(struct pakfire_parser* parser,
- struct pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch) {
+ pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch) {
int r = 1;
char* name = NULL;
int pakfire_parser_set_namespace(struct pakfire_parser* parser, const char* namespace);
int pakfire_parser_create_package(struct pakfire_parser* parser,
- struct pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch);
+ pakfire_package** pkg, struct pakfire_repo* repo, const char* namespace, const char* default_arch);
// Errors
int pakfire_parser_error_create(struct pakfire_parser_error** error,
static int pakfire_repo_to_packagelist(
struct pakfire_repo* self, pakfire_packagelist** list) {
pakfire_packagelist* l = NULL;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
Solvable* s = NULL;
Id id;
int i;
}
int __pakfire_repo_make_path(struct pakfire_repo* self, char* path, size_t length,
- pakfire_archive* archive, struct pakfire_package* pkg) {
+ pakfire_archive* archive, pakfire_package* pkg) {
const char* uuid = NULL;
// Fetch NEVRA
}
int pakfire_repo_import_archive(struct pakfire_repo* self,
- pakfire_archive* archive, struct pakfire_package** package) {
- struct pakfire_package* pkg = NULL;
+ pakfire_archive* archive, pakfire_package** package) {
+ pakfire_package* pkg = NULL;
char path[PATH_MAX];
int r;
static int __pakfire_repo_scan_archive(struct pakfire_repo* repo,
struct pakfire_repo_scan_ctx* scan_ctx, FTSENT* entry) {
pakfire_archive* archive = NULL;
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
int r = 0;
// Skip this package if it already exists
return r;
}
-static int pakfire_repo_sync_remove(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) {
+static int pakfire_repo_sync_remove(pakfire_ctx* ctx, pakfire_package* pkg, void* data) {
int r;
// Check if the package is available
}
int pakfire_repo_download_package(struct pakfire_xfer** xfer,
- struct pakfire_repo* repo, struct pakfire_package* pkg) {
+ struct pakfire_repo* repo, pakfire_package* pkg) {
enum pakfire_hash_type hash = PAKFIRE_HASH_UNDEFINED;
const unsigned char* checksum = NULL;
size_t checksum_length = 0;
}
static int pakfire_repo_download(struct pakfire_repo* repo, const char* url,
- struct pakfire_package** package) {
+ pakfire_package** package) {
struct pakfire_xfer* xfer = NULL;
FILE* f = NULL;
int r;
}
int pakfire_repo_add(struct pakfire_repo* repo, const char* path,
- struct pakfire_package** package) {
+ pakfire_package** package) {
pakfire_archive* archive = NULL;
int r;
static int pakfire_repo_delete_all_packages(
struct pakfire_repo* repo, const char* prefix) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
Solvable* s = NULL;
int i = 0;
int r;
}
int pakfire_repo_walk_packages(struct pakfire_repo* self,
- int (*callback)(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data), void* data, int flags) {
+ int (*callback)(pakfire_ctx* ctx, pakfire_package* pkg, void* data), void* data, int flags) {
pakfire_packagelist* list = NULL;
int r;
};
static int __pakfire_repo_walk_archives(
- pakfire_ctx* ctx, struct pakfire_package* pkg, void* data) {
+ pakfire_ctx* ctx, pakfire_package* pkg, void* data) {
const struct pakfire_repo_walk_archives_state* state = data;
pakfire_archive* archive = NULL;
int r;
#define pakfire_repo_make_path(repo, path, archive, pkg) \
__pakfire_repo_make_path(repo, path, sizeof(path), archive, pkg)
int __pakfire_repo_make_path(struct pakfire_repo* self,
- char* path, size_t length, pakfire_archive* archive, struct pakfire_package* pkg);
+ char* path, size_t length, pakfire_archive* archive, pakfire_package* pkg);
int pakfire_repo_import_archive(struct pakfire_repo* self,
- pakfire_archive* archive, struct pakfire_package** package);
+ pakfire_archive* archive, pakfire_package** package);
int pakfire_repo_download_package(struct pakfire_xfer** xfer,
- struct pakfire_repo* repo, struct pakfire_package* pkg);
+ struct pakfire_repo* repo, pakfire_package* pkg);
int pakfire_repo_add(struct pakfire_repo* repo, const char* path,
- struct pakfire_package** package);
+ pakfire_package** package);
void pakfire_repo_free_all(struct pakfire* pakfire);
pakfire_mirrorlist* pakfire_repo_get_mirrorlist(struct pakfire_repo* repo);
int pakfire_repo_walk_packages(struct pakfire_repo* self,
- int (*callback)(pakfire_ctx* ctx, struct pakfire_package* pkg, void* data), void* data, int flags);
+ int (*callback)(pakfire_ctx* ctx, pakfire_package* pkg, void* data), void* data, int flags);
typedef int (*pakfire_repo_walk_archives_callback)
- (pakfire_ctx* ctx, struct pakfire_package* pkg, pakfire_archive* archive, void* data);
+ (pakfire_ctx* ctx, pakfire_package* pkg, pakfire_archive* archive, void* data);
int pakfire_repo_walk_archives(struct pakfire_repo* self,
pakfire_repo_walk_archives_callback callback, void* data, int flags);
char** userinstalled;
pakfire_archive** archives;
- struct pakfire_package** packages;
+ pakfire_package** packages;
size_t num;
// Progress
};
static enum pakfire_steps pakfire_transaction_get_step_type(
- struct pakfire_transaction* transaction, struct pakfire_package* pkg) {
+ struct pakfire_transaction* transaction, pakfire_package* pkg) {
const Id id = pakfire_package_id(pkg);
const int flags = SOLVER_TRANSACTION_CHANGE_IS_REINSTALL;
}
static int pakfire_transaction_import_transaction(struct pakfire_transaction* transaction) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int new_pkgs;
Queue pkgs;
int r = 0;
int pakfire_transaction_request(struct pakfire_transaction* transaction,
const enum pakfire_job_action action, const char* what, int flags) {
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
int r;
// Remove leading whitespace
}
int pakfire_transaction_request_package(struct pakfire_transaction* transaction,
- const enum pakfire_job_action action, struct pakfire_package* package, int flags) {
+ const enum pakfire_job_action action, pakfire_package* package, int flags) {
// Get the solvable ID
Id id = pakfire_package_id(package);
return asprintf(s, "%s %-21s %-8s %-21s %-18s %6s \n", *s, name, arch, version, repo, size);
}
-static int pakfire_transaction_add_package(char** s, size_t width, struct pakfire_package* pkg) {
+static int pakfire_transaction_add_package(char** s, size_t width, pakfire_package* pkg) {
char size[128];
int r;
}
static int pakfire_transaction_add_package_change(char** s, size_t width,
- struct pakfire_package* old_pkg, struct pakfire_package* new_pkg) {
+ pakfire_package* old_pkg, pakfire_package* new_pkg) {
int r;
// Print the new package first
// List all packages
for (int j = 0; j < pkgs.count; j++) {
- struct pakfire_package* old_pkg = NULL;
- struct pakfire_package* new_pkg = NULL;
+ pakfire_package* old_pkg = NULL;
+ pakfire_package* new_pkg = NULL;
r = pakfire_package_create_from_solvable(&old_pkg, transaction->pakfire,
NULL, pkgs.elements[j]);
}
static int pakfire_transaction_verify(struct pakfire_transaction* transaction,
- struct pakfire_package* pkg, pakfire_archive* archive) {
+ pakfire_package* pkg, pakfire_archive* archive) {
enum pakfire_hash_type hash = PAKFIRE_HASH_UNDEFINED;
const unsigned char* checksum = NULL;
size_t checksum_length = 0;
}
static int pakfire_transaction_run_script(struct pakfire_transaction* transaction,
- pakfire_db* db, const char* type, struct pakfire_package* pkg, pakfire_archive* archive) {
+ pakfire_db* db, const char* type, pakfire_package* pkg, pakfire_archive* archive) {
struct pakfire_scriptlet* scriptlet = NULL;
// Fetch scriptlet from archive if possible
}
static int pakfire_transaction_extract(struct pakfire_transaction* transaction,
- struct pakfire_package* pkg, pakfire_archive* archive) {
+ pakfire_package* pkg, pakfire_archive* archive) {
pakfire_filelist* filelist = NULL;
int r;
}
static int pakfire_transaction_erase(struct pakfire_transaction* transaction,
- pakfire_db* db, struct pakfire_package* pkg) {
+ pakfire_db* db, pakfire_package* pkg) {
pakfire_filelist* filelist = NULL;
int r;
}
static int pakfire_transaction_package_is_userinstalled(
- struct pakfire_transaction* transaction, struct pakfire_package* pkg) {
+ struct pakfire_transaction* transaction, pakfire_package* pkg) {
// No packages on the list
if (!transaction->userinstalled)
return 0;
}
static int pakfire_transaction_apply_systemd_sysusers(struct pakfire_transaction* transaction,
- struct pakfire_package* pkg, pakfire_archive* archive) {
+ pakfire_package* pkg, pakfire_archive* archive) {
// Walk through the archive and find all sysuser files
if (pakfire_package_matches_dep(pkg, PAKFIRE_PKG_REQUIRES, "pakfire(systemd-sysusers)"))
return pakfire_archive_apply_systemd_sysusers(archive);
}
static int pakfire_transaction_apply_systemd_tmpfiles(
- struct pakfire_transaction* transaction, struct pakfire_package* pkg) {
+ struct pakfire_transaction* transaction, pakfire_package* pkg) {
// Apply any tmpfiles (ignore any errors)
if (pakfire_package_matches_dep(pkg, PAKFIRE_PKG_REQUIRES, "pakfire(systemd-tmpfiles)"))
pakfire_jail_run_systemd_tmpfiles(transaction->pakfire);
}
static int pakfire_transaction_run_step(struct pakfire_transaction* transaction,
- pakfire_db* db, const enum pakfire_actions action, struct pakfire_package* pkg, pakfire_archive* archive) {
+ pakfire_db* db, const enum pakfire_actions action, pakfire_package* pkg, pakfire_archive* archive) {
if (!pkg) {
errno = EINVAL;
return 1;
int r;
for (unsigned int i = 0; i < transaction->num; i++) {
- struct pakfire_package* pkg = transaction->packages[i];
+ pakfire_package* pkg = transaction->packages[i];
// Fetch the type
enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
}
static int pakfire_transaction_download_package(struct pakfire_transaction* transaction,
- pakfire_httpclient* httpclient, struct pakfire_package* pkg) {
+ pakfire_httpclient* httpclient, pakfire_package* pkg) {
struct pakfire_repo* repo = NULL;
struct pakfire_xfer* xfer = NULL;
int r;
}
static int pakfire_transaction_package_needs_download(
- struct pakfire_transaction* transaction, struct pakfire_package* pkg) {
+ struct pakfire_transaction* transaction, pakfire_package* pkg) {
int r;
enum pakfire_steps type = pakfire_transaction_get_step_type(transaction, pkg);
// Add all packages that need to be downloaded
for (unsigned int i = 0; i < transaction->num; i++) {
- struct pakfire_package* pkg = transaction->packages[i];
+ pakfire_package* pkg = transaction->packages[i];
if (!pakfire_transaction_package_needs_download(transaction, pkg))
continue;
int pakfire_transaction_request(struct pakfire_transaction* transaction,
const enum pakfire_job_action action, const char* what, int flags);
int pakfire_transaction_request_package(struct pakfire_transaction* transaction,
- const enum pakfire_job_action action, struct pakfire_package* package, int flags);
+ const enum pakfire_job_action action, pakfire_package* package, int flags);
struct pakfire_problem** pakfire_transaction_get_problems(struct pakfire_transaction* transaction);
int pakfire_transaction_take_solution(
}
static PyObject* Archive_get_package(ArchiveObject* self, PyObject* args) {
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
RepoObject* repo = NULL;
if (!PyArg_ParseTuple(args, "|O!", &RepoType, &repo))
#include "repo.h"
#include "util.h"
-PyObject* new_package(PyTypeObject* type, struct pakfire_package* pkg) {
+PyObject* new_package(PyTypeObject* type, pakfire_package* pkg) {
PackageObject* self = (PackageObject *)type->tp_alloc(type, 0);
if (self) {
self->package = pakfire_package_ref(pkg);
typedef struct {
PyObject_HEAD
- struct pakfire_package* package;
+ pakfire_package* package;
} PackageObject;
extern PyTypeObject PackageType;
-PyObject* new_package(PyTypeObject* type, struct pakfire_package* pkg);
+PyObject* new_package(PyTypeObject* type, pakfire_package* pkg);
#endif /* PYTHON_PAKFIRE_PACKAGE_H */
}
PyObject* PyList_FromPackageList(pakfire_packagelist* packagelist) {
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
PyObject* item = NULL;
// Determine the length of the list
static int test_open(const struct test* t) {
pakfire_archive* archive = NULL;
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
int r = EXIT_FAILURE;
// Open the archive
pakfire_archive* archive = NULL;
struct pakfire_repo* repo = NULL;
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
// Open archive
ASSERT_SUCCESS(pakfire_archive_open(&archive, t->pakfire, path));
}
static int test_add_package(const struct test* t) {
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
pakfire_db* db = NULL;
struct pakfire_repo* repo = NULL;
pakfire_archive* archive = NULL;
}
static int test_dep_match(const struct test* t) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int r = EXIT_FAILURE;
ASSERT_SUCCESS(pakfire_package_create(&pkg, t->pakfire, NULL,
static int test_packages(const struct test* t) {
struct pakfire_parser* parser = NULL;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
struct pakfire_repo* repo = NULL;
char* s = NULL;
int r = EXIT_FAILURE;
int r = EXIT_FAILURE;
pakfire_archive* archive = NULL;
- struct pakfire_package* package = NULL;
+ pakfire_package* package = NULL;
pakfire_filelist* filelist = NULL;
// Create a directory to write packages to
This tests creates a new package and sets various attributes and reads them back again.
*/
static int test_create(const struct test* t) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
char** groups = NULL;
int r = EXIT_FAILURE;
}
static int test_invalid_inputs(const struct test* t) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int r = EXIT_FAILURE;
// Try to create a package with some values missing
}
static int test_uuid(const struct test* t) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int r = EXIT_FAILURE;
uuid_t uuid;
}
static int test_deps(const struct test* t) {
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
char** deps = NULL;
int r = EXIT_FAILURE;
static int test_filelist(const struct test* t) {
pakfire_filelist* filelist = NULL;
pakfire_file* file = NULL;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
int r = EXIT_FAILURE;
// Create a filelist
static int test_create(const struct test* t) {
pakfire_packager* packager = NULL;
- struct pakfire_package* pkg = NULL;
+ pakfire_package* pkg = NULL;
struct pakfire_repo* repo = NULL;
int r = EXIT_FAILURE;
static int test_compare_metadata(const struct test* t) {
pakfire_archive* archive = NULL;
- struct pakfire_package* pkg1 = NULL;
- struct pakfire_package* pkg2 = NULL;
+ pakfire_package* pkg1 = NULL;
+ pakfire_package* pkg2 = NULL;
pakfire_packager* packager = NULL;
char* path = NULL;
const char* s = NULL;