repo: Clean up staging directory for previous boot IDs

We had a policy of cleaning up all files in `$repo/tmp` older
than one day, but we should really clean up previous bootid staging
directories too, as they can potentially take up a lot of disk space.

https://bugzilla.gnome.org/show_bug.cgi?id=760531

Closes: #170
Approved by: jlebon
This commit is contained in:
Colin Walters authored and Colin Walters (automation) committed 2016-05-02 18:44:44 +00:00
1 parent e3ec83a934
commit a56ba6081a
6 files changed
+220 -71

No files matched your search

+14 -1
View File
@@ -48,7 +48,7 @@ typedef enum {
struct OstreeRepo {
GObject parent;
char *boot_id;
char *stagedir_prefix;
int commit_stagedir_fd;
char *commit_stagedir_name;
GLnxLockFile commit_stagedir_lock;
@@ -108,6 +108,9 @@ typedef struct {
char checksum[65];
} OstreeDevIno;
#define OSTREE_REPO_TMPDIR_STAGING "staging-"
#define OSTREE_REPO_TMPDIR_FETCHER "fetcher-"
gboolean
_ostree_repo_allocate_tmpdir (int tmpdir_dfd,
const char *tmpdir_prefix,
@@ -118,6 +121,16 @@ _ostree_repo_allocate_tmpdir (int tmpdir_dfd,
GCancellable *cancellable,
GError **error);
gboolean
_ostree_repo_is_locked_tmpdir (const char *filename);
gboolean
_ostree_repo_try_lock_tmpdir (int tmpdir_dfd,
const char *tmpdir_name,
GLnxLockFile *file_lock_out,
gboolean *out_did_lock,
GError **error);
gboolean
_ostree_repo_ensure_loose_objdir_at (int dfd,
const char *loose_path,