Skip to content

Commit d9cb739

Browse files
committed
context: Create CACHEDIR.TAG file in state dir
This makes it possible for backup software to detect and ignore the whole folder. Fixes #360
1 parent f2d0567 commit d9cb739

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

src/builder-context.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,11 +560,21 @@ builder_context_allocate_build_subdir (BuilderContext *self,
560560
{
561561
g_autoptr(GError) my_error = NULL;
562562
int count;
563+
g_autoptr (GFile) cachedir_tag = g_file_get_child (self->state_dir, "CACHEDIR.TAG");
563564

564565
if (!flatpak_mkdir_p (self->build_dir,
565566
NULL, error))
566567
return NULL;
567568

569+
const char *cachedir_tag_content = "Signature: 8a477f597d28d172789f06886806bc55\n"
570+
"# This file is a cache directory tag created by flatpak-builder.\n"
571+
"# For information about cache directory tags see https://bford.info/cachedir/";
572+
if (!g_file_replace_contents (cachedir_tag, cachedir_tag_content,
573+
strlen (cachedir_tag_content), NULL, FALSE,
574+
G_FILE_CREATE_REPLACE_DESTINATION,
575+
NULL, NULL, error))
576+
return NULL;
577+
568578
for (count = 1; count < 1000; count++)
569579
{
570580
g_autofree char *buildname = NULL;

subprojects/debugedit

Submodule debugedit updated from ae27211 to b9a4cbf

subprojects/libglnx

Submodule libglnx updated from 202b294 to fed928a

0 commit comments

Comments
 (0)