Ubuntu Pastebin

Paste from Francis Ginther at Tue, 27 Jan 2015 14:22:19 +0000

Download as text
 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
33
34
35
36
#!/bin/bash -e

# We cannot use whole build_result_path_logic in A-hooks as the build and the
# result directories do not necessesarily exist yet. We only need the WORK dir
# in A-hooks anyways, so lets do that part on our own.

# WORK_DIR contains the root of the package, debian must be a sub-dir
if [ -z "$WORK_DIR" ]; then
    WORK_DIR=$(readlink -f /tmp/buildd/*/debian/..)
    if ! [ -d "$WORK_DIR" ]; then
        WORK_DIR=""
    fi
fi
test -d "$WORK_DIR"

cd $WORK_DIR

# Make sure devscripts is installed
apt-get install --yes devscripts


includefiles="\.(c(c|pp|xx)?|h(h|pp|xx)?|p(l|m)|php|py(|x)|java|js|vala|qml)$"
excludedirs="3rd_party"
allowedlicenses="(Canonical|Android|Google|Digia)"

issuescount=`licensecheck --noconf -r * --copyright -m -c $includefiles -i $excludedirs | egrep -v $allowedlicenses | wc -l`

if [ $issuescount -eq 0 ]; then
    echo No license problems found.
    exit 0
else
    echo Found $issuescount license problems:
    # Run it a second time to print a nice list of issues
    licensecheck --noconf -r * --copyright -m -c $includefiles -i $excludedirs | egrep -v $allowedlicenses
    exit 1
fi
Download as text