Index: /devel/pb/lib/ProjectBuilder/Filter.pm
===================================================================
--- /devel/pb/lib/ProjectBuilder/Filter.pm	(revision 1044)
+++ /devel/pb/lib/ProjectBuilder/Filter.pm	(revision 1130)
@@ -177,4 +177,12 @@
 			}
 			$tmp = "";
+		} elsif (($s =~ /^PBMULTISRC$/) && ($line =~ /^PBMULTISRC$/)) {
+			pb_log(3,"DEBUG filtering PBMULTISRC\n");
+			my $i = 1;
+			foreach my $p (split(/,/,$pb->{'sources'}->{$pb->{'tuple'}})) {
+				print DEST "Source$i:         ".basename($p)."\n";
+				$i++;
+			}
+			$tmp = "";
 		} elsif (($s =~ /^PBPATCHCMD$/) && ($line =~ /^PBPATCHCMD$/)) {
 			pb_log(3,"DEBUG filtering PBPATCHCMD\n");
Index: /devel/pb/lib/ProjectBuilder/Env.pm
===================================================================
--- /devel/pb/lib/ProjectBuilder/Env.pm	(revision 1113)
+++ /devel/pb/lib/ProjectBuilder/Env.pm	(revision 1130)
@@ -555,9 +555,12 @@
 filter PBDATE = \$pb->{'date'}
 
-# PBPATCHSRC is replaced by the patches names if value is yes
+# PBPATCHSRC is replaced by the patches names if value is yes. Patches are located under the pbpatch dir of the pkg.
 #filter PBPATCHSRC = yes
 
 # PBPATCHCMD is replaced by the patches commands if value is yes
 #filter PBPATCHCMD = yes
+
+# PBMULTISRC is replaced by the sources names if value is yes. Sources are located under the pbsrc dir of the pkg.
+#filter PBMULTISRC = yes
 
 # PBTAG is replaced by the tag (\$pb->{'tag'} in code)
Index: /devel/pb/bin/pb
===================================================================
--- /devel/pb/bin/pb	(revision 1128)
+++ /devel/pb/bin/pb	(revision 1130)
@@ -756,4 +756,5 @@
 		my %build;
 		my %patches;
+		my %sources;
 		# We want to at least build for the underlying distro
 		# except if a target was given, in which case we only build for it
@@ -793,4 +794,5 @@
 		$pb{'repo'} = $ENV{'PBREPO'};
 		$pb{'patches'} = \%patches;
+		$pb{'sources'} = \%sources;
 		pb_log(2,"DEBUG: pb: ".Dumper(%pb)."\n");
 	
@@ -852,37 +854,4 @@
 				my $ptr = pb_get_filters($pbpkg, $pb{'dtype'}, $dfam, $ddir, $dver);
 	
-				# Prepare local patches for this distro - They are always applied first - May be a problem one day
-				foreach my $p (sort(<$ENV{'PBROOTDIR'}/$pbpkg/pbpatch/*>)) {
-					$patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.all$/));
-					$patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.all$/);
-					$patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$pb{'dtype'}$/));
-					$patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$pb{'dtype'}$/);
-					$patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$dfam$/));
-					$patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$dfam$/);
-					$patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir$/));
-					$patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir$/);
-					$patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver$/));
-					$patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver$/);
-					$patches{"$ddir-$dver-$arch"} .= "," if ((defined $patches{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver-$arch$/));
-					$patches{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver-$arch$/);
-				}
-	
-				# Prepare also remote patches to be included - Applied after the local ones
-				foreach my $p ("all","$pb{'dtype'}","$dfam","$ddir","$ddir-$dver","$ddir-$dver-$arch") {
-					my $f = "$ENV{'PBROOTDIR'}/$pbpkg/pbextpatch.$p";
-					next if (not -f $f);
-					if (not open(PATCH,$f)) {
-						pb_display("Unable to open existing external patch file content $f\n");
-						next;
-					}
-					while (<PATCH>) {
-						chomp();
-						$patches{"$ddir-$dver-$arch"} .= "," if (defined $patches{"$ddir-$dver-$arch"});
-						$patches{"$ddir-$dver-$arch"} .= "$_";
-					}
-					close(PATCH);
-				}
-				pb_log(2,"DEBUG: pb->patches: ".Dumper($pb{'patches'})."\n");
-	
 				# Apply now all the filters on all the files concerned
 				# destination dir depends on the type of file
@@ -894,4 +863,7 @@
 					}
 				}
+				pb_list_sfiles("$ENV{'PBROOTDIR'}/$pbpkg/pbpatch", \%patches, $pb{'dtype'}, $dfam, $ddir, $dver, $arch, "$ENV{'PBROOTDIR'}/$pbpkg/pbextpatch");
+				pb_list_sfiles("$ENV{'PBROOTDIR'}/$pbpkg/pbsrc", \%sources, $pb{'dtype'}, $dfam, $ddir, $dver, $arch, "$ENV{'PBROOTDIR'}/$pbpkg/pbextsrc");
+
 				$pm->finish if (defined $pbparallel);
 			}
@@ -906,4 +878,5 @@
 			pb_log(0,"No Build files found for ".join(',',sort(@notfound))."\n") if (@notfound);
 			pb_log(2,"DEBUG: patches: ".Dumper(%patches)."\n");
+			pb_log(2,"DEBUG: sources: ".Dumper(%sources)."\n");
 		}
 
@@ -927,5 +900,6 @@
 		if (not defined $web) {
 			my %tmp;
-			my $warnflag = 0;
+			my $warnptcflag = 0;
+			my $warnsrcflag = 0;
 			# Filter potential patches (local + remote)
 			pb_log(0,"Delivering and compressing patches ");
@@ -935,5 +909,5 @@
 					my $pp = basename($pf);
 					if ($param eq "SandBox") {
-						$warnflag = 1;
+						$warnptcflag = 1;
 					}
 					pb_cms_export($pf,undef,"$dest/pbconf/$v/pbpatch");
@@ -943,9 +917,23 @@
 				}
 			}
+			pb_log(0,"Delivering additional sources ");
+			foreach my $v (keys %sources) {
+				pb_mkdir_p("$dest/pbconf/$v/pbsrc");
+				foreach my $pf (split(/,/,$sources{$v})) {
+					my $pp = basename($pf);
+					if ($param eq "SandBox") {
+						$warnsrcflag = 1;
+					}
+					pb_cms_export($pf,undef,"$dest/pbconf/$v/pbsrc");
+					pb_filter_file_inplace($ptr,"$dest/pbconf/$v/pbsrc/$pp",\%pb);
+					$tmp{$pf} = "";
+				}
+			}
 			foreach my $v (keys %tmp) {
 				pb_log(0,"$v ");
 			}
 			pb_log(0,"\n");
-			pb_log(0,"WARNING: Patches are always taken from repository not local export\n") if ($warnflag == 1);
+			pb_log(0,"WARNING: Patches are always taken from repository not local export\n") if ($warnptcflag == 1);
+			pb_log(0,"WARNING: Sources are always taken from repository not local export\n") if ($warnsrcflag == 1);
 		} else {
 			# Instead call News generation
@@ -3250,5 +3238,50 @@
 }
 
-
+sub pb_list_sfiles {
+
+my $sdir = shift;
+my $sources = shift;
+my $dtype = shift;
+my $dfam = shift;
+my $ddir = shift;
+my $dver = shift;
+my $arch = shift;
+my $extdir = shift;
+
+# Prepare local sources for this distro - They are always applied first - May be a problem one day
+# This function works for both patches and additional sources
+foreach my $p (sort(<$sdir/*>)) {
+	$sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.all$/));
+	$sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.all$/);
+	$sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$dtype$/));
+	$sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$dtype$/);
+	$sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$dfam$/));
+	$sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$dfam$/);
+	$sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir$/));
+	$sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir$/);
+	$sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver$/));
+	$sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver$/);
+	$sources->{"$ddir-$dver-$arch"} .= "," if ((defined $sources->{"$ddir-$dver-$arch"}) and ($p =~ /\.$ddir-$dver-$arch$/));
+	$sources->{"$ddir-$dver-$arch"} .= "file://$p" if ($p =~ /\.$ddir-$dver-$arch$/);
+}
+
+# Prepare also remote sources to be included - Applied after the local ones
+foreach my $p ("all","$dtype","$dfam","$ddir","$ddir-$dver","$ddir-$dver-$arch") {
+	my $f = "$extdir.".".$p";
+	next if (not -f $f);
+	if (not open(PATCH,$f)) {
+		pb_display("Unable to open existing external source file content $f\n");
+		next;
+	}
+	while (<PATCH>) {
+		chomp();
+		$sources->{"$ddir-$dver-$arch"} .= "," if (defined $sources->{"$ddir-$dver-$arch"});
+		$sources->{"$ddir-$dver-$arch"} .= "$_";
+	}
+	close(PATCH);
+}
+pb_log(2,"DEBUG: sources: ".Dumper($sources)."\n");
+}
+	
 # 
 # Return the list of packages we are working on in a non CMS action
