Skip to content

Commit

Permalink
- support for debian dependency choices
Browse files Browse the repository at this point in the history
- do not create changelog dates < 1997
  • Loading branch information
mlschroe committed Feb 12, 2007
1 parent 6b30e9a commit 1930c6f
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Build.pm
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,13 @@ sub readrpmdeps {
for my $p (keys %prov) {
push @{$provides{$_}}, $p for unify(@{$prov{$p}});
}
my @ors = grep {/\|/} map {@$_} values %requires;
@ors = unify(@ors) if @ors > 1;
for my $or (@ors) {
my @p = map {@{$provides{$_} || []}} split(/\|/, $or);
@p = unify(@p) if @p > 1;
$provides{$or} = \@p;
}
$config->{'providesh'} = \%provides;
$config->{'requiresh'} = \%requires;
}
Expand Down Expand Up @@ -359,6 +366,17 @@ sub expand {
@q = @pq;
}
}
if (@q > 1 && $r =~ /\|/) {
# choice op, implicit prefer of first match...
my %pq = map {$_ => 1} @q;
for my $rr (split(/\|/, $r)) {
next unless $provides->{$rr};
my @pq = grep {$pq{$_}} @{$provides->{$rr}};
next unless @pq;
@q = @pq;
last;
}
}
if (@q > 1) {
if ($r ne $p) {
push @error, "have choice for $r needed by $p: @q";
Expand Down
3 changes: 3 additions & 0 deletions changelog2spec
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,9 @@ while (<>) {
}
$lastt = $tdt;
my @gm = gmtime($tdt);
# rpm can't hande dates < 1997, so we fold everything to
# Thu Jan 02 1997
@gm = (0, 0, 0, 2, 0, 97, 4) if $gm[5] < 97 || ($gm[5] == 97 && $gm[3] <= 1);
printf("* %s %s %2d %4d %s\n", $wday[$gm[6]], $mon[$gm[4]], $gm[3], $gm[5] + 1900, $who);
$ok = 1;
next;
Expand Down

0 comments on commit 1930c6f

Please sign in to comment.