Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
triggers: also run triggers when an empty directory is "touched"
Baptiste Daroussin committed 4 years ago
commit 225062d025f8ff9ae59e72124e6ef37ba64787a3
parent 9b921a7
3 files changed +8 -0
modified libpkg/pkg_add.c
@@ -823,6 +823,7 @@ pkg_extract_finalize(struct pkg *pkg)
	}

	while (pkg_dirs(pkg, &d) == EPKG_OK) {
+
		append_touched_dir(d->path);
		if (d->noattrs)
			continue;
		if (set_attrsat(pkg->rootfd, d->path, d->perm,
modified libpkg/private/pkg.h
@@ -827,6 +827,7 @@ int set_attrsat(int fd, const char *path, mode_t perm, uid_t uid, gid_t gid, con

struct trigger *triggers_load(bool cleanup_only);
int triggers_execute(struct trigger *cleanup_triggers);
+
void append_touched_dir(const char *path);
void append_touched_file(const char *path);
bool stringlist_contains(stringlist_t *l, const char *name);

modified libpkg/triggers.c
@@ -579,6 +579,12 @@ cleanup:
}

void
+
append_touched_dir(const char *path)
+
{
+
	pkghash_safe_add(ctx.touched_dir_hash, path, NULL, NULL);
+
}
+

+
void
append_touched_file(const char *path)
{
	char *newpath, *walk;