summaryrefslogtreecommitdiff
path: root/Master/tlpkg/etc/dev.more-autopatterns-for-binfiles.patch
blob: 760a2fa55dad5b63c9eb78af3ab23d92ca1b33a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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: