if ($incremental == 1 && $style ne 'git') {
error("incremental build only support git style packages");
}
-if ($style ne 'git' && $style ne 'obs') {
+if ($style ne 'git' && $style ne 'obs' && $style ne 'tar') {
error("style should be 'git' or 'obs'");
}
my $pkg_path = "$build_root/local/sources/$dist/$name-$version-$release";
my $srpm_filename = "";
my $not_ex = 0;
- if ( $style eq "git" && $incremental == 0 ) {
+ if ( ( $style eq "git" || $style eq "tar" ) && $incremental == 0 ) {
if ($not_export_source == 1) {
$not_ex = grep /^$name$/, @not_export;
if ($vmtype eq "kvm") {
$index++;
}
}
+#use pre-export source to analyse
+sub fill_packs_from_dir {
+ my $name = shift;
+ my $base = dirname($name);
+ my $prj = basename($base);
+
+ if ( (grep $_ eq $prj, @exclude) ) {
+ return;
+ }
+ debug("working on $base");
+ my $l_packaging_dir = $packaging_dir;
+
+ if (-e "$base/.gbs.conf") {
+ debug("use $base own gbs.conf");
+ my $cfg_tiny = Config::Tiny->new;
+ $cfg_tiny = Config::Tiny->read("$base/.gbs.conf");
+ my $v = $cfg_tiny->{general}->{packaging_dir};
+ $l_packaging_dir = $v if (defined($v));
+ }
+ # use pre-export source to find spec
+ my $pattern = "$base/$l_packaging_dir/*.spec";
+ $pattern = "$base/$l_packaging_dir/$arg_spec" if $arg_spec ne "";
+ my @spec_list = glob($pattern);
+ my $specs = "";
+ foreach my $spec (@spec_list) {
+ push(@packs, {filename => "$spec",
+ project_base_path => $base,
+ packaging_dir => $l_packaging_dir
+ });
+ }
+
+}
+
+sub dir_wanted {
+ if( -d "$name/packaging" )
+ {
+ fill_packs_from_dir("$name/packaging");
+ $prune = 1;
+ }
+}
# MAIN
if ($depends) {
}
}
}
+} elsif($style eq 'tar') {
+ File::Find::find({wanted => \&dir_wanted}, $package_path );
+ if (@packs == 0) {
+ error("No source package found at $package_path");
+ }
} else {
@packs = @ARGV;
if (@packs == 0) {