From c4d9e36efd50a8b510c5ac18428a0ea90eb79cfd Mon Sep 17 00:00:00 2001 From: Doug Torrance Date: Fri, 22 Aug 2014 11:50:21 -0500 Subject: [PATCH] update-dockapps.pl: Handle earlier versions of dockapps with alternate names. Some dockapps earlier versions of dockapps, e.g. the recently added wmacpi-ng, may have different names than the directories they appear in. This patch adds the ability to handle this situation by keeping track of the directory for getting git information and skipping these dockapps when creating the "+date" versions. --- update-dockapps.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/update-dockapps.pl b/update-dockapps.pl index 65caa1b..ad25496 100755 --- a/update-dockapps.pl +++ b/update-dockapps.pl @@ -56,6 +56,13 @@ my $r = Git::Repository->new(); my @tags = $r->run("tag"); my %dockapps; +# If any earlier versions of a dockapp had an alternate name, e.g. a name change +# or a fork which has since been blessed, add it to this hash as 'alt' => +# 'main'. The alternate should still have its own entry in dockapps.db.in. +my %alts = ( + 'wmacpi-ng' => 'wmacpi' + ); + foreach my $tag (@tags) { $tag =~ /([\w\-+.]+)-([\w.]+)/; my $dockapp = $1; @@ -69,11 +76,18 @@ foreach my $tag (@tags) { if (!$ls) { $ls = $r->run("ls-tree", $tag, "$dockapp" . "_$version"); } +#for alts + if (!$ls) { + $ls = $r->run("ls-tree", $tag, $alts{$dockapp}); + } my $sha1 = (split(/\s/, $ls))[2]; $dockapps{$dockapp}{$version} = $sha1; } foreach my $dockapp (keys %dockapps) { + if (grep {$_ eq $dockapp} keys %alts) { + next; + } my $latest_version = (sort by_version keys $dockapps{$dockapp})[-1]; if ($r->run("diff", "$dockapp-$latest_version", "HEAD", $dockapp)) { my $commit = $r->run("log", "-1",