Skip to content

Commit

Permalink
few changes/fixes:
Browse files Browse the repository at this point in the history
- chage sh -> bash
- run all hooks with set -e
- test for empty parameters (build.search_source_branch)
  • Loading branch information
mk01 committed Sep 22, 2015
1 parent 18a5c67 commit a3ee5c7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions build.search_source_branch
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ search()
| xargs -L1 -I{} sh -c 'echo $(basename $(dirname {}))'
) }

[ -n "$1" ] || exit 0
[ -n "$2" ] || exit 0

## $1 = project, package to build
## $2 = source_branch to search for

Expand Down
2 changes: 1 addition & 1 deletion common.functions
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ do_hooks()
cd "$XBIANARCHDIR/working"
[ -n "$2" ] && rexp $XBIANPKGDIR/$2
echo "### Running hook $f from $1 ###"
do_run $preloader sh +e $XBIANPKGDIR/hooks.d/$1/$f
do_run $preloader $SHELL -e $XBIANPKGDIR/hooks.d/$1/$f
[ $? -ne 0 ] && res=FAILED || res=OK
echo "### Running hook $f from $1 finished $res ###"
)
Expand Down
7 changes: 7 additions & 0 deletions gen.package
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
##
##

if [ -e $XBIANROOT/common.functions ]; then
. $XBIANROOT/common.functions
else
echo "Wrong setup. Open folder containing xbianonpi/xbian clone and rerun \"./run.me prepare\""
exit 500
fi

rm_size() {
[ -n "$1" ] && dir="$1" || dir=content
cat ./$dir/DEBIAN/control | grep -v "Installed-Size:" > ./$dir/DEBIAN/control.new
Expand Down
3 changes: 2 additions & 1 deletion run.me
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ set -e
##
##

export SHELL=/bin/bash
[ -n "$SHELL" ] || export SHELL=sh

if [ "$1" = prepare ]; then
Expand Down Expand Up @@ -49,7 +50,7 @@ if [ -e ./build/config ]; then
config_wrapper=$(grep config_wrapper ./build/config | awk -F'=' '{print $2}')
[ -e build.log ] && mv build.log build.old.log
echo "started at $(date)" > build.log
$SHELL -eE $XBIANROOT/$config_wrapper $* | tee -a build.log
$SHELL -eE $XBIANROOT/$config_wrapper $* 2>&1 | tee -a build.log
else
echo "it doesn't seem we are inside build configuration directory!"
exit 100
Expand Down

0 comments on commit a3ee5c7

Please sign in to comment.