BasioMeusPuga / Lector

Qt based ebook reader
GNU General Public License v3.0
1.51k stars 207 forks source link

SheBang in including scripts #38

Closed guoyunhe closed 6 years ago

guoyunhe commented 6 years ago

When packaging RPM, I found some warnings related to SheBang:

[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/__init__.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/compatibility_utils.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/kindleunpack.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_cover.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_dict.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_header.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_html.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_index.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_k8proc.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_k8resc.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_nav.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_ncx.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_opf.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_pagemap.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_sectioner.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_split.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_uncompress.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobi_utils.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/mobiml2xhtml.py 644 /usr/bin/python 
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/unipath.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/KindleUnpack/unpack_structure.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/__main__.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/database.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/definitionsdialog.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/delegates.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/ePub/read_epub.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/library.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/metadatadialog.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/models.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/parsers/comicbooks.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/parsers/epub.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/parsers/mobi.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/parsers/pdf.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/rarfile/dumprar.py 644 /usr/bin/env python
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/settings.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/settingsdialog.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/sorter.py 644 /usr/bin/env python3
[    9s] lector.noarch: W: non-executable-script /usr/lib/python3.6/site-packages/lector/threaded.py 644 /usr/bin/env python3
[    9s] This text file contains a shebang or is located in a path dedicated for
[    9s] executables, but lacks the executable bits and cannot thus be executed.  If
[    9s] the file is meant to be an executable script, add the executable bits,
[    9s] otherwise remove the shebang or move the file elsewhere.

From this StackOverflow post https://stackoverflow.com/a/19305076/4699409

The shebang line in any script determines the script's ability to be executed like an standalone executable without typing python beforehand in the terminal or when double clicking it in a file manager (when configured properly).

So maybe it is not very necessary to add SheBang to files that won't be executed directly but only be included. If SheBang is needed, then it requires executable bits, too.

BasioMeusPuga commented 6 years ago

You're right, of course. It's mostly just force of habit. I've removed all the unnecessary shebangs.