Skip to content

Commit

Permalink
Add 'swupd clean' command
Browse files Browse the repository at this point in the history
This command removes old files from statedir. The interface is a bit
opaque so there will be room to modify the policy later.

By default it will delete staged files that are older than
DAYS_TO_KEEP_FILES. For manifests this heuristic is not good as older
manifests might still be used for the current OS version being run, so
also ensure that those do not get deleted. This prevents 'swupd
search' to redownload files.

The default behavior should be suitable to use in combination with
automatic updates, to control the size of state dir. There is also an
--all option to remove all the state files regardless of dates and
usage.

To avoid "disasters" in case some paths are set wrong, the command
explicitly delete patterns of files create by swupd.
  • Loading branch information
cmarcelo committed Feb 24, 2018
1 parent 2b5b48e commit 25b00ac
Show file tree
Hide file tree
Showing 4 changed files with 397 additions and 0 deletions.
1 change: 1 addition & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ bin_PROGRAMS = swupd
swupd_SOURCES = \
src/autoupdate.c \
src/check_update.c \
src/clean.c \
src/clr_bundle_add.c \
src/clr_bundle_ls.c \
src/clr_bundle_rm.c \
Expand Down
1 change: 1 addition & 0 deletions include/swupd-internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ extern int verify_main(int argc, char **argv);
extern int check_update_main(int argc, char **argv);
extern int search_main(int argc, char **argv);
extern int info_main(int argc, char **argv);
extern int clean_main(int argc, char **argv);

#endif
Loading

0 comments on commit 25b00ac

Please sign in to comment.