diff options
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/bin/modules/installer.pm | 9 | ||||
-rw-r--r-- | solenv/bin/modules/installer/control.pm | 1 | ||||
-rw-r--r-- | solenv/bin/modules/installer/environment.pm | 3 | ||||
-rw-r--r-- | solenv/bin/modules/installer/filelists.pm | 95 | ||||
-rw-r--r-- | solenv/gbuild/Package.mk | 12 | ||||
-rw-r--r-- | solenv/gbuild/TargetLocations.mk | 4 |
6 files changed, 121 insertions, 3 deletions
diff --git a/solenv/bin/modules/installer.pm b/solenv/bin/modules/installer.pm index c731d9e116fc..df0727f2af1f 100644 --- a/solenv/bin/modules/installer.pm +++ b/solenv/bin/modules/installer.pm @@ -41,6 +41,7 @@ use installer::download; use installer::environment; use installer::epmfile; use installer::files; +use installer::filelists; use installer::globals; use installer::helppack; use installer::languagepack; @@ -617,6 +618,14 @@ sub run { installer::scriptitems::quoting_illegal_filenames($filesinproductlanguageresolvedarrayref); } + ###################################################################################### + # Processing files with flag FILELIST and putting listed files into the file list + ###################################################################################### + + installer::logger::print_message( "... analyzing files with flag FILELIST ...\n" ); + + $filesinproductlanguageresolvedarrayref = installer::filelists::resolve_filelist_flag($filesinproductlanguageresolvedarrayref, $ENV{'INSTDIR'}); + ##################################### # Files with flag SUBST_FILENAME ##################################### diff --git a/solenv/bin/modules/installer/control.pm b/solenv/bin/modules/installer/control.pm index 26ab41aa4724..87b961548e82 100644 --- a/solenv/bin/modules/installer/control.pm +++ b/solenv/bin/modules/installer/control.pm @@ -280,6 +280,7 @@ sub check_system_environment OUTPATH LOCAL_OUT LOCAL_COMMON_OUT + WORKDIR ); for my $key ( @environmentvariables ) diff --git a/solenv/bin/modules/installer/environment.pm b/solenv/bin/modules/installer/environment.pm index 646bf1649e00..cfc8fdf084c4 100644 --- a/solenv/bin/modules/installer/environment.pm +++ b/solenv/bin/modules/installer/environment.pm @@ -67,6 +67,9 @@ sub create_pathvariables my $platformname = $environment->{'OUTPATH'}; $variables{'platformname'} = $platformname; + my $filelistpath = $environment->{'WORKDIR'} . $installer::globals::separator . 'Package'; + $variables{'filelistpath'} = $filelistpath; + return \%variables; } diff --git a/solenv/bin/modules/installer/filelists.pm b/solenv/bin/modules/installer/filelists.pm new file mode 100644 index 000000000000..d3447be79163 --- /dev/null +++ b/solenv/bin/modules/installer/filelists.pm @@ -0,0 +1,95 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +package installer::filelists; + +use installer::files; +use installer::globals; +use installer::logger; +use installer::pathanalyzer; + +sub resolve_filelist_flag +{ + my ($files, $outdir) = @_; + my @newfiles = (); + + foreach my $file (@{$files}) + { + my $is_filelist = 0; + if ($file->{'Styles'}) + { + if ($file->{'Styles'} =~ /\bFILELIST\b/) + { + $is_filelist = 1; + } + } + + if ($is_filelist) + { + my $filelist_path = $file->{'sourcepath'}; + my $filelist = read_filelist($filelist_path); + if (@{$filelist}) + { + my $destination = $file->{'destination'}; + installer::pathanalyzer::get_path_from_fullqualifiedname(\$destination); + + foreach my $path (@{$filelist}) + { + # TODO: check that the file is really under $outdir + # TODO: check existence of the file + my $subpath = substr $path, ((length $outdir) + 1); # drop separator too + + my %newfile = (); + %newfile = %{$file}; + $newfile{'Name'} = $subpath; + $newfile{'sourcepath'} = $path; + $newfile{'destination'} = $destination . $subpath; + $newfile{'filelistname'} = $file->{'Name'}; + $newfile{'filelistpath'} = $file->{'sourcepath'}; + + push @newfiles, \%newfile; + } + } + else + { + installer::logger::print_message("filelist $filelist_path is empty\n"); + } + } + else # not a filelist, just pass the current file over + { + push @newfiles, $file; + } + } + + return \@newfiles; +} + +sub read_filelist +{ + my ($path) = @_; + my $content = installer::files::read_file($path); + my @filelist = (); + + foreach my $line (@{$content}) + { + chomp $line; + foreach my $file (split /\s+/, $line) + { + if ($file ne "") + { + push @filelist, $file; + } + } + } + + return \@filelist; +} + +1; + +# vim: set expandtab shiftwidth=4 tabstop=4: diff --git a/solenv/gbuild/Package.mk b/solenv/gbuild/Package.mk index c239897b3cf6..ed68d8f9e489 100644 --- a/solenv/gbuild/Package.mk +++ b/solenv/gbuild/Package.mk @@ -56,6 +56,12 @@ endef # Package class +$(dir $(call gb_Package_get_target,%)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(dir $(call gb_Package_get_target,%))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + .PHONY : $(call gb_Package_get_clean_target,%) $(call gb_Package_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),PKG,2) @@ -68,14 +74,17 @@ $(call gb_Package_get_preparation_target,%) : $(call gb_Package_get_target,%) : $(call gb_Output_announce,$*,$(true),PKG,2) - mkdir -p $(dir $@) && touch $@ + rm -f $@ && \ + mv $(call var2file,$@.tmp,100,$(FILES)) $@ # for other targets that want to create Packages, does not register at Module define gb_Package_Package_internal gb_Package_SOURCEDIR_$(1) := $(2) gb_Package_OUTDIR_$(1) := $(OUTDIR) +$(call gb_Package_get_target,$(1)) : FILES := $(call gb_Package_get_clean_target,$(1)) : FILES := $(call gb_Package_get_target,$(1)) $(call gb_Package_get_preparation_target,$(1)) $(call gb_Package_get_target,$(1)) : $(call gb_Package_get_preparation_target,$(1)) +$(call gb_Package_get_target,$(1)) :| $(dir $(call gb_Package_get_target,$(1))).dir endef @@ -99,6 +108,7 @@ endef define gb_Package_add_file $(call gb_Package_get_target,$(1)) : $$(gb_Package_OUTDIR_$(1))/$(2) +$(call gb_Package_get_target,$(1)) : FILES += $$(gb_Package_OUTDIR_$(1))/$(2) $(call gb_Package_get_clean_target,$(1)) : FILES += $$(gb_Package_OUTDIR_$(1))/$(2) $(call gb_PackagePart_PackagePart,$(2),$$(gb_Package_SOURCEDIR_$(1))/$(3),$(call gb_Package_get_preparation_target,$(1)),$$(gb_Package_OUTDIR_$(1))) diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index a8cf8a431363..7f50cf6a7574 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -163,8 +163,8 @@ gb_ObjCxxObject_get_target = $(WORKDIR)/ObjCxxObject/$(1).o gb_ObjCObject_get_target = $(WORKDIR)/ObjCObject/$(1).o gb_Pagein_get_target = $(WORKDIR)/Pagein/$(1) gb_Package_get_preparation_target = $(WORKDIR)/Package/prepared/$(1) -gb_Package_get_target = $(WORKDIR)/Package/$(1) -gb_Package_get_target_for_build = $(WORKDIR_FOR_BUILD)/Package/$(1) +gb_Package_get_target = $(WORKDIR)/Package/$(1).filelist +gb_Package_get_target_for_build = $(WORKDIR_FOR_BUILD)/Package/$(1).filelist gb_Postprocess_get_target = $(WORKDIR)/Postprocess/$(1) gb_PrecompiledHeader_get_dep_target = $(WORKDIR)/Dep/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.gch.d gb_PrecompiledHeader_get_target = $(WORKDIR)/PrecompiledHeader/$(gb_PrecompiledHeader_DEBUGDIR)/$(1).hxx.gch |