summaryrefslogtreecommitdiff
path: root/pkgtools/tinderbox-dragonfly/patches/patch-az
diff options
context:
space:
mode:
Diffstat (limited to 'pkgtools/tinderbox-dragonfly/patches/patch-az')
-rw-r--r--pkgtools/tinderbox-dragonfly/patches/patch-az101
1 files changed, 101 insertions, 0 deletions
diff --git a/pkgtools/tinderbox-dragonfly/patches/patch-az b/pkgtools/tinderbox-dragonfly/patches/patch-az
new file mode 100644
index 00000000000..9d30d4eaa4f
--- /dev/null
+++ b/pkgtools/tinderbox-dragonfly/patches/patch-az
@@ -0,0 +1,101 @@
+$NetBSD: patch-az,v 1.1 2011/11/02 21:13:30 marino Exp $
+
+--- ../FreeBSD/lib/Tinderbox/TinderboxDS.pm 2011-10-16 00:52:55.000000000 +0000
++++ lib/Tinderbox/TinderboxDS.pm
+@@ -753,6 +753,96 @@ sub clearDependenciesForPort {
+ return $rc;
+ }
+
++sub getDependencyCascades_search {
++ my $self = shift;
++ my $build_id = shift;
++ my $port_id = shift;
++ my $typelimit = shift;
++
++ my @results = ();
++ my @params = ($build_id, $port_id);
++ my $query = "SELECT build_port_id " .
++ "FROM build_ports " .
++ "WHERE build_id=? AND port_id=?";
++ my $rc = $self->_doQueryHashRef($query, \@results, @params);
++ if (!$rc) {
++ return undef;
++ }
++ my $build_port_id = $results[0]->{'build_port_id'};
++
++ @results = ();
++ @params = ($build_port_id);
++ $query = "SELECT port_id " .
++ "FROM port_dependencies " .
++ "WHERE build_port_id=? ";
++
++ if ($typelimit) {
++ $query .= "AND dependency_type IN " .
++ "('DEPENDS','RUN_DEPENDS','LIB_DEPENDS')";
++ }
++
++ $rc = $self->_doQueryHashRef($query, \@results, @params);
++ if (!$rc) {
++ return undef;
++ }
++
++ my @deps = ();
++ foreach my $result (@results) {
++ push @deps, $result->{'port_id'};
++ }
++ return @deps;
++}
++
++sub getDependencyCascades {
++ my $self = shift;
++ my $port = shift;
++ my $build = shift;
++
++ $self->verifyType(1, $port, 'Port');
++ $self->verifyType(2, $build, 'Build');
++
++ my $pkg;
++ my @CascadeSet = ();
++ my %CheckList = ($port->getId(), 1);
++ my @FirstList = $self->getDependencyCascades_search (
++ $build->getId(), $port->getId(), 0);
++ foreach $pkg(@FirstList) {
++ $CheckList{$pkg} = 0;
++ }
++ my $cascadePkg;
++ my @NextList;
++ my @mandate = @FirstList;
++ my $advance = (scalar keys %CheckList > 0);
++ while ($advance) {
++ foreach $pkg (@mandate) {
++ $CheckList{$pkg} = 1;
++ @NextList = $self->getDependencyCascades_search (
++ $build->getId(), $pkg, 1);
++ foreach $cascadePkg (@NextList) {
++ if (!exists $CheckList{$cascadePkg}) {
++ $CheckList{$cascadePkg} = 0;
++ push @CascadeSet, $cascadePkg;
++ }
++ }
++ }
++ @mandate = ();
++ $advance = 0;
++ foreach $pkg (keys %CheckList) {
++ if ($CheckList{$pkg} == 0) {
++ push @mandate, $pkg;
++ $advance = 1;
++ }
++ }
++ }
++
++ my @deps = ();
++ foreach $pkg (@CascadeSet) {
++ my $pCls = $self->getPortById($pkg);
++ push @deps, $pCls if (defined($pCls));
++ }
++ return @deps;
++}
++
+ sub getDependenciesForPort {
+ my $self = shift;
+ my $port = shift;