Skip to content

qcom_ptool: drop shebangs and executable bits from package modules - #148

Open
Ali Erdinc Koroglu (aekoroglu) wants to merge 1 commit into
qualcomm-linux:mainfrom
aekoroglu:shebang
Open

qcom_ptool: drop shebangs and executable bits from package modules#148
Ali Erdinc Koroglu (aekoroglu) wants to merge 1 commit into
qualcomm-linux:mainfrom
aekoroglu:shebang

Conversation

@aekoroglu

Copy link
Copy Markdown
Contributor

Remove the shebangs, and the executable bit where it is set. No functional change.

@lumag Dmitry Baryshkov (lumag) left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why?

@aekoroglu

Copy link
Copy Markdown
Contributor Author
Rpmlint
-------
Checking: qcom-ptool-0.0^20260723git0b3897c9-1.fc45.noarch.rpm
          qcom-ptool-0.0^20260723git0b3897c9-1.fc45.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.8.0
configuration:
    /usr/lib/python3.14/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpuryh59gm')]
checks: 32, packages: 2

qcom-ptool.spec: W: specfile-warning sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
qcom-ptool.spec: W: specfile-warning sh: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8): No such file or directory
qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/gen_contents.py 644 /usr/bin/env python3
qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/gen_partition.py 644 /usr/bin/env python3
qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/msp.py 644 /usr/bin/env python3
qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/ptool.py 644 /usr/bin/env python3
qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/utils.py 644 /usr/bin/env python3
qcom-ptool.noarch: W: no-manual-page-for-binary qcom-ptool
qcom-ptool.spec: W: no-%check-section
 2 packages and 0 specfiles checked; 5 errors, 4 warnings, 9 filtered, 5 badness; has taken 0.2 s 

These files are importable Python modules located in /usr/lib/python3.xxx/site-packages/qcom_ptool/

Therefore,

  • The shebang (#!/usr/bin/env python3) should be removed
  • Since these files are not intended to be executed directly, they should be installed with 0644 permissions

@lumag

Copy link
Copy Markdown
Contributor

Okay, please turn that into a commit message.

The files under qcom_ptool/ are importable Python modules installed
into /usr/lib/python3.x/site-packages/qcom_ptool/. They are not meant
to be executed directly, so they should carry neither a shebang line
nor executable permissions, and should be installed as 0644.

Keeping the shebangs while packaging the modules non-executable makes rpmlint fail with:

  qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/gen_contents.py 644 /usr/bin/env python3
  qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/gen_partition.py 644 /usr/bin/env python3
  qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/msp.py 644 /usr/bin/env python3
  qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/ptool.py 644 /usr/bin/env python3
  qcom-ptool.noarch: E: non-executable-script /usr/lib/python3.15/site-packages/qcom_ptool/utils.py 644 /usr/bin/env python3

Remove the shebang from gen_contents.py, gen_partition.py, msp.py,
ptool.py and utils.py, and clear their executable bits (100755 ->100644).
Entry points are unaffected: the modules are invoked via the console script wrapper, which imports them.

Signed-off-by: Ali Erdinc Koroglu <ali.koroglu@oss.qualcomm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants