#include <pakfire/config.h>
struct pakfire_config* pakfire_get_config(Pakfire pakfire);
+int pakfire_is_mountpoint(Pakfire pakfire, const char* path);
const char* pakfire_get_distro_name(Pakfire pakfire);
const char* pakfire_get_distro_id(Pakfire pakfire);
if (r)
return r;
- struct mountpoint* mp;
-
- // Check if the mountpoint is already on the list
- STAILQ_FOREACH(mp, &pakfire->mountpoints, nodes) {
- if (strcmp(mp->path, target) == 0)
- return 0;
- }
+ // Skip if the mountpoint is already on the list
+ if (pakfire_is_mountpoint(pakfire, target))
+ return 0;
// If not, add the mountpoint to the list so that we can umount it later
- mp = calloc(1, sizeof(*mp));
+ struct mountpoint* mp = calloc(1, sizeof(*mp));
if (!mp)
return 1;
return 0;
}
+int pakfire_is_mountpoint(Pakfire pakfire, const char* path) {
+ struct mountpoint* mp;
+
+ // Check if path is on this list
+ STAILQ_FOREACH(mp, &pakfire->mountpoints, nodes) {
+ if (strcmp(mp->path, path) == 0)
+ return 1;
+ }
+
+ return 0;
+}
+
static const struct pakfire_devnode {
const char* path;
int major;
goto ERROR;
}
+ const char* full_path = archive_entry_pathname(entry);
+
// Compute the relative path
- const char* path = pakfire_path_relpath(root, archive_entry_pathname(entry));
+ const char* path = pakfire_path_relpath(root, full_path);
if (!path)
continue;
+ // Skip mountpoints
+ if (pakfire_is_mountpoint(pakfire, full_path)) {
+ DEBUG(pakfire, "Skipping mountpoint %s...", path);
+ continue;
+ }
+
// Skip excludes
if (pakfire_snapshot_path_is_excluded(path)) {
- DEBUG(pakfire, "Skipping %s...\n", path);
+ DEBUG(pakfire, "Skipping excluded path %s...\n", path);
continue;
}