Skip to content

Commit

Permalink
verify branch 2017.2.7
Browse files Browse the repository at this point in the history
  • Loading branch information
rubo77 committed Aug 30, 2017
1 parent 9dfed4a commit 7defbaf
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions tests/validate_site.sh
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
#!/bin/bash

# validate_site.sh checks if the site.conf is valid json

GLUON_SITEDIR="." lua5.1 tests/site_config.lua
GLUON_BRANCH='v2016.2.7'

P=$(pwd)
echo "####### validating $P/site.conf ..."
GLUON_SITEDIR="." lua5.1 tests/site_config.lua

echo "validating $P/make-release.sh ..."
echo "####### validating $P/make-release.sh ..."
bash -n $P/make-release.sh

echo "validating $P/modules ..."
echo "####### validating $P/modules ..."
source $P/modules
testpath=/tmp/site-validate
rm -Rf $testpath
Expand All @@ -35,30 +36,38 @@ for feed in $GLUON_SITE_FEEDS; do
echo "branch $branch_var missing"
exit 1
fi
git clone $(echo $repo) $feed
git clone -b "$branch" --single-branch "$repo" $feed
if [ "$?" != "0" ]; then exit 1; fi
cd $feed
git checkout $(echo $branch)
git checkout $(echo $commit)
git checkout "$commit"
if [ "$?" != "0" ]; then exit 1; fi
cd -
done
cd $testpath
git clone https://github.com/freifunk-gluon/gluon
git init gluon
cd gluon
git checkout v2016.2.6
git remote add origin https://github.com/freifunk-gluon/gluon
git config core.sparsecheckout true
echo "package/*" >> .git/info/sparse-checkout
git pull --depth=1 origin $GLUON_BRANCH
cp -a package/ $testpath/packages
cd $testpath/packages/package

echo "validating GLUON_SITE_PACKAGES from $P/site.mk ..."
echo "####### validating GLUON_SITE_PACKAGES from $P/site.mk ..."
# ignore standard packages:
sed '/GLUON_RELEASE/,$d' $P/site.mk | egrep -v '(#|G|iwinfo|iptables|haveged)'> $testpath/site.mk.sh
sed -i 's/\s\\$//g;/^$/d' $testpath/site.mk.sh
# in lede this will be needed:
# sed -i 's/gluon-mesh-batman-adv-1[45]/gluon-mesh-batman-adv/g' $testpath/site.mk.sh
cat $testpath/site.mk.sh |
while read packet; do
echo "check $packet ..."
if [ "$(find $testpath/packages/ -type d -name "$packet")" '!=' '' ]; then
: find found something
else
echo "ERROR: $packet missing"
exit 1
if [ "$packet" != "" ]; then
echo "check $packet ..."
if [ "$(find $testpath/packages/ -type d -name "$packet")" '!=' '' ]; then
: find found something
else
echo "ERROR: $packet missing"
exit 1
fi
fi
done

0 comments on commit 7defbaf

Please sign in to comment.