diff --git a/mk/repo.mk b/mk/repo.mk index 43c314fc..dba690c9 100644 --- a/mk/repo.mk +++ b/mk/repo.mk @@ -47,6 +47,14 @@ else $(REPO_BIN) fetch $(COOKBOOK_OPTS) --with-package-deps endif +# Unfetch and clean all recipes source or binary from filesystem config +unfetch: prefix $(FSTOOLS_TAG) FORCE +ifeq ($(PODMAN_BUILD),1) + $(PODMAN_RUN) make $@ +else + $(REPO_BIN) unfetch $(COOKBOOK_OPTS) --with-package-deps +endif + # Fetch Cargo dependencies for the cookbook tool (needed for REPO_OFFLINE=1 builds) cargo-fetch: FORCE ifeq ($(PODMAN_BUILD),1) diff --git a/src/bin/repo.rs b/src/bin/repo.rs index 898a11f9..c604da73 100644 --- a/src/bin/repo.rs +++ b/src/bin/repo.rs @@ -1005,7 +1005,11 @@ fn handle_change_rule( } else { let source_dir = recipe.dir.join("source"); let rev = if config.with_rollback { - get_git_rev_before_date(&source_dir, &cookbook_date) + // invoke fetch as the git tracking can be different + match handle_fetch(recipe, config, false, &None) { + Ok(_) => get_git_rev_before_date(&source_dir, &cookbook_date), + Err(e) => Err(e), + } } else { get_git_head_rev(&source_dir).map(|r| r.0) }; @@ -1015,7 +1019,7 @@ fn handle_change_rule( old_rev == Some(rev) } Err(e) => { - eprintln!("Skipped: {e}"); + eprintln!("Skipping {}: {e}", recipe.name.as_str()); continue; } }