Skip to content

Commit

Permalink
Added directory check before cleaning-up the RPM caches. (#10800)
Browse files Browse the repository at this point in the history
(cherry picked from commit 4d81f69)
  • Loading branch information
PawelWMS authored and CBL-Mariner-Bot committed Oct 21, 2024
1 parent 6c73712 commit d70dbf2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions toolkit/scripts/imggen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,10 @@ clean-imagegen:
# the same, but the actual .rpm files may be fundamentally different.
$(STATUS_FLAGS_DIR)/imagegen_cleanup.flag: $(depend_REPO_SNAPSHOT_TIME)
@echo "REPO_SNAPSHOT_TIME has changed, sanitizing rpm cache"
find "$(local_and_external_rpm_cache)" -type f -name '*.rpm' -delete
touch $@
@if [ -d "$(local_and_external_rpm_cache)" ]; then \
find "$(local_and_external_rpm_cache)" -type f -name '*.rpm' -delete; \
fi
@touch $@

##help:target:fetch-image-packages=Locate and download all packages required for an image build.
fetch-image-packages: $(image_package_cache_summary)
Expand Down
6 changes: 4 additions & 2 deletions toolkit/scripts/pkggen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -269,8 +269,10 @@ clean-compress-srpms:
# the same, but the actual .rpm files may be fundamentally different.
$(STATUS_FLAGS_DIR)/build_packages_cache_cleanup.flag: $(depend_REPO_SNAPSHOT_TIME)
@echo "REPO_SNAPSHOT_TIME has changed, sanitizing rpm cache"
find "$(remote_rpms_cache_dir)" -type f -name '*.rpm' -delete
touch $@
@if [ -d "$(remote_rpms_cache_dir)" ]; then \
find "$(remote_rpms_cache_dir)" -type f -name '*.rpm' -delete; \
fi
@touch $@

ifeq ($(REBUILD_PACKAGES),y)
$(RPMS_DIR): $(STATUS_FLAGS_DIR)/build-rpms.flag
Expand Down

0 comments on commit d70dbf2

Please sign in to comment.