fetch-changed: skip prefix and diff only incoming changes

This commit is contained in:
Wildan M 2026-07-12 17:11:25 +07:00
parent ad20e03eeb
commit 4efbf3bd0d
No known key found for this signature in database
GPG Key ID: 01AC53185C679C79
3 changed files with 14 additions and 2 deletions

View File

@ -91,7 +91,7 @@ else
endif
# Invoke fetch for one or more targets separated by comma
f.%: prefix $(FSTOOLS_TAG) FORCE
f.%: $(FSTOOLS_TAG) FORCE
ifeq ($(PODMAN_BUILD),1)
$(PODMAN_RUN) make $@
else

View File

@ -4,7 +4,7 @@ set -e
git fetch origin master
packages=""
for toml in $(git diff --name-only origin/master | grep '/recipe.toml$' | sort | uniq)
for toml in $(git diff --name-only origin/master... | grep '/recipe.toml$' | sort | uniq)
do
package="$(basename "$(dirname "${toml}")")"
if [ -n "${packages}" ]

View File

@ -653,6 +653,10 @@ pub(crate) fn fetch_cargo(
cargopath: Option<&String>,
logger: &PtyOut,
) -> Result<()> {
if !check_toolchain_available() {
return Ok(());
}
let mut source_dir = source_dir.clone();
if let Some(cargopath) = cargopath {
source_dir = source_dir.join(cargopath);
@ -674,6 +678,14 @@ pub(crate) fn fetch_cargo(
Ok(())
}
/// Check if "REDOXER_TOOLCHAIN" is available.
fn check_toolchain_available() -> bool {
let Ok(dir) = std::env::var("REDOXER_TOOLCHAIN") else {
return false;
};
PathBuf::from(dir).is_dir()
}
pub fn fetch_remote(
recipe_dir: &Path,
recipe: &CookRecipe,