From 916ce142bb0b118e4937ff86e62e170aa4ae04fc Mon Sep 17 00:00:00 2001 From: Patrick McCarty Date: Thu, 7 Jun 2018 18:31:53 -0700 Subject: [PATCH] pull: skip repos that do not exist locally Since the user-setup script does not clone package repos by default anymore, 'make pull' can be made more user-friendly by not printing warnings if some/all/most of the package repos are not already present in the packages/ directory. Instead, only populate the package "pull" list with names from the packages file that are currently present in the packages/ directory. Package repos that are not present can be cloned as before: 'make clone' to clone all missing package repos, or 'make clone_PKG' to clone a selected package repo. Signed-off-by: Patrick McCarty --- Makefile.toplevel | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Makefile.toplevel b/Makefile.toplevel index 41a9818..b92e403 100644 --- a/Makefile.toplevel +++ b/Makefile.toplevel @@ -10,6 +10,7 @@ include $(TOPLVL)/projects/common/Makefile.shared SHELL = /bin/bash PKGS = $(shell cat $(PACKAGES_FILE)) +PKGS_LOCAL = $(sort $(filter ${PKGS},$(subst packages/,,$(wildcard packages/*)))) proj_PKGS = $(addprefix proj_,$(PROJ_PKGS)) clone_PKGS = $(addprefix clone_,$(PKGS)) @@ -64,7 +65,7 @@ cvecheck: #help of merge commits, while displaying any changes since your last pull. It is #help silent if there are no changes. .PHONY: pull ${PULL_PKGS} -PULL_PKGS:= $(addprefix PULL_projects/,$(PROJ_PKGS)) $(addprefix PULL_packages/,$(PKGS)) +PULL_PKGS:= $(addprefix PULL_projects/,$(PROJ_PKGS)) $(addprefix PULL_packages/,${PKGS_LOCAL}) ${PULL_PKGS}: @p=$(patsubst PULL_%,%,$@) ; \ if [ ! -d "$$p/.git" ]; then echo "Nothing to pull for $$p - $$p/.git missing"; exit 0; fi; \