[Libreoffice-commits] core.git: postprocess/CustomTarget_images.mk solenv/bin

Katarina Behrens Katarina.Behrens at cib.de
Fri Nov 4 13:42:40 UTC 2016


 postprocess/CustomTarget_images.mk |    2 ++
 solenv/bin/packimages.pl           |   30 ++++++++++++++++++++++++------
 2 files changed, 26 insertions(+), 6 deletions(-)

New commits:
commit d082936c7a2c3fd6a8784fa5a626f545ec904b42
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date:   Tue Aug 30 22:31:08 2016 +0200

    Allow including/packaging help-specific images
    
    from other than icon-themes folder
    
    Change-Id: Iba1808e642fde8d0370b59550c7bdac1a3e4ac79
    Reviewed-on: https://gerrit.libreoffice.org/28513
    Reviewed-by: jan iversen <jani at documentfoundation.org>
    Tested-by: jan iversen <jani at documentfoundation.org>
    Reviewed-by: Olivier Hallot <olivier.hallot at edx.srv.br>

diff --git a/postprocess/CustomTarget_images.mk b/postprocess/CustomTarget_images.mk
index ecfbe96..def511b 100644
--- a/postprocess/CustomTarget_images.mk
+++ b/postprocess/CustomTarget_images.mk
@@ -30,6 +30,7 @@ $(packimages_DIR)/%.zip : \
 		$(SRCDIR)/sfx2/source/sidebar/sidebar.ilst \
 		$(SRCDIR)/vcl/source/control/throbber.ilst \
 		$(call gb_Helper_optional,HELP,$(helpimages_DIR)/helpimg.ilst) \
+		$(call gb_Helper_optional,HELP,$(helpimages_DIR)/screenshotimg.ilst) \
 		$(call gb_Helper_optional,DBCONNECTIVITY,$(if $(ENABLE_JAVA),$(SRCDIR)/connectivity/source/drivers/hsqldb/hsqlui.ilst)) \
 		$(call gb_Helper_get_imagelists)
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
@@ -41,6 +42,7 @@ $(packimages_DIR)/%.zip : \
 				-g $(SRCDIR)/icon-themes/$(subst images_,,$*) -m $(SRCDIR)/icon-themes/$(subst images_,,$*) -c $(SRCDIR)/icon-themes/$(subst images_,,$*) \
 			) \
 			$(INDUSTRIAL_FALLBACK) \
+			$(call gb_Helper_optional,HELP,-e $(SRCDIR)/helpcontent2/source) \
 			-l $${ILSTFILE} \
 			-s $< -o $@ \
 			$(if $(findstring s,$(MAKEFLAGS)),> /dev/null) && \
diff --git a/solenv/bin/packimages.pl b/solenv/bin/packimages.pl
old mode 100644
new mode 100755
index a768ebb..fb141c0
--- a/solenv/bin/packimages.pl
+++ b/solenv/bin/packimages.pl
@@ -36,11 +36,13 @@ use File::Temp qw(tempdir);
 
 my $img_global = '%GLOBALRES%';  # 'global' image prefix
 my $img_module = '%MODULE%';  # 'module' image prefix
+my $img_help = '%HELPCONTENT%';  # 'help' image prefix
 
 my $out_file;                # path to output archive
 my $tmp_out_file;            # path to temporary output file
 my $global_path;             # path to global images directory
 my $module_path;             # path to module images directory
+my $helpimg_path;            # path to help images directory
 my $sort_file;               # path to file containing sorting data
 my @custom_path;             # path to custom images directory
 my $imagelist_file;          # file containing list of image list files
@@ -64,7 +66,7 @@ foreach ( @{$image_lists_ref} ) {
     $image_lists_hash{$_}="";
 }
 $do_rebuild = is_file_newer(\%image_lists_hash) if $do_rebuild == 0;
