Index: trunk/ippScripts/scripts/dist_bundle.pl
===================================================================
--- trunk/ippScripts/scripts/dist_bundle.pl	(revision 35979)
+++ trunk/ippScripts/scripts/dist_bundle.pl	(revision 36047)
@@ -53,6 +53,5 @@
                       'PPSTACK.OUTPUT.MASK' => 'mask',
                       'PPSTACK.OUTPUT.VARIANCE' => 'variance' );
-my %sky_cleaned   = ();
-my %skycal_cleaned = ();
+my %empty_cleaned = ();
 
 
@@ -135,5 +134,5 @@
 my $file_list = get_file_list($stage, $component, $path_base, $clean, $num_sky_inputs);
 
-if (($stage ne 'raw') and ($stage ne 'fake') and !$poor_quality) {
+if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) {
     # If the file list is empty it is an error because we should at least get a config dump file
     # except for fake stage which doesn't do anything yet
@@ -461,8 +460,6 @@
     } elsif ($stage eq "stack") {
         $type = $stack_cleaned{$rule};
-    } elsif ($stage eq "sky") {
-        $type = $sky_cleaned{$rule};
-    } elsif ($stage eq "skycal") {
-        $type = $skycal_cleaned{$rule};
+    } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary') {
+        $type = $empty_cleaned{$rule};
     } else {
         &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
@@ -552,4 +549,7 @@
     } elsif ($stage eq "skycal") {
         $config_file_rule = "PSASTRO.CONFIG";
+    } elsif ($stage eq "stack_summary") {
+        # stack_summary stage does not use a config dump file.
+        return build_stack_summary_file_list($path_base, \@file_list);
     } else {
         &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR);
@@ -666,8 +666,42 @@
     if (!$num_inputs) {
         $num_inputs = "undefined" if !defined $num_inputs;
-        &my_die("unexpected number of static sky inputs $num_inputs",  $PS_EXIT_PROG_ERROR, $component, $error_code);
+        &my_die("unexpected number of static sky inputs $num_inputs",  $component, $error_code);
     }
 
     return $num_inputs;
+}
+
+# For stack_summary stage, we don't have a config dump file to give us the list of files.
+# For now run neb-ls on the path base and take everything that matches.
+sub build_stack_summary_file_list {
+    my ($path_base, $file_list) = @_;
+
+    my $scheme = file_scheme($path_base);
+
+    if (!$scheme or $scheme ne 'neb') {
+        &my_die("Building bundles for stack_summary not supported for no nebulous path_base.",
+            $component, $PS_EXIT_PROG_ERROR);
+    }
+
+    my $command = "neb-ls $path_base" . '%';
+    my ( $success, $error_code, $full_buf, $stdout_buf, $stderr_buf ) =
+        run(command => $command, verbose => $verbose);
+    unless ($success) {
+        $error_code = (($error_code >> 8) or $PS_EXIT_PROG_ERROR);
+        &my_die("Unable to perform $command: $error_code", $component, $error_code);
+    }
+    my $nebls_output = join "", @$stdout_buf;
+
+    my @files = split "\n", $nebls_output;
+
+    my $i = 0;
+    foreach my $f (@files) {
+        my %file;
+        $file{file_rule} = sprintf 'RULE.%d', $i++;
+        $file{name} = 'neb://any/' . $f;
+        push @$file_list, \%file;
+    }
+
+    return $file_list;
 }
 
