Bugzilla – Attachment 158465 Details for
Bug 66754
Remove own implementations of various Perl functions in installer
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Switch mkdir to make_path
0001-Switching-mkdir-to-make_path.patch (text/plain), 5.48 KB, created by
ed-documentfoundation
on 2020-03-07 12:02:28 UTC
(
hide
)
Description:
Switch mkdir to make_path
Filename:
MIME Type:
Creator:
ed-documentfoundation
Created:
2020-03-07 12:02:28 UTC
Size:
5.48 KB
patch
obsolete
>From c0d895cd529cc7966b95a7596afeae2fd29dd088 Mon Sep 17 00:00:00 2001 >From: ed neville <ed@s5h.net> >Date: Sat, 7 Mar 2020 10:48:24 +0000 >Subject: [PATCH] Switching mkdir to make_path > >Due to concurrency keeping the current calls to create_directories. > >Change-Id: I9ad68bf7ba4805d2d139012a8e2844e70028ae33 >--- > setup_native/scripts/admin.pl | 17 +++++++++-------- > solenv/bin/modules/installer/systemactions.pm | 11 ++++++----- > 2 files changed, 15 insertions(+), 13 deletions(-) > >diff --git a/setup_native/scripts/admin.pl b/setup_native/scripts/admin.pl >index edc41cdfa..da450dc44 100644 >--- a/setup_native/scripts/admin.pl >+++ b/setup_native/scripts/admin.pl >@@ -19,6 +19,7 @@ > use Cwd; > use File::Copy; > use File::Temp qw/ :mktemp /; >+use File::Path qw(make_path); > > ################################################################################# > # Global settings >@@ -134,7 +135,7 @@ sub controlparameter > > if ( ! -f $databasepath ) { exit_program("ERROR: Did not find msi database in directory $databasepath."); } > >- if ( ! -d $targetdir ) { create_directories($targetdir); } >+ if ( ! -d $targetdir ) { make_path($targetdir); } > } > > ############################################################################# >@@ -349,7 +350,7 @@ sub create_directory > { > my ($directory) = @_; > >- if ( ! -d $directory ) { mkdir($directory, 0775); } >+ make_path($directory); > } > > ############################################################## >@@ -731,7 +732,7 @@ sub create_directory_tree > my $dirname = $dirhash->{$dir}->{'DefaultDir'}; > # Create the directory > my $newdir = $fulldir . $separator . $dirname; >- if ( ! -f $newdir ) { mkdir $newdir; } >+ if ( ! -f $newdir ) { create_directory($newidr); } > # Saving in collector > $pathcollector->{$dir} = $newdir; > # Iteration >@@ -805,7 +806,7 @@ sub create_directory_with_privileges > if (!(-d $directory)) > { > my $localprivileges = oct("0".$privileges); # changes "777" to 0777 >- $returnvalue = mkdir($directory, $localprivileges); >+ $returnvalue = make_path($directory, { chmod => $localprivileges }); > > if ($returnvalue) > { >@@ -834,7 +835,7 @@ sub create_pid_directory > > $directory = $directory . "_" . $pid . $time; > >- if ( ! -d $directory ) { create_directory($directory); } >+ if ( ! -d $directory ) { make_path($directory); } > else { exit_program("ERROR: Directory $directory already exists!"); } > > return $directory; >@@ -1158,7 +1159,7 @@ print("\nmsi database: $databasepath\n"); > print("Destination directory: $targetdir\n" ); > > my $helperdir = $temppath . $separator . "installhelper"; >-create_directory($helperdir); >+make_path($helperdir); > > # Get File.idt, Component.idt and Directory.idt from database > >@@ -1167,7 +1168,7 @@ extract_tables_from_database($databasepath, $helperdir, $tablelist); > > # Set unpackdir > my $unpackdir = $helperdir . $separator . "unpack"; >-create_directory($unpackdir); >+make_path($unpackdir); > > # Reading media table to check for internal cabinet files > my $filename = $helperdir . $separator . "Media.idt"; >@@ -1182,7 +1183,7 @@ if ( $contains_internal_cabfiles ) > { > # Set unpackdir > my $cabdir = $helperdir . $separator . "internal_cabs"; >- create_directory($cabdir); >+ make_path($cabdir); > my $from = cwd(); > chdir($cabdir); > # Exclude all cabinet files from database >diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm >index 4f7a18bba..26ddb995a 100644 >--- a/solenv/bin/modules/installer/systemactions.pm >+++ b/solenv/bin/modules/installer/systemactions.pm >@@ -20,6 +20,7 @@ package installer::systemactions; > > use Cwd; > use File::Copy; >+use File::Path qw(make_path); > use installer::converter; > use installer::exiter; > use installer::globals; >@@ -52,7 +53,7 @@ sub create_directory_with_privileges > > if (!(-d $directory)) > { >- $returnvalue = mkdir($directory, $localprivileges); >+ $returnvalue = make_path($directory, { chmod => $localprivileges }); > > if ($returnvalue) > { >@@ -78,7 +79,7 @@ sub create_directory_with_privileges > installer::pathanalyzer::get_path_from_fullqualifiedname(\$parentdir); > if (!(-d $parentdir)) > { >- $returnvalue = mkdir($directory, $localprivileges); >+ $returnvalue = make_path($directory, { chmod => $localprivileges }); > > if ($returnvalue) > { >@@ -107,7 +108,7 @@ sub create_directory_with_privileges > # At this point we have to assume, that the parent directory exist. > # Trying once more to create the desired directory > >- $returnvalue = mkdir($directory, $localprivileges); >+ $returnvalue = make_path($directory, { chmod => $localprivileges }); > > if ($returnvalue) > { >@@ -298,7 +299,7 @@ sub copy_one_file > } > elsif (-d $source && is_empty_dir($source)) { > my $mode = (stat($source))[2] & 07777; >- $copyreturn = mkdir($dest, $mode); >+ $copyreturn = make_path($dest, { chmod => $mode }); > } > else { > $copyreturn = copy($source, $dest); >@@ -1060,7 +1061,7 @@ sub try_to_create_directory > > if (!(-d $directory)) > { >- $returnvalue = mkdir($directory, 0775); >+ $returnvalue = make_path($directory, { chmod => 0775 }); > > if ($returnvalue) > { >-- >2.20.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 66754
: 158465