appropriately handle lock acquisition failures in resolve-system-dependencies.pl
This commit is contained in:
parent
3f65504164
commit
f5a7739171
|
@ -4,6 +4,7 @@ use utf8;
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Cwd qw(realpath);
|
use Cwd qw(realpath);
|
||||||
|
use Errno;
|
||||||
use File::Basename qw(dirname);
|
use File::Basename qw(dirname);
|
||||||
use File::Path qw(make_path);
|
use File::Path qw(make_path);
|
||||||
use File::Spec::Functions qw(catfile);
|
use File::Spec::Functions qw(catfile);
|
||||||
|
@ -24,10 +25,14 @@ make_path dirname($cache);
|
||||||
our $DEPS;
|
our $DEPS;
|
||||||
eval {
|
eval {
|
||||||
$DEPS = lock_retrieve($cache);
|
$DEPS = lock_retrieve($cache);
|
||||||
} or do {
|
};
|
||||||
|
|
||||||
|
if($!{ENOENT}) {
|
||||||
lock_store {}, $cache;
|
lock_store {}, $cache;
|
||||||
$DEPS = {};
|
$DEPS = {};
|
||||||
};
|
} elsif($@) {
|
||||||
|
die "Unable to obtain a lock on dependency-map file $cache: $@";
|
||||||
|
}
|
||||||
|
|
||||||
sub mkset(@) {
|
sub mkset(@) {
|
||||||
my %set;
|
my %set;
|
||||||
|
|
Loading…
Reference in a new issue