CustomTarget_html.mk          |    6 ++++--
 helpers/make_icon_link.txt.py |    8 +++-----
 2 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit e21698f795b4098ecccf3119e23edd3d9e7aac1e
Author:     Stephan Bergmann <[email protected]>
AuthorDate: Tue May 12 10:19:02 2020 +0200
Commit:     Stephan Bergmann <[email protected]>
CommitDate: Tue May 12 11:26:53 2020 +0200

    Fix helpers/make_icon_link.txt.py
    
    It contained Python-2--isms that caused errors when /usr/bin/python is 
Python 3
    (at least on Fedora 32 with python-unversioned-command-3.8.2-2.fc32.noarch 
and
    python3-3.8.2-2.fc32.x86_64):
    
    >   File "helpcontent2/helpers/make_icon_link.txt.py", line 21
    >     print "There was an error reading", file_icon
    >           ^
    > SyntaxError: Missing parentheses in call to 'print'. Did you mean 
print("There was an error reading", file_icon)?
    
    and
    
    >   File "helpcontent2/helpers/make_icon_link.txt.py", line 39
    >     if line.find('png',0, len(line)) <> -1 :
    >                                       ^
    > SyntaxError: invalid syntax
    
    So fix helpers/make_icon_link.txt.py to be proper Python 3 and explicitly
    execute it with gb_ExternalExecutable_get_command,python instead of via a
    /usr/bin/python shebang.
    
    (That file was apparently not executed during the build prior to
    ee180ade07e36dd1fb8c7bdca6ecbab44ded9eb8 "tdf#128519 Automate icon repl't 
table
    for Help bld", so these issues were not noticied earlier.)
    
    Change-Id: Ia3cff9538ab537076a02b64ad8c1bf56dcfaf30b
    Reviewed-on: https://gerrit.libreoffice.org/c/help/+/94039
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <[email protected]>

diff --git a/CustomTarget_html.mk b/CustomTarget_html.mk
index b9eab167f..cd53b9c6a 100644
--- a/CustomTarget_html.mk
+++ b/CustomTarget_html.mk
@@ -157,8 +157,10 @@ $(call 
gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/%/contents.part : \
 
 # link txt file for icon replacement table
 $(SRCDIR)/helpcontent2/helpers/links.txt.xsl: \
-               $(SRCDIR)/icon-themes/colibre/links.txt 
-       $(SRCDIR)/helpcontent2/helpers/make_icon_link.txt.py 
$(SRCDIR)/icon-themes/colibre/links.txt $@
+               $(SRCDIR)/icon-themes/colibre/links.txt \
+               $(SRCDIR)/helpcontent2/helpers/make_icon_link.txt.py \
+               $(call gb_ExternalExecutable_get_dependencies,python)
+       $(call gb_ExternalExecutable_get_command,python) 
$(SRCDIR)/helpcontent2/helpers/make_icon_link.txt.py 
$(SRCDIR)/icon-themes/colibre/links.txt $@
 
 define html_gen_html_dep
 $(call gb_CustomTarget_get_workdir,helpcontent2/help3xsl)/$(1)/html.text : \
diff --git a/helpers/make_icon_link.txt.py b/helpers/make_icon_link.txt.py
old mode 100755
new mode 100644
index e5ef3d2ee..573af4050
--- a/helpers/make_icon_link.txt.py
+++ b/helpers/make_icon_link.txt.py
@@ -1,5 +1,3 @@
-#!/usr/bin/python
-
 #
 # This file is part of the LibreOffice project.
 #
@@ -18,14 +16,14 @@ try:
    file_icon = open(sys.argv[1], "r")
 
 except IOError:
-   print "There was an error reading", file_icon
+   print("There was an error reading", file_icon)
    sys.exit()
 try:
    # open file stream
    file_xsl = open(sys.argv[2], "w+")
 
 except IOError:
-   print "There was an error writing", file_xsl
+   print("There was an error writing", file_xsl)
    sys.exit()
 
 file_xsl.write('<?xml version="1.0" encoding="UTF-8"?>\n');
@@ -36,7 +34,7 @@ file_xsl.write('<xsl:choose>\n')
 
 for line in file_icon:
     if line[0] != "#" :
-        if line.find('png',0, len(line)) <> -1 :
+        if line.find('png',0, len(line)) != -1 :
             a = "\'" + line.split()[0] + "\'";
             b = line.split()[1].replace(".png",".svg");
             file_xsl.write('<xsl:when test="$src1=' + a + '"><xsl:text>'+ b + 
'</xsl:text></xsl:when>\n');
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to