summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCzarek Nakamoto <cyjan@mrcyjanek.net>2025-07-10 08:25:10 +0200
committerCzarek Nakamoto <cyjan@mrcyjanek.net>2025-07-10 08:25:10 +0200
commit2595acb7764feadf9ba319a344220a67148f946a (patch)
tree906c2a06c259869f9aa4201a499b9a7db72e8b72
parent30c4a102a5c8e1d059a46ed13a6b2c4abea82558 (diff)
feat: add make clean to contrib/depends and invoke it on CI to reduce SSH upload step time
-rw-r--r--contrib/depends/Jenkinsfile6
-rw-r--r--contrib/depends/Makefile31
2 files changed, 36 insertions, 1 deletions
diff --git a/contrib/depends/Jenkinsfile b/contrib/depends/Jenkinsfile
index 8d5e50b..e16b057 100644
--- a/contrib/depends/Jenkinsfile
+++ b/contrib/depends/Jenkinsfile
@@ -43,6 +43,9 @@ pipeline {
post {
always {
script {
+ dir('contrib/depends') {
+ sh "make clean"
+ }
def targets = params.LINUX_TARGETS.split(',').collect { it.trim() }
for (target in targets) {
archiveArtifacts artifacts: "contrib/depends/built/${target}/*/*.tar.gz*", allowEmptyArchive: true
@@ -76,6 +79,9 @@ pipeline {
post {
always {
script {
+ dir('contrib/depends') {
+ sh "make clean"
+ }
def targets = params.DARWIN_TARGETS.split(',').collect { it.trim() }
for (target in targets) {
archiveArtifacts artifacts: "contrib/depends/built/${target}/*/*.tar.gz*", allowEmptyArchive: true
diff --git a/contrib/depends/Makefile b/contrib/depends/Makefile
index 7e9f0f4..f1d2bf7 100644
--- a/contrib/depends/Makefile
+++ b/contrib/depends/Makefile
@@ -266,4 +266,33 @@ download: download-osx download-linux download-win
$(foreach package,$(all_packages),$(eval $(call ext_add_stages,$(package))))
-.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources
+clean:
+ @echo "=== Cleaning up contrib/depends ==="
+
+ @echo " Removing work/ directory..."
+ @rm -rf $(BASEDIR)/work/
+
+ @echo " Removing host triplet directories..."
+ @for dir in $(BASEDIR)/*-*-*/; do \
+ if [ -d "$$dir" ]; then \
+ dirname=$$(basename "$$dir"); \
+ rm -rf "$$dir"; \
+ fi; \
+ done
+
+ @echo " Cleaning built/ directory..."
+ @if [ -d "$(BASE_CACHE)" ]; then \
+ tmp_keep_list=$$(mktemp); \
+ $(foreach package,$(all_packages),echo "$($(package)_cached)" >> $$tmp_keep_list; echo "$($(package)_cached_checksum)" >> $$tmp_keep_list; echo "$($(package)_cached_buildinfo)" >> $$tmp_keep_list;) \
+ find "$(BASE_CACHE)" -name "*.tar.gz" -o -name "*.tar.gz.hash" -o -name "*.tar.gz.txt" | while read file; do \
+ if ! grep -Fxq "$$file" $$tmp_keep_list; then \
+ echo " Removing outdated: $$file"; \
+ rm -f "$$file"; \
+ fi; \
+ done; \
+ rm -f $$tmp_keep_list; \
+ fi
+
+ @echo " Cleanup completed"
+
+.PHONY: install cached download-one download-osx download-linux download-win download check-packages check-sources clean