return obj;
}
-static PyObject* Pakfire_get_installed_repo(PakfireObject* self) {
- PakfireRepo repo = pakfire_get_installed_repo(self->pakfire);
- if (!repo)
- Py_RETURN_NONE;
-
- PyObject* obj = new_repo(&RepoType, repo);
- pakfire_repo_unref(repo);
-
- return obj;
-}
-
static PyObject* _import_keylist(PakfireObject* pakfire, PakfireKey* keys) {
PyObject* list = PyList_New(0);
return list;
}
-static PyObject* Pakfire_make_cache_path(PakfireObject* self, PyObject* args) {
- const char* path = NULL;
-
- if (!PyArg_ParseTuple(args, "s", &path))
- return NULL;
-
- char cache_path[PATH_MAX];
-
- int r = pakfire_make_cache_path(self->pakfire, cache_path, "%s", path);
- if (r) {
- PyErr_SetFromErrno(PyExc_OSError);
- return NULL;
- }
-
- return PyUnicode_FromString(cache_path);
-}
-
static PyObject* execute_return_value(int r) {
// Raise an OS error if r < 0
if (r < 0) {
METH_VARARGS,
NULL
},
- {
- "make_cache_path",
- (PyCFunction)Pakfire_make_cache_path,
- METH_VARARGS,
- NULL
- },
{
"read_makefile",
(PyCFunction)Pakfire_read_makefile,
NULL,
NULL
},
- {
- "installed_repo",
- (getter)Pakfire_get_installed_repo,
- NULL,
- NULL,
- NULL
- },
{
"installonly",
(getter)Pakfire_get_installonly,
const char* pakfire_get_path(Pakfire pakfire);
-#define pakfire_make_cache_path(pakfire, path, format, ...) \
- __pakfire_make_cache_path(pakfire, path, sizeof(path) - 1, format, __VA_ARGS__)
-
-int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
- const char* format, ...) __attribute__((format(printf, 4, 5)));
-
int pakfire_bind(Pakfire pakfire, const char* src, const char* dst, int flags);
int pakfire_copy_in(Pakfire pakfire, const char* src, const char* dst);
struct pakfire_repolist* pakfire_get_repos(Pakfire pakfire);
PakfireRepo pakfire_get_repo(Pakfire pakfire, const char* name);
-PakfireRepo pakfire_get_installed_repo(Pakfire pakfire);
PakfirePackageList pakfire_whatprovides(Pakfire pakfire, const char* provides, int flags);
PakfirePackageList pakfire_search(Pakfire pakfire, const char* what, int flags);
__pakfire_make_path(pakfire, dst, sizeof(dst) - 1, path)
int __pakfire_make_path(Pakfire pakfire, char* dst, size_t length, const char* path);
+#define pakfire_make_cache_path(pakfire, path, format, ...) \
+ __pakfire_make_cache_path(pakfire, path, sizeof(path) - 1, format, __VA_ARGS__)
+
+int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
+ const char* format, ...) __attribute__((format(printf, 4, 5)));
+
void pakfire_pool_has_changed(Pakfire pakfire);
void pakfire_pool_apply_changes(Pakfire pakfire);
Pool* pakfire_get_solv_pool(Pakfire pakfire);
Queue* pakfire_get_installonly_queue(Pakfire pakfire);
+PakfireRepo pakfire_get_installed_repo(Pakfire pakfire);
+
// Archive helpers
struct archive* pakfire_make_archive_disk_reader(Pakfire pakfire, int internal);
struct archive* pakfire_make_archive_disk_writer(Pakfire pakfire);
return NULL;
}
-PAKFIRE_EXPORT PakfireRepo pakfire_get_installed_repo(Pakfire pakfire) {
+PakfireRepo pakfire_get_installed_repo(Pakfire pakfire) {
if (!pakfire->pool->installed)
return NULL;
// Cache
-PAKFIRE_EXPORT int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
+int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
const char* format, ...) {
va_list args;