Index: TLPSRC.pm =================================================================== --- TLPSRC.pm (revision 13292) +++ TLPSRC.pm (working copy) @@ -313,6 +313,7 @@ foreach my $p (@allpospats) { my @todoarchs = $tltree->architectures; my $finalp = $p; + my $is_default_pattern = 0; if ($p =~ m%^(\w+)/(!?[-_a-z0-9,]+)\s+(.*)$%) { my $pt = $1; my $aa = $2; @@ -340,21 +341,37 @@ if ($finalp =~ m! bin/win32/!) { @todoarchs = qw/win32/; } + # remove initial * if it is a default pattern since we call + # get_matching files directly + if ($finalp =~ m/^\*/) { + $is_default_pattern = 1; + $finalp =~ s/^\*//; + } # now @todoarchs contains only those archs for which we want # to match the pattern foreach my $arch (@todoarchs) { # get only those files matching the pattern my @archfiles = $tltree->get_matching_files('bin',$finalp, $arch); if (!@archfiles) { - if (($arch ne "win32") || defined($::tlpsrc_pattern_warn_win)) { + if (!$is_default_pattern && + ( ($arch ne "win32") || defined($::tlpsrc_pattern_warn_win))) { tlwarn("$self->{name} ($arch): no hit on binpattern $finalp\n"); } + if (!$is_default_pattern) { + # for actual bin patterns we add empty binfiles to generate + # the probably empty .ARCH packages + $tlp->add_binfiles($arch,@archfiles); + } + } else { + # do call that if there are really only binfiles available, + # otherwise we end up with .ARCH packages for *each* package + $tlp->add_binfiles($arch,@archfiles); } - $tlp->add_binfiles($arch,@archfiles); } } foreach my $p (@allnegpats) { my @todoarchs = $tltree->architectures; + my $is_default_pattern = 0; my $finalp = $p; if ($p =~ m%^(\w+)/(!?[-_a-z0-9,]+)\s+(.*)$%) { my $pt = $1; @@ -377,6 +394,12 @@ # set $p to the pattern without arch specification $finalp = "$pt $pr"; } + # remove initial * if it is a default pattern since we call + # get_matching files directly + if ($finalp =~ m/^\*/) { + $is_default_pattern = 1; + $finalp =~ s/^\*//; + } # now @todoarchs contains only those archs for which we want # to match the pattern foreach my $arch (@todoarchs) { @@ -387,8 +410,14 @@ tlwarn("$self->{name} ($arch): no hit on negative binpattern $finalp\n") unless defined($::tlpsrc_pattern_no_warn_negative); } + if (!$is_default_pattern) { + # for actual bin patterns we add empty binfiles to generate + # the probably empty .ARCH packages + $tlp->add_binfiles($arch,@archfiles); + } + } else { + $tlp->remove_binfiles($arch,@archfiles); } - $tlp->remove_binfiles($arch,@archfiles); } } # add the revision number of the .tlpsrc file to the compute list: