static int pakfire_build_package_add_files(pakfire_build* build,
struct pakfire_parser* makefile, const char* buildroot, const char* namespace,
- struct pakfire_package* pkg, struct pakfire_packager* packager) {
+ struct pakfire_package* pkg, pakfire_packager* packager) {
pakfire_filelist* filelist = NULL;
char** includes = NULL;
char** excludes = NULL;
}
static int pakfire_build_package_add_scriptlet(pakfire_build* build,
- struct pakfire_package* pkg, struct pakfire_packager* packager,
+ struct 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, struct pakfire_packager* packager) {
+ struct pakfire_package* pkg, pakfire_packager* packager) {
char name[NAME_MAX];
int r;
const char* buildroot, const char* namespace) {
pakfire_archive* archive = NULL;
struct pakfire_package* pkg = NULL;
- struct pakfire_packager* packager = NULL;
+ pakfire_packager* packager = NULL;
int r = 1;
return r;
}
-static int pakfire_dist_add_source(struct pakfire* pakfire, struct pakfire_packager* packager,
+static int pakfire_dist_add_source(struct pakfire* pakfire, pakfire_packager* packager,
struct pakfire_package* pkg, pakfire_ctx* ctx,
pakfire_mirrorlist* mirrorlist, const char* filename) {
char archive_path[PATH_MAX];
}
static int pakfire_dist_add_sources(pakfire_ctx* ctx, struct pakfire* pakfire,
- struct pakfire_packager* packager, struct pakfire_package* pkg, struct pakfire_parser* makefile) {
+ pakfire_packager* packager, struct pakfire_package* pkg, struct pakfire_parser* makefile) {
pakfire_mirrorlist* mirrorlist = NULL;
char* sources = NULL;
char* p = NULL;
}
static int pakfire_dist_add_files(pakfire_ctx* ctx, struct pakfire* pakfire,
- struct pakfire_packager* packager, const char* file) {
+ pakfire_packager* packager, const char* file) {
pakfire_filelist* filelist = NULL;
char root[PATH_MAX];
int r;
int pakfire_dist(struct pakfire* pakfire,
const char* path, pakfire_archive** archive) {
- struct pakfire_packager* packager = NULL;
+ pakfire_packager* packager = NULL;
struct pakfire_package* pkg = NULL;
struct pakfire_parser* makefile = NULL;
struct pakfire_parser_error* error = NULL;
unsigned int digests;
};
-static void pakfire_packager_free(struct pakfire_packager* packager) {
+static void pakfire_packager_free(pakfire_packager* packager) {
if (packager->reader)
archive_read_free(packager->reader);
free(packager);
}
-int pakfire_packager_create(struct pakfire_packager** packager,
+int pakfire_packager_create(pakfire_packager** packager,
struct pakfire* pakfire, struct pakfire_package* pkg) {
- struct pakfire_packager* p = NULL;
+ pakfire_packager* p = NULL;
char hostname[HOST_NAME_MAX];
int r = 1;
return r;
}
-struct pakfire_packager* pakfire_packager_ref(
- struct pakfire_packager* packager) {
+pakfire_packager* pakfire_packager_ref(
+ pakfire_packager* packager) {
++packager->nrefs;
return packager;
}
-struct pakfire_packager* pakfire_packager_unref(
- struct pakfire_packager* packager) {
+pakfire_packager* pakfire_packager_unref(
+ pakfire_packager* packager) {
if (--packager->nrefs > 0)
return packager;
return NULL;
}
-static int pakfire_packager_write_format(struct pakfire_packager* packager,
+static int pakfire_packager_write_format(pakfire_packager* packager,
pakfire_archive_writer* writer) {
const char format[] = TO_STRING(PACKAGE_FORMAT) "\n";
int r;
return 0;
}
-static int pakfire_packager_write_metadata(struct pakfire_packager* packager,
+static int pakfire_packager_write_metadata(pakfire_packager* packager,
pakfire_archive_writer* writer) {
struct json_object* md = NULL;
int r;
return r;
}
-static int pakfire_packager_write_scriptlet(struct pakfire_packager* packager,
+static int pakfire_packager_write_scriptlet(pakfire_packager* packager,
pakfire_archive_writer* writer, struct pakfire_scriptlet* scriptlet) {
char filename[PATH_MAX];
size_t size;
It will create a new archive and write the package to the given file descriptor.
*/
-int pakfire_packager_finish(struct pakfire_packager* packager, FILE* f) {
+int pakfire_packager_finish(pakfire_packager* packager, FILE* f) {
pakfire_archive_writer* writer = NULL;
int r;
return r;
}
-int pakfire_packager_write_archive(struct pakfire_packager* self,
+int pakfire_packager_write_archive(pakfire_packager* self,
pakfire_archive** archive) {
FILE* f = NULL;
char path[PATH_MAX];
return r;
}
-int pakfire_packager_add_file(struct pakfire_packager* packager, pakfire_file* file) {
+int pakfire_packager_add_file(pakfire_packager* packager, pakfire_file* file) {
int r;
// Check input
return pakfire_filelist_add(packager->filelist, file);
}
-int pakfire_packager_add(struct pakfire_packager* packager,
+int pakfire_packager_add(pakfire_packager* packager,
const char* sourcepath, const char* path) {
struct archive_entry* entry = NULL;
pakfire_file* file = NULL;
static int __pakfire_packager_add_files(
pakfire_ctx* ctx, pakfire_file* file, void* data) {
- struct pakfire_packager* packager = data;
+ pakfire_packager* packager = data;
return pakfire_packager_add_file(packager, file);
}
int pakfire_packager_add_files(
- struct pakfire_packager* packager, pakfire_filelist* filelist) {
+ pakfire_packager* packager, pakfire_filelist* filelist) {
// Add all files on the filelist
return pakfire_filelist_walk(filelist, __pakfire_packager_add_files, packager, 0, NULL);
}
-int pakfire_packager_add_scriptlet(struct pakfire_packager* packager,
+int pakfire_packager_add_scriptlet(pakfire_packager* packager,
struct pakfire_scriptlet* scriptlet) {
if (!scriptlet)
return -EINVAL;
/*
Removes all files on the filelist
*/
-int pakfire_packager_cleanup(struct pakfire_packager* packager) {
+int pakfire_packager_cleanup(pakfire_packager* packager) {
// Delete all files on the filelist
return pakfire_filelist_cleanup(packager->filelist, PAKFIRE_FILE_CLEANUP_TIDY);
}
#define PAKFIRE_PACKAGER_HASHES (PAKFIRE_HASH_SHA3_512|PAKFIRE_HASH_BLAKE2B512)
-struct pakfire_packager;
+typedef struct pakfire_packager pakfire_packager;
-int pakfire_packager_create(struct pakfire_packager** packager,
+int pakfire_packager_create(pakfire_packager** packager,
struct pakfire* pakfire, struct pakfire_package* pkg);
-struct pakfire_packager* pakfire_packager_ref(struct pakfire_packager* packager);
-struct pakfire_packager* pakfire_packager_unref(struct pakfire_packager* packager);
+pakfire_packager* pakfire_packager_ref(pakfire_packager* packager);
+pakfire_packager* pakfire_packager_unref(pakfire_packager* packager);
-int pakfire_packager_write_archive(struct pakfire_packager* self,
+int pakfire_packager_write_archive(pakfire_packager* self,
pakfire_archive** archive);
-int pakfire_packager_finish(struct pakfire_packager* packager, FILE* f);
+int pakfire_packager_finish(pakfire_packager* packager, FILE* f);
int pakfire_packager_add_file(
- struct pakfire_packager* packager, pakfire_file* file);
-int pakfire_packager_add_files(struct pakfire_packager* packager,
+ pakfire_packager* packager, pakfire_file* file);
+int pakfire_packager_add_files(pakfire_packager* packager,
pakfire_filelist* filelist);
-int pakfire_packager_add(struct pakfire_packager* packager,
+int pakfire_packager_add(pakfire_packager* packager,
const char* sourcepath, const char* path);
-int pakfire_packager_add_scriptlet(struct pakfire_packager* packager,
+int pakfire_packager_add_scriptlet(pakfire_packager* packager,
struct pakfire_scriptlet* scriptlet);
-int pakfire_packager_cleanup(struct pakfire_packager* packager);
+int pakfire_packager_cleanup(pakfire_packager* packager);
#endif /* PAKFIRE_PACKAGER_H */
#include "../testsuite.h"
static int test_create(const struct test* t) {
- struct pakfire_packager* packager = NULL;
+ pakfire_packager* packager = NULL;
struct pakfire_package* pkg = NULL;
struct pakfire_repo* repo = NULL;
int r = EXIT_FAILURE;
pakfire_archive* archive = NULL;
struct pakfire_package* pkg1 = NULL;
struct pakfire_package* pkg2 = NULL;
- struct pakfire_packager* packager = NULL;
+ pakfire_packager* packager = NULL;
char* path = NULL;
const char* s = NULL;
int r = EXIT_FAILURE;