[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH v2 16/23] Debian.pm: debian_overlays: Do not make $func callback for nonexistent dirs



This means that it is now OK not to have an `overlay-local'.

Signed-off-by: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>
---
 Osstest/Debian.pm | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 0185761..125d499 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -818,8 +818,19 @@ END
 
 sub debian_overlays ($$) {
     my ($ho, $func) = @_;
-    $func->($c{OverlayLocal}, 'overlay-local.tar');
-    $func->('overlay', 'overlay.tar');
+    # calls $func->($local_dir, $tarball_leafname);
+    my $maybe = sub {
+       my ($local_dir, $tarball_leafname) = @_;
+       if (stat $local_dir) {
+           $func->($local_dir, $tarball_leafname);
+       } elsif ($! == ENOENT) {
+           # ok
+       } else {
+           die "debian_overlays cannot check $local_dir: $!";
+       }
+    };
+    $maybe->($c{OverlayLocal}, 'overlay-local.tar');
+    $maybe->('overlay', 'overlay.tar');
 }
 
 sub preseed_base ($$$;@) {
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.