-my ($global_hash_ref, $module_hash_ref, $custom_hash_ref) = iterate_image_lists($image_lists_ref);
+my ($global_hash_ref, $module_hash_ref, $custom_hash_ref, $help_hash_ref) = iterate_image_lists($image_lists_ref);
 # custom_hash filled from filesystem lookup
 find_custom($custom_hash_ref);
 
@@ -87,7 +89,8 @@ for my $path (@custom_path) {
     }
 }
 
-my $zip_hash_ref = create_zip_list($global_hash_ref, $module_hash_ref, $custom_hash_ref);
+my $zip_hash_ref = create_zip_list($global_hash_ref, $module_hash_ref, $custom_hash_ref, $help_hash_ref);
+
 remove_links_from_zip_list($zip_hash_ref, \%links);
 
 $do_rebuild = is_file_newer($zip_hash_ref) if $do_rebuild == 0;
@@ -115,6 +118,7 @@ sub parse_options
                              '-g=s' => \$global_path,
                  '-s=s' => \$sort_file,
                              '-m=s' => \$module_path,
+                             '-e=s' => \$helpimg_path,
                              '-c=s' => \@custom_path_list,
                              '-l=s' => \$imagelist_file,
                              '-v'   => \$verbose,
@@ -135,7 +139,11 @@ sub parse_options
 
     # Check paths.
     print_error("no such file '$_'", 2) if ! -f $imagelist_file;
-    foreach ($out_dir, $global_path, $module_path) {
+
+    my @check_directories = ($out_dir, $global_path, $module_path);
+    push @check_directories, $helpimg_path if ($helpimg_path ne '');
+
+    foreach (@check_directories) {
         print_error("no such directory: '$_'", 2) if ! -d $_;
         print_error("can't search directory: '$_'", 2) if ! -x $_;
     }
@@ -179,12 +187,13 @@ sub iterate_image_lists
     my %global_hash;
     my %module_hash;
     my %custom_hash;
+    my %help_hash;
 
     foreach my $i ( @{$image_lists_ref} ) {
-        parse_image_list($i, \%global_hash, \%module_hash, \%custom_hash);
+        parse_image_list($i, \%global_hash, \%module_hash, \%custom_hash, \%help_hash);
     }
 
-    return (\%global_hash, \%module_hash, \%custom_hash);
+    return (\%global_hash, \%module_hash, \%custom_hash, \%help_hash);
 }
 
 sub parse_image_list
@@ -193,6 +202,7 @@ sub parse_image_list
     my $global_hash_ref = shift;
     my $module_hash_ref = shift;
     my $custom_hash_ref = shift;
+    my $help_hash_ref = shift;
 
     print_message("parsing '$image_list' ...") if $verbose;
     my $linecount = 0;
@@ -216,13 +226,17 @@ sub parse_image_list
             $module_hash_ref->{$1}++;
             next;
         }
+        if ( /^\Q$img_help\E\/(.*)$/o ) {
+            $help_hash_ref->{$1}++;
+            next;
+        }
         # parse failed if we reach this point, bail out
         close(IMAGE_LIST);
         print_error("can't parse line $linecount from file '$image_list'", 4);
     }
     close(IMAGE_LIST);
 
-    return ($global_hash_ref, $module_hash_ref, $custom_hash_ref);
+    return ($global_hash_ref, $module_hash_ref, $custom_hash_ref, $help_hash_ref);
 }
 
 sub find_custom
@@ -256,6 +270,7 @@ sub create_zip_list
     my $global_hash_ref = shift;
     my $module_hash_ref = shift;
     my $custom_hash_ref = shift;
+    my $help_hash_ref = shift;
 
     my %zip_hash;
     my @warn_list;
@@ -282,6 +297,9 @@ sub create_zip_list
         # it's not in 'custom', record it in zip hash
         $zip_hash{$_} = $module_path;
     }
+    foreach ( keys %{$help_hash_ref} ) {
+        $zip_hash{$_} = $helpimg_path;
+    }
 
     if ( @warn_list ) {
         foreach ( @warn_list ) {


More information about the Libreoffice-commits mailing list