diff options
author | Ian Lynagh <igloo@earth.li> | 2010-08-15 15:16:57 +0000 |
---|---|---|
committer | Ian Lynagh <igloo@earth.li> | 2010-08-15 15:16:57 +0000 |
commit | 0e17d4498cc037d5c18d33fcc4a4885778d266c0 (patch) | |
tree | e08cb9ec6812792138afa6aa3fdead92a1d87692 /boot | |
parent | eb586af1a1eaa107138dd38eaadacf842b9b0b4d (diff) | |
download | haskell-0e17d4498cc037d5c18d33fcc4a4885778d266c0.tar.gz |
Make the "tag" column of the packages file always present
It makes the parsing simpler if we always have the same number of columns
Diffstat (limited to 'boot')
-rw-r--r-- | boot | 26 |
1 files changed, 14 insertions, 12 deletions
@@ -8,6 +8,7 @@ use Cwd; system("/usr/bin/perl", "-w", "boot-pkgs") == 0 or die "Running boot-pkgs failed: $?"; +my $tag; my $dir; my $curdir; @@ -20,21 +21,22 @@ while (<PACKAGES>) { if (/^#/) { # Comment; do nothing } - elsif (/^([a-zA-Z0-9\/.-]+) *[^ ]+ *[^ ]+$/) { + elsif (/^([a-zA-Z0-9\/.-]+) *([^ ]+) *[^ ]+ *[^ ]+$/) { $dir = $1; + $tag = $2; - # We would like to just check for an _darcs directory here, but in - # an lndir tree we avoid making _darcs directories, so it doesn't - # exist. We therefore require that every repo has a LICENSE file - # instead. - if (! -f "$dir/LICENSE") { - print STDERR "Error: $dir/LICENSE doesn't exist.\n"; - die "Maybe you haven't done './darcs-all get'?"; - } - } - elsif (/^([a-zA-Z0-9\/.-]+) *[^ ]+ *[^ ]+ *[^ ]+$/) { - # These are lines which refer to optional repositories, so their + # If $tag is not "-" then it is an optional repository, so its # absence isn't an error. + if ($tag eq "-") { + # We would like to just check for an _darcs directory here, + # but in an lndir tree we avoid making _darcs directories, + # so it doesn't exist. We therefore require that every repo + # has a LICENSE file instead. + if (! -f "$dir/LICENSE") { + print STDERR "Error: $dir/LICENSE doesn't exist.\n"; + die "Maybe you haven't done './darcs-all get'?"; + } + } } else { die "Bad line in packages file: $_"; |