summaryrefslogtreecommitdiff
path: root/meta/classes/oelint.bbclass
blob: d14e3783f3d1769ece5e5fb7de0c073b35604b1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
addtask lint before do_fetch
do_lint[nostamp] = "1"
python do_lint() {
    pkgname = d.getVar("PN", True)

    ##############################
    # Test that DESCRIPTION exists
    #
    description = d.getVar("DESCRIPTION")
    if description[1:10] == '{SUMMARY}':
        bb.warn("%s: DESCRIPTION is not set" % pkgname)


    ##############################
    # Test that HOMEPAGE exists
    #
    homepage = d.getVar("HOMEPAGE")
    if homepage == '':
        bb.warn("%s: HOMEPAGE is not set" % pkgname)
    elif not homepage.startswith("http://") and not homepage.startswith("https://"):
        bb.warn("%s: HOMEPAGE doesn't start with http:// or https://" % pkgname)


    ##############################
    # Test for valid SECTION
    #
    section = d.getVar("SECTION")
    if section == '':
        bb.warn("%s: SECTION is not set" % pkgname)
    elif not section.islower():
        bb.warn("%s: SECTION should only use lower case" % pkgname)
}