]> granicus.if.org Git - ejabberd/commitdiff
Improve update-deps-releases deps parsing
authorPaweł Chmielowski <pchmielowski@process-one.net>
Tue, 27 Jun 2017 12:56:00 +0000 (14:56 +0200)
committerPaweł Chmielowski <pchmielowski@process-one.net>
Tue, 27 Jun 2017 12:56:00 +0000 (14:56 +0200)
tools/update-deps-releases.pl

index 5395f1d55723b67c1df2ae4c9269edc49fca1c2f..e1de817ec3607ff8a752380305ee506cb1364b34 100755 (executable)
@@ -22,7 +22,11 @@ sub get_deps {
     return { } unless $config =~ /\{\s*deps\s*,\s*\[(.*?)\]/s;
     my $sdeps = $1;
 
-    while ($sdeps =~ /\{\s*(\w+)\s*,\s*".*?"\s*,\s*\{\s*git\s*,\s*"(.*?)"\s*,\s*(?:{\s*tag\s*,\s*"(.*?)"|"(.*?)" )/sg) {
+    while ($sdeps =~ /\{\s* (\w+) \s*,\s* ".*?" \s*,\s* \{\s*git \s*,\s* "(.*?)" \s*,\s*
+                      (?:
+                        (?:{\s*tag \s*,\s* "(.*?)") |
+                        "(.*?)" |
+                        ( \{ (?: (?-1) | [^{}]+ )+ \} ) )/sgx) {
         next unless not %fdeps or exists $fdeps{$1};
         $deps{$1} = { repo => $2, commit => $3 || $4 };
     }
@@ -359,7 +363,9 @@ while (1) {
 
         for my $dep (keys %$top_deps) {
             for my $sdep (keys %{$sub_deps->{$dep}}) {
-                next if $sub_deps->{$dep}->{$sdep}->{commit} eq $top_deps->{$sdep}->{commit};
+                next if not defined $top_deps->{$sdep} or
+                    $sub_deps->{$dep}->{$sdep}->{commit} eq $top_deps->{$sdep}->{commit};
+                say "$dep $sdep ",$sub_deps->{$dep}->{$sdep}->{commit}," <=> $sdep ",$top_deps->{$sdep}->{commit};
                 schedule_operation("update", $dep, $git_info->{$dep}->{new_tag},
                     "Updating $sdep to version $top_deps->{$sdep}->{commit}.", [$sdep, $top_deps->{$sdep}->{commit}]);
             }