Skip to content

Commit

Permalink
data: Remove all /var/tmp/flatpak-cache-* directories on boot
Browse files Browse the repository at this point in the history
No one is clearing those directories so they pile up and can take a
significant amount of disk space.

Resolves: flatpak/flatpak#1119
Signed-off-by: Alberto Garcia <[email protected]>
(cherry picked from commit 14d735b)
  • Loading branch information
bertogg authored and smcv committed Nov 14, 2023
1 parent 1352613 commit 3ac2d52
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ service_in_files = $(NULL)
dbus_service_DATA = $(NULL)
systemdsystemunit_DATA = $(NULL)
systemduserunit_DATA = $(NULL)
dist_tmpfiles_DATA = $(NULL)
CLEANFILES += $(dbus_service_DATA)
CLEANFILES += $(systemduserunit_DATA)
EXTRA_DIST += $(service_in_files)
Expand Down
7 changes: 7 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,13 @@ AC_ARG_WITH([sysusersdir],
[with_sysusersdir='${prefix}/lib/sysusers.d'])
AC_SUBST([sysusersdir], [$with_sysusersdir])

AC_ARG_WITH([tmpfilesdir],
[AS_HELP_STRING([--with-tmpfilesdir=DIR],
[Directory for systemd tmpfiles.d configuration files (default=PREFIX/lib/tmpfiles.d)])],
[],
[with_tmpfilesdir='${prefix}/lib/tmpfiles.d'])
AC_SUBST([tmpfilesdir], [$with_tmpfilesdir])

AC_ARG_WITH(system-helper-user,
[AS_HELP_STRING([--with-system-helper-user=USERNAME],
[Name of the system helper user])],
Expand Down
2 changes: 2 additions & 0 deletions data/Makefile.am.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ introspection_DATA = \
data/org.freedesktop.portal.Flatpak.xml \
$(NULL)

dist_tmpfiles_DATA += data/tmpfiles.d/flatpak.conf

EXTRA_DIST += \
data/org.freedesktop.portal.Documents.xml \
data/org.freedesktop.impl.portal.PermissionStore.xml \
Expand Down
2 changes: 2 additions & 0 deletions data/tmpfiles.d/flatpak.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This is a systemd tmpfiles.d configuration file
R! /var/tmp/flatpak-cache-*
3 changes: 1 addition & 2 deletions sideload-repos-systemd/Makefile.am.inc
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ systemduserunit_DATA += sideload-repos-systemd/flatpak-sideload-usb-repo.path
%.path: %.path.in config.log
$(AM_V_GEN) $(SED) -e "s|\@media_dir\@|$(RUN_MEDIA_DIR)|" $< > $@

tmpfilesdir = $(prefix)/lib/tmpfiles.d
dist_tmpfiles_DATA = sideload-repos-systemd/tmpfiles.d/flatpak-sideload-repos.conf
dist_tmpfiles_DATA += sideload-repos-systemd/tmpfiles.d/flatpak-sideload-repos.conf

endif

Expand Down

0 comments on commit 3ac2d52

Please sign in to comment.