Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apt-mirror/apt-mirror.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTao Wang <twang2218@gmail.com>2017-01-04 06:26:27 +0300
committerBenjamin Drung <benjamin.drung@profitbricks.com>2017-01-06 19:21:44 +0300
commite56928ef36ff04d328e4eecf268f04679b1e426e (patch)
tree8f84cf1f1281879948166f3221f41f5d02a29883
parente63ef059b09651f8a37eb76e1189fef0bcb39285 (diff)
Create directories including their parents
apt-mirror fails when the base_path does not exist. Create the directories including their parents by replacing mkdir and mkpath with make_path. Signed-off-by: Tao Wang <twang2218@gmail.com> Signed-off-by: Benjamin Drung <benjamin.drung@profitbricks.com>
-rwxr-xr-xapt-mirror6
1 files changed, 3 insertions, 3 deletions
diff --git a/apt-mirror b/apt-mirror
index c6e8c2c..c7a5e7c 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -91,7 +91,7 @@ use warnings;
use strict;
use File::Copy;
use File::Compare;
-use File::Path;
+use File::Path qw(make_path);
use File::Basename;
use Fcntl qw(:flock);
@@ -351,7 +351,7 @@ foreach my $needed_directory (@needed_directories)
{
unless ( -d $needed_directory )
{
- mkdir($needed_directory) or die("apt-mirror: can't create $needed_directory directory");
+ make_path($needed_directory) or die("apt-mirror: can't create $needed_directory directory");
}
}
#
@@ -904,7 +904,7 @@ sub copy_file
my ( $from, $to ) = @_;
my $dir = dirname($to);
return unless -f $from;
- mkpath($dir) unless -d $dir;
+ make_path($dir) unless -d $dir;
if ( get_variable("unlink") == 1 )
{
if ( compare( $from, $to ) != 0 ) { unlink($to); }