File: debian-rules-not-executable.py

package info (click to toggle)
lintian-brush 0.147
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,872 kB
  • sloc: python: 17,649; makefile: 814; sh: 140; xml: 119; javascript: 3; ansic: 2
file content (18 lines) | stat: -rwxr-xr-x 430 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/python3
import os

from lintian_brush.fixer import report_result, LintianIssue

try:
    st = os.stat('debian/rules')
except FileNotFoundError:
    pass
else:
    if not (st.st_mode & 0o111):
        issue = LintianIssue('source', 'debian-rules-not-executable')
        if issue.should_fix():
            os.chmod('debian/rules', 0o755)
            issue.report_fixed()


report_result('Make debian/rules executable.')