#include <sys/mount.h>
#include <pakfire/logging.h>
+#include <pakfire/pakfire.h>
#include <pakfire/path.h>
#include <pakfire/snapshot.h>
#include <pakfire/string.h>
Creates a new snapshot
*/
int pakfire_snapshot_make(struct pakfire_snapshot** snapshot, struct pakfire* pakfire) {
+ struct pakfire_config* config = NULL;
struct pakfire* p = NULL;
char snapshot_path[PATH_MAX];
char tmp[PATH_MAX];
+ const char* arch = NULL;
const char* path = NULL;
char time[1024];
+ int flags = PAKFIRE_FLAGS_BUILD|PAKFIRE_FLAGS_BUILD_LOCAL;
int r;
const char* packages[] = {
struct pakfire_ctx* ctx = pakfire_ctx(pakfire);
+ // Fetch the configuration
+ config = pakfire_get_config(pakfire);
+
+ // Fetch the architecture
+ arch = pakfire_get_arch(pakfire);
+
// Store the current time
r = pakfire_strftime_now(time, PAKFIRE_SNAPSHOT_TIMESTAMP_FORMAT);
if (r < 0)
goto ERROR;
}
- // Clone the Pakfire instance
- r = pakfire_clone(&p, pakfire, tmp);
+ // Create a new pakfire instance
+ r = pakfire_create(&p, ctx, config, tmp, arch, flags);
if (r < 0) {
ERROR(ctx, "Could not clone pakfire: %s\n", strerror(-r));
goto ERROR;
ERROR:
if (p)
pakfire_unref(p);
+ if (config)
+ pakfire_config_unref(config);
if (ctx)
pakfire_ctx_unref(ctx);