From 24ca43d57a40e84f675183f76a034eb4c00d1932 Mon Sep 17 00:00:00 2001 From: Steve McIntyre <93sam@debian.org> Date: Tue, 19 Dec 2000 23:14:03 +0000 Subject: [PATCH] When adding source files to source CDs, cope better with empty lists, e.g. non-US sources on a CD that doesn't contain any. --- Makefile | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/Makefile b/Makefile index ec231f8a..0b6593d8 100755 --- a/Makefile +++ b/Makefile @@ -440,19 +440,30 @@ $(SDIR)/sources-stamp: n=$${dir##$(SDIR)/}; \ dir=$(SDIR)/CD$$n; \ echo -n "$$n ... "; \ - grep -vE "(non-US/|/local/)" $$i | xargs $(addfiles) \ - $$dir $(MIRROR); \ + echo -n "main ... "; \ + grep -vE "(non-US/|/local/)" $$i > $(SDIR)/$$.main || true ; \ + if [ -s $(SDIR)/$$.main ] ; then \ + cat $(SDIR)/$$.main | xargs $(addfiles) $$dir $(MIRROR); \ + fi ; \ if [ -n "$(LOCAL)" ]; then \ - if [ -n "$(LOCALDEBS)" ]; then \ - grep "/local/" $$i | xargs $(addfiles) \ - $$dir $(LOCALDEBS); \ - else \ - grep "/local/" $$i | xargs $(addfiles) \ - $$dir $(MIRROR); \ + echo -n "local ... "; \ + grep "/local/" $$i > $(SDIR)/$$.localn || true ; \ + if [ -s $(SDIR)/$$.local ] ; then \ + if [ -n "$(LOCALDEBS)" ] ; then \ + cat $(SDIR)/$$.local | xargs $(addfiles) \ + $$dir $(LOCALDEBS); \ + else \ + cat $(SDIR)/$$.local | xargs $(addfiles) \ + $$dir $(MIRROR); \ + fi; \ fi; \ fi; \ if [ -n "$(NONUS)" ]; then \ - grep "non-US/" $$i | xargs $(addfiles) $$dir $(NONUS); \ + echo -n "non-US ... "; \ + grep "non-US/" $$i > $(SDIR)/$$.nonusn || true ; \ + if [ -s $(SDIR)/$$.nonus ] ; then \ + cat $(SDIR)/$$.nonus | xargs $(addfiles) $$dir $(NONUS); \ + fi; \ fi; \ $(scansources) $$dir; \ echo "done."; \