appropriately handle lock acquisition failures in resolve-system-dependencies.pl

This commit is contained in:
Jude Taylor 2015-10-21 14:38:35 -07:00
parent 3f65504164
commit f5a7739171

View file

@ -4,6 +4,7 @@ use utf8;
use strict;
use warnings;
use Cwd qw(realpath);
use Errno;
use File::Basename qw(dirname);
use File::Path qw(make_path);
use File::Spec::Functions qw(catfile);
@ -24,10 +25,14 @@ make_path dirname($cache);
our $DEPS;
eval {
$DEPS = lock_retrieve($cache);
} or do {
};
if($!{ENOENT}) {
lock_store {}, $cache;
$DEPS = {};
};
} elsif($@) {
die "Unable to obtain a lock on dependency-map file $cache: $@";
}
sub mkset(@) {
my %set;