summaryrefslogtreecommitdiff
path: root/solenv/bin
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-07-16 12:06:47 +0200
committerStephan Bergmann <sbergman@redhat.com>2019-07-17 08:09:52 +0200
commitcabadfc288e5e7324723c62f36b918a80db90323 (patch)
tree93d4570bf43a38bbfb1b7c148f71deec89b6ed39 /solenv/bin
parent6d1e550df7fc4f710e15b6f5d63a58587a952378 (diff)
Introduce gb_Package_add_empty_directories
...which will be needed in a subsequent patch to fix tdf#125693. The installer code could not handle a directory in a .filelist, the simplest hack appears to be to add a special case for an empty source dir to copy_one_file in solenv/bin/modules/installer/systemactions.pm. Includes changes made by Stephan Bergmann <sbergman@redhat.com>. Change-Id: I52dca2543a66eb76117598d77d559592e26ce859 Reviewed-on: https://gerrit.libreoffice.org/75702 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'solenv/bin')
-rw-r--r--solenv/bin/modules/installer/systemactions.pm14
1 files changed, 14 insertions, 0 deletions
diff --git a/solenv/bin/modules/installer/systemactions.pm b/solenv/bin/modules/installer/systemactions.pm
index 9b12ff63c271..4f7a18bba5e6 100644
--- a/solenv/bin/modules/installer/systemactions.pm
+++ b/solenv/bin/modules/installer/systemactions.pm
@@ -277,6 +277,16 @@ sub create_directories
# Copying one file
########################
+sub is_empty_dir
+{
+ my ($dir) = @_;
+ my ($handle, $count);
+ opendir($handle, $dir) or return 0;
+ $count = scalar(grep { $_ ne '.' && $_ ne '..' } readdir($handle));
+ closedir($handle);
+ return $count == 0;
+}
+
sub copy_one_file
{
my ($source, $dest) = @_;
@@ -286,6 +296,10 @@ sub copy_one_file
if ( -l $source ) {
$copyreturn = symlink(readlink("$source"), "$dest");
}
+ elsif (-d $source && is_empty_dir($source)) {
+ my $mode = (stat($source))[2] & 07777;
+ $copyreturn = mkdir($dest, $mode);
+ }
else {
$copyreturn = copy($source, $dest);
}