• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/utils/checkpackagelib/lib_mk.py
Ricardo MartincoskiRicardo Martincoski committed 29d9f2f014402 Dec 2017
Raw file
Source viewDiff to previous
        if self.DEFAULT_AUTOTOOLS_FLAG.search(text) and not text.lstrip().startswith("HOST_"):
 
1
# See utils/checkpackagelib/readme.txt before editing this file.
2
# There are already dependency checks during the build, so below check
3
# functions don't need to check for things already checked by exploring the
4
# menu options using "make menuconfig" and by running "make" with appropriate
5
# packages enabled.
6
​
7
import re
8
​
9
from base import _CheckFunction
10
# Notice: ignore 'imported but unused' from pyflakes for check functions.
11
from lib import ConsecutiveEmptyLines
12
from lib import EmptyLastLine
13
from lib import NewlineAtEof
14
from lib import TrailingSpace
15
​
16
​
17
class Indent(_CheckFunction):
18
    COMMENT = re.compile("^\s*#")
19
    CONDITIONAL = re.compile("^\s*(ifeq|ifneq|endif)\s")
20
    ENDS_WITH_BACKSLASH = re.compile(r"^[^#].*\\$")
21
    END_DEFINE = re.compile("^\s*endef\s")
22
    MAKEFILE_TARGET = re.compile("^[^# \t]+:\s")
23
    START_DEFINE = re.compile("^\s*define\s")
24
​
25
    def before(self):
26
        self.define = False
27
        self.backslash = False
28
        self.makefile_target = False
29
​
30
    def check_line(self, lineno, text):
31
        if self.START_DEFINE.search(text):
32
            self.define = True
33
            return
34
        if self.END_DEFINE.search(text):
35
            self.define = False
36
            return
37
​
38
        expect_tabs = False
39
        if self.define or self.backslash or self.makefile_target:
40
            expect_tabs = True
41
        if self.CONDITIONAL.search(text):
42
            expect_tabs = False
43
​
44
        # calculate for next line
45
        if self.ENDS_WITH_BACKSLASH.search(text):
46
            self.backslash = True
47
        else:
48
            self.backslash = False
49
​
50
        if self.MAKEFILE_TARGET.search(text):
51
            self.makefile_target = True
52
            return
53
        if text.strip() == "":
54
            self.makefile_target = False
55
            return
56
​
57
        # comment can be indented or not inside define ... endef, so ignore it
58
        if self.define and self.COMMENT.search(text):
59
            return
60
​
61
        if expect_tabs:
62
            if not text.startswith("\t"):
63
                return ["{}:{}: expected indent with tabs"
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.