diff options
-rwxr-xr-x | rpmdrake | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -471,8 +471,13 @@ sub extract_header { warn "Warning, hdlist seems corrupted\n"; goto header_non_available; }; - my $headersdir = chomp_(`mktemp -d /tmp/rpmdrake.XXXXXX`); - -d $headersdir or die "Could not create temporary directory"; + my ($headersdir, $retries); + while (!-d $headersdir && $retries < 5) { + $headersdir = chomp_(`mktemp -d /tmp/rpmdrake.XXXXXXXX`); + $retries++; + -d $headersdir or warn qq(Could not create temporary directory "$headersdir"); + } + -d $headersdir or die qq(Could not create temporary directory "$headersdir"); $packer->extract_archive($headersdir, $p->header_filename); $p->update_header("$headersdir/" . $p->header_filename) or do { warn "Warning, could not extract header!"; |