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 struct PyMethodDef Pakfire_methods[] = {
{
"bind",
METH_VARARGS,
NULL
},
+ {
+ "make_cache_path",
+ (PyCFunction)Pakfire_make_cache_path,
+ METH_VARARGS,
+ NULL
+ },
{
"read_makefile",
(PyCFunction)Pakfire_read_makefile,
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);
__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);
// Cache
-int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
+PAKFIRE_EXPORT int __pakfire_make_cache_path(Pakfire pakfire, char* path, size_t length,
const char* format, ...) {
va_list args;