mirror of
https://github.com/yann64/haikuports.git
synced 2026-04-22 11:40:06 +02:00
Merge pull request #261 from waddlesplash/travis_ci
Lint recipes on Travis-CI on each PR.
This commit is contained in:
1
.gitattributes
vendored
Normal file
1
.gitattributes
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*.recipe linguist-language=Shell
|
||||
11
.travis.yml
Normal file
11
.travis.yml
Normal file
@@ -0,0 +1,11 @@
|
||||
language: python
|
||||
python: "2.7"
|
||||
install:
|
||||
- cd ..
|
||||
- git clone https://github.com/haikuports/haikuporter.git --depth=1
|
||||
- cd haikuports
|
||||
- PATH=$PATH:../haikuporter && export PATH
|
||||
- printf 'TREE_PATH="'`pwd`'"\nPACKAGER="Nobody <server@fake>"\nTARGET_ARCHITECTURE="x86"\n' >haikuports.conf
|
||||
- wget https://github.com/waddlesplash/haiku-licenses/archive/master.zip && unzip master.zip
|
||||
script:
|
||||
- ./lint-new-recipes.sh --config=haikuports.conf --licenses=haiku-licenses-master
|
||||
14
lint-new-recipes.sh
Executable file
14
lint-new-recipes.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/bin/bash
|
||||
# Lints all the recipes created / modified since upstream HEAD.
|
||||
git remote add real_origin https://github.com/haikuports/haikuports.git || true
|
||||
git fetch real_origin
|
||||
|
||||
files=$(git diff $(git rev-parse --abbrev-ref HEAD) real_origin/master --numstat | awk '{print $3}')
|
||||
for file in $files; do
|
||||
if [ -e "$file" ] && [[ "$file" == *recipe ]]; then
|
||||
baseName=$(basename $file)
|
||||
portName=${baseName::-7}
|
||||
haikuporter $@ --lint $portName
|
||||
if [ $? -ne 0 ]; then exit 1; fi
|
||||
fi
|
||||
done
|
||||
Reference in New Issue
Block a user