Merge lp:~mapreri/inkscape/executable-not-elf-or-script into lp:~inkscape.dev/inkscape/trunk

Proposed by Mattia Rizzolo
Status: Merged
Approved by: Mc
Approved revision: 15396
Merged at revision: 15399
Proposed branch: lp:~mapreri/inkscape/executable-not-elf-or-script
Merge into: lp:~inkscape.dev/inkscape/trunk
Diff against target: 23 lines (+11/-1)
1 file modified
share/extensions/CMakeLists.txt (+11/-1)
To merge this branch: bzr merge lp:~mapreri/inkscape/executable-not-elf-or-script
Reviewer Review Type Date Requested Status
Inkscape Developers Pending
Review via email: mp+314278@code.launchpad.net

Description of the change

Avoid installing python modules not intended to be executed directly (but are imported from others) as executables.

It's kinda ugly because listing explicitly is not nice, but I think it's good enough. Otherwise, do you have any idea of how to accomplish it in some nicer way?

To post a comment you must log in.
Revision history for this message
Mc (mc...) wrote :

what does add the +x bit in the first lpace instead of keeping the permissions from the original files ?

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

The 'install(PROGRAMS ...)' of cmake does. PROGRAMS is there exactly to specify that you want the +x. FILES is used when you don't want the +x.

From the little I know about cmake, the only way to preserve the original permissions is to use install(DIRECTORY ... USE_SOURCE_PERMISSIONS), but with that you'd need to copy the whole directory, which I assumed you don't want to do given that you wrote this CMakeList in first place.

Revision history for this message
Mattia Rizzolo (mapreri) wrote :

Thank you!

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'share/extensions/CMakeLists.txt'
2--- share/extensions/CMakeLists.txt 2016-11-26 16:15:27 +0000
3+++ share/extensions/CMakeLists.txt 2017-01-07 12:31:40 +0000
4@@ -26,8 +26,18 @@
5 "*.sh"
6 "*.rb"
7 )
8-
9+# These files don't need the +x bit
10+set(_SCRIPTS_NOEXEC
11+ "hersheydata.py"
12+ "hpgl_decoder.py"
13+ "hpgl_encoder.py"
14+ "simplepath.py"
15+ "simplestyle.py"
16+ "simpletransform.py"
17+)
18+list(REMOVE_ITEM _SCRIPTS ${_SCRIPTS_NOEXEC})
19 install(PROGRAMS ${_SCRIPTS} DESTINATION ${INKSCAPE_SHARE_INSTALL}/extensions)
20+install(FILES ${_SCRIPTS_NOEXEC} DESTINATION ${INKSCAPE_SHARE_INSTALL}/extensions)
21
22 file(GLOB _FILES "alphabet_soup/*.svg")
23 install(FILES ${_FILES} DESTINATION ${INKSCAPE_SHARE_INSTALL}/extensions/alphabet_soup)