Skip to content

Commit

Permalink
Added: `pre_remove' attribute -- Allows to remove previous directory …
Browse files Browse the repository at this point in the history
…(folder xml node from install.xml files)

Typo
  • Loading branch information
nuxwin committed Oct 13, 2017
1 parent 2963111 commit 6a08116
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ FRONTEND

INSTALLER
Added: `copy_as' attribute -- Allows to copy a file with specific name (copy_config xml node from install.xml files)
Added: `pre_remove' attribute -- Allows to remove previous directory (folder xml node from install.xml files)
Enhancement: Make it possible to provide per distribution (codename) configuration file
Enhancement: Provide good default values for installer whenever possible
Fixed: `build' mode is broken for fresh installs -- Packages must be pre-installed regardless of install mode
Expand Down
10 changes: 1 addition & 9 deletions autoinstaller/Functions.pm
Original file line number Diff line number Diff line change
Expand Up @@ -904,15 +904,7 @@ sub _processFolderNode
my ($node) = @_;

my $dir = iMSCP::Dir->new( dirname => $node->{'content'} );

# Needed to be sure to not keep any file from a previous build that has
# failed
if ( defined $main::{'INST_PREF'}
&& $main::{'INST_PREF'} eq $node->{'content'}
) {
$dir->remove();
}

$dir->remove() if $node->{'pre_remove'};
$dir->make(
{
user => defined $node->{'user'} ? _expandVars( $node->{'owner'} ) : undef,
Expand Down
2 changes: 1 addition & 1 deletion configs/debian/install.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<install>
<folder mode="1777">/tmp</folder>
<folder export="INST_PREF">/tmp/imscp</folder>
<folder export="INST_PREF" pre_remove="1">/tmp/imscp</folder>
<folder mode="0755" export="ROOT_CONF">${INST_PREF}/etc</folder>
<folder export="SYSTEM_CONF">${INST_PREF}/etc/imscp</folder>
<folder mode="0755">${INST_PREF}/usr</folder>
Expand Down
2 changes: 1 addition & 1 deletion engine/PerlLib/iMSCP/Dir.pm
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ sub isEmpty
Clear a full directory content or the files/diretories inside the directory that match the given regexp
Param Regexp $regexp OPTIOANL regexp for directory content matching
Param Regexp $regexp OPTIONAL regexp for directory content matching
Return int 0 on success or die on failure
=cut
Expand Down

0 comments on commit 6a08116

Please sign in to comment.