lib/installation: Add new FlatpakUpdateFlag to prevent pruning the repo

Add a new FLATPAK_UPDATE_FLAGS_NO_PRUNE so that we can specify from clients
when we don't want to perform a prune right after updating a flatpak, even
if no FLATPAK_UPDATE_FLAGS_NO_PULL flag has been set.

https://github.com/flatpak/flatpak/issues/1703

Closes: #1704
Approved by: alexlarsson
This commit is contained in:
Mario Sanchez Prada
2018-05-23 15:19:16 +01:00
committed by Atomic Bot
parent 0ae6299f28
commit fb1814c3aa
2 changed files with 4 additions and 2 deletions

View File

@@ -1897,8 +1897,8 @@ flatpak_installation_update_full (FlatpakInstallation *self,
if (result == NULL)
goto out;
/* We don't get prunable objects if not pulling */
if (!(flags & FLATPAK_UPDATE_FLAGS_NO_PULL))
/* We don't get prunable objects if not pulling or if NO_PRUNE is passed */
if (!(flags & FLATPAK_UPDATE_FLAGS_NO_PULL) && !(flags & FLATPAK_UPDATE_FLAGS_NO_PRUNE))
flatpak_dir_prune (dir_clone, cancellable, NULL);
out:

View File

@@ -52,6 +52,7 @@ typedef struct
* @FLATPAK_UPDATE_FLAGS_NONE: Fetch remote builds and install the latest one (default)
* @FLATPAK_UPDATE_FLAGS_NO_DEPLOY: Don't install any new builds that might be fetched
* @FLATPAK_UPDATE_FLAGS_NO_PULL: Don't try to fetch new builds from the remote repo
* @FLATPAK_UPDATE_FLAGS_NO_PRUNE: Don't prune the local OSTreee repository after updating
*
* Flags to alter the behavior of flatpak_installation_update().
*/
@@ -60,6 +61,7 @@ typedef enum {
FLATPAK_UPDATE_FLAGS_NO_DEPLOY = (1 << 0),
FLATPAK_UPDATE_FLAGS_NO_PULL = (1 << 1),
FLATPAK_UPDATE_FLAGS_NO_STATIC_DELTAS = (1 << 2),
FLATPAK_UPDATE_FLAGS_NO_PRUNE = (1 << 3),
} FlatpakUpdateFlags;
/**