<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>354610</bug_id>
          
          <creation_ts>2015-10-30 18:05:59 +0000</creation_ts>
          <short_desc>ECMInstallIcons.cmake may call REMOVE_DUPLICATES(_themes) without checking if _themes is actually set.</short_desc>
          <delta_ts>2015-11-04 09:41:01 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>3</classification_id>
          <classification>Frameworks and Libraries</classification>
          <product>extra-cmake-modules</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>Compiled Sources</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brice De Bruyne">bricedb</reporter>
          <assigned_to name="Alex Merry">alex.merry</assigned_to>
          <cc>ecm-bugs-null</cc>
          
          <cf_commitlink>http://commits.kde.org/extra-cmake-modules/21629f651a6a5d9d977be03fd9f98417c4fa27ae</cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1553682</commentid>
    <comment_count>0</comment_count>
    <who name="Brice De Bruyne">bricedb</who>
    <bug_when>2015-10-30 18:05:59 +0000</bug_when>
    <thetext>git master commit fb7b8eea7d91772f989d5b060c86df20f2ebdb66
breaks ECMInstallIcons.cmake when calling REMOVE_DUPLICATES(_theme)
when _theme is unset.

This renders ksirk unconfigurable, possibly other packages too.

A simple check whether _themes is set fixes this:

--- extra-cmake-modules-1/modules/ECMInstallIcons.cmake 2015-10-30 18:53:04.065271019 +0100
+++ extra-cmake-modules/modules/ECMInstallIcons.cmake   2015-10-30 18:53:51.103271014 +0100
@@ -169,10 +169,12 @@
       endif( _theme_GROUP)
    endforeach (_current_ICON)
 
-   list(REMOVE_DUPLICATES _themes)
-   foreach(_theme ${_themes})
-       _ecm_update_iconcache(&quot;${_defaultpath}&quot; &quot;${_theme}&quot;)
-   endforeach()
+   if(_themes)
+      list(REMOVE_DUPLICATES _themes)
+      foreach(_theme ${_themes})
+          _ecm_update_iconcache(&quot;${_defaultpath}&quot; &quot;${_theme}&quot;)
+      endforeach()
+   endif(_themes)
 
 endmacro()
 




Reproducible: Always

Steps to Reproduce:
1. install latest ecm
2. get latest ksirk git
3. try to get it configured.


Actual Results:  
cmake error

Expected Results:  
cmake succeeds

fix:

--- extra-cmake-modules-1/modules/ECMInstallIcons.cmake 2015-10-30 18:53:04.065271019 +0100
+++ extra-cmake-modules/modules/ECMInstallIcons.cmake   2015-10-30 18:53:51.103271014 +0100
@@ -169,10 +169,12 @@
       endif( _theme_GROUP)
    endforeach (_current_ICON)
 
-   list(REMOVE_DUPLICATES _themes)
-   foreach(_theme ${_themes})
-       _ecm_update_iconcache(&quot;${_defaultpath}&quot; &quot;${_theme}&quot;)
-   endforeach()
+   if(_themes)
+      list(REMOVE_DUPLICATES _themes)
+      foreach(_theme ${_themes})
+          _ecm_update_iconcache(&quot;${_defaultpath}&quot; &quot;${_theme}&quot;)
+      endforeach()
+   endif(_themes)
 
 endmacro()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1553683</commentid>
    <comment_count>1</comment_count>
      <attachid>95229</attachid>
    <who name="Brice De Bruyne">bricedb</who>
    <bug_when>2015-10-30 18:07:34 +0000</bug_when>
    <thetext>Created attachment 95229
ecm-fix-ECMInstallIcons_cmake-1.patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1554445</commentid>
    <comment_count>2</comment_count>
    <who name="Alex Merry">alex.merry</who>
    <bug_when>2015-11-03 12:05:34 +0000</bug_when>
    <thetext>Given that this only happens when ecm_install_icons is called in such a way that it does nothing, I figured it would be better to make it a warning:

https://git.reviewboard.kde.org/r/125931/

In the meantime, ksirk can just have that ecm_install_icons call removed, as it is useless.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1554680</commentid>
    <comment_count>3</comment_count>
    <who name="Alex Merry">alex.merry</who>
    <bug_when>2015-11-04 09:41:01 +0000</bug_when>
    <thetext>Git commit 21629f651a6a5d9d977be03fd9f98417c4fa27ae by Alex Merry.
Committed on 04/11/2015 at 09:40.
Pushed by alexmerry into branch &apos;master&apos;.

Warn instead of error if ecm_install_icons finds no icons.

The V1 syntax of ecm_install_icons searched for icons by globbing files
with a particular naming pattern. If there were no such icons, this used
to do nothing, but silently. Commit fb7b8eea7d accidentally made this an
error. More sensible would be to make it a warning.
REVIEW: 125931

M  +8    -4    modules/ECMInstallIcons.cmake
M  +1    -0    tests/ECMInstallIconsTest/CMakeLists.txt
A  +1    -0    tests/ECMInstallIconsTest/v1-syntax-no-icons/CMakeLists.txt

http://commits.kde.org/extra-cmake-modules/21629f651a6a5d9d977be03fd9f98417c4fa27ae</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>95229</attachid>
            <date>2015-10-30 18:07:34 +0000</date>
            <delta_ts>2015-10-30 18:07:34 +0000</delta_ts>
            <desc>ecm-fix-ECMInstallIcons_cmake-1.patch</desc>
            <filename>ecm-fix-ECMInstallIcons_cmake-1.patch</filename>
            <type>text/plain</type>
            <size>618</size>
            <attacher name="Brice De Bruyne">bricedb</attacher>
            
              <data encoding="base64">LS0tIGV4dHJhLWNtYWtlLW1vZHVsZXMtMS9tb2R1bGVzL0VDTUluc3RhbGxJY29ucy5jbWFrZQky
MDE1LTEwLTMwIDE4OjUzOjA0LjA2NTI3MTAxOSArMDEwMAorKysgZXh0cmEtY21ha2UtbW9kdWxl
cy9tb2R1bGVzL0VDTUluc3RhbGxJY29ucy5jbWFrZQkyMDE1LTEwLTMwIDE4OjUzOjUxLjEwMzI3
MTAxNCArMDEwMApAQCAtMTY5LDEwICsxNjksMTIgQEAKICAgICAgIGVuZGlmKCBfdGhlbWVfR1JP
VVApCiAgICBlbmRmb3JlYWNoIChfY3VycmVudF9JQ09OKQogCi0gICBsaXN0KFJFTU9WRV9EVVBM
SUNBVEVTIF90aGVtZXMpCi0gICBmb3JlYWNoKF90aGVtZSAke190aGVtZXN9KQotICAgICAgIF9l
Y21fdXBkYXRlX2ljb25jYWNoZSgiJHtfZGVmYXVsdHBhdGh9IiAiJHtfdGhlbWV9IikKLSAgIGVu
ZGZvcmVhY2goKQorICAgaWYoX3RoZW1lcykKKyAgICAgIGxpc3QoUkVNT1ZFX0RVUExJQ0FURVMg
X3RoZW1lcykKKyAgICAgIGZvcmVhY2goX3RoZW1lICR7X3RoZW1lc30pCisgICAgICAgICAgX2Vj
bV91cGRhdGVfaWNvbmNhY2hlKCIke19kZWZhdWx0cGF0aH0iICIke190aGVtZX0iKQorICAgICAg
ZW5kZm9yZWFjaCgpCisgICBlbmRpZihfdGhlbWVzKQogCiBlbmRtYWNybygpCiAK
</data>

          </attachment>
      

    </bug>

</bugzilla>