chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.db-live.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
943fec6
)
Actually produce ocean arch/island info in output master-info files
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 1 Sep 2009 15:43:50 +0000
(16:43 +0100)
committer
Ian Jackson
<Ian.Jackson@eu.citrix.com>
Tue, 1 Sep 2009 15:43:50 +0000
(16:43 +0100)
yarrg/update-master-info
patch
|
blob
|
history
diff --git
a/yarrg/update-master-info
b/yarrg/update-master-info
index 00aee34b890767cf308ec43c226128caefce701b..6d1cae7063bfa0947ca81080b3ee63db8610bc1b 100755
(executable)
--- a/
yarrg/update-master-info
+++ b/
yarrg/update-master-info
@@
-20,39
+20,48
@@
sub quick ($) {
my $rsyncdir;
my $rsyncdir;
-sub update_master_info () {
- my $sfn= 'source-info.txt';
+sub process_some_info ($$$) {
+ my ($v,$df,$sfn) = @_;
+ my $sf= new IO::File $sfn or die "$sfn $!";
+
+ my $h;
+ while (<$sf>) {
+ chomp; s/\s+$//;
+ next if m/^\s*\#/ || !m/\S/;
+ if (m/^\S.*/) {
+ $h= $&;
+ }
+ die "$_ ?" unless defined $h;
+ if ($h =~ m/^commods|^\%[a-z]\b/) {
+ s/\t.*//;
+ }
+ if ($v<2) {
+ next if $h =~ m/^nocommods/;
+ }
+ next if $sfn =~ m/source-info/ && $h =~ m/^ocean/;
+
+ print $df $_, "\n" or die $!;
+ }
+
+ $sf->error and die $!;
+}
+sub update_master_info () {
foreach my $v (1..$masterinfoversion) {
my $dfnl= sprintf "master-info%s.txt", ($v>1 ? "-v$v" : '');
print STDERR "installing new $dfnl...\n";
my $dfn= "$rsyncdir/$dfnl";
foreach my $v (1..$masterinfoversion) {
my $dfnl= sprintf "master-info%s.txt", ($v>1 ? "-v$v" : '');
print STDERR "installing new $dfnl...\n";
my $dfn= "$rsyncdir/$dfnl";
- my $sf= new IO::File $sfn or die "$sfn $!";
my $df= new IO::File "$dfn.tmp", 'w' or die "$dfn.tmp $!";
my $df= new IO::File "$dfn.tmp", 'w' or die "$dfn.tmp $!";
- my $h;
- while (<$sf>) {
- chomp; s/\s+$//;
- next if m/^\s*\#/ || !m/\S/;
- if (m/^\S.*/) {
- $h= $&;
- }
- die "$_ ?" unless defined $h;
- if ($h =~ m/^commods|^\%[a-z]\b/) {
- s/\t.*//;
- }
- if ($v<2) {
- next if $h =~ m/^nocommods/;
- }
- print $df $_, "\n" or die $!;
+ process_some_info($v,$df, 'source-info.txt');
+ foreach my $ocean (sort keys %oceans) {
+ process_some_info($v,$df, '_ocean-'.(lc $ocean).'.txt');
}
}
- $sf->error and die $!;
close $df or die $!;
rename "$dfn.tmp", "$dfn" or die $!;
}
close $df or die $!;
rename "$dfn.tmp", "$dfn" or die $!;
}
-
}
}