[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[PATCH 2/4] Use only first package candidate



If the Packages file contains multiple candidates of a Package, they're
all added to the status file. This breaks with exact version depends.

FYI: My Packages file is concatenated from several fragments in order of
preference.
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index aae0773..a4aef05 100755
--- a/Makefile
+++ b/Makefile
@@ -227,7 +227,7 @@ $(ADIR)/status:
 			:> $(ADIR)/$(CODENAME)-$$ARCH/status ; \
 		else \
 			zcat $(MIRROR)/dists/$(CODENAME)/main/binary-$$ARCH/Packages.gz | \
-			perl -000 -ne 's/^(Package: .*)$$/$$1\nStatus: install ok installed/m; print if (/^Priority: (required|important|standard)/m or /^Section: base/m);' \
+			perl -000 -ne 's/^(Package: (\S+))$$/$$1\nStatus: install ok installed/m; print if (not $$seen{$$2}++ and (/^Priority: (required|important|standard)/m or /^Section: base/m));' \
 			>> $(ADIR)/$(CODENAME)-$$ARCH/status ; \
 		fi; \
 	done;
-- 
2.1.4


Reply to: