From 6e890a965af0c11110eece324cc93a58739df4ab Mon Sep 17 00:00:00 2001 From: sturm Date: Sun, 26 Dec 2004 07:48:46 +0000 Subject: [PATCH] in parse_dependency_file() make sure, we really read port specs and not some gibberish like error messages or so --- infrastructure/build/dpb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/infrastructure/build/dpb b/infrastructure/build/dpb index fde901f6c63..f351b5c81f2 100755 --- a/infrastructure/build/dpb +++ b/infrastructure/build/dpb @@ -1,6 +1,6 @@ #!/usr/bin/perl -w -# $OpenBSD: dpb,v 1.9 2004/11/14 11:46:15 sturm Exp $ +# $OpenBSD: dpb,v 1.10 2004/12/26 07:48:46 sturm Exp $ # Copyright (c) 2004 Nikolay Sturm . # # Redistribution and use in source and binary forms, with or without @@ -413,6 +413,22 @@ sub parse_dependency_file() chomp; my ($a, $b) = split /\s+/; + # ensure $a and $b are really port specs and not gibberish + # category/{subcategory/}*port{\,flavor}*{\,-subpackage} + my $borked = 0; + foreach my $p ($a, $b) { + if (not defined $p or $p eq "") { + warn "*** empty port spec in deplist\n"; + $borked = 1; + last; + } + if (not $p =~ /(\w*\/)+[-.\w]+(,\w+)*(,-[\w]+)*/) { + warn "*** broken deplist entry: $p\n"; + $borked = 1; + } + } + next if $borked == 1; + # ensure every port depends on itself, needed by build logic # ports depending on the key $depend_on{$a} = [$a] unless defined $depend_on{$a};