From 1273987641e98cc2ae82feb806a6d5bb0b8e7697 Mon Sep 17 00:00:00 2001
From: Andrew Ruthven <andrew@cerberus.etc.gen.nz>
Date: Fri, 12 Oct 2007 14:40:26 +1300
Subject: [PATCH] If there are no items for a block, skip everything about that
 block.

---
 bin/status.pl | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/bin/status.pl b/bin/status.pl
index bfa1093..d7e7371 100755
--- a/bin/status.pl
+++ b/bin/status.pl
@@ -77,8 +77,11 @@ my @blocks = (
 for my $block (@blocks) {
   my $items = $xml->documentElement->find($block->{'xpath'});
 
-  print "$block->{'name'}:\n"
-    if (scalar(@$items) > 0);
+  # Don't do any work on this block if there is nothing for it.
+  next
+    if (scalar(@$items) == 0);
+
+  print "$block->{'name'}:\n";
 
   for my $item (@{ $items }) {
     my $template = $block->{'template'};
-- 
2.30.2