diff options
Diffstat (limited to 'xib.sh')
-rwxr-xr-x | xib.sh | 42 |
1 files changed, 26 insertions, 16 deletions
@@ -12,19 +12,21 @@ priv_key="xi.pem" #buildfiles="$xib_dir/buildfiles" buildfiles="/home/david/docs/proj/xilinux/buildfiles" seen="$xib_dir/seen" +logs="$xib_dir/logs" chroot="$xib_dir/chroot" stage="$xib_dir/stage" +logs="$xib_dir/logs" local_repo="$xib_dir/repo" keychain="$xib_dir/keychain" +quickfail=true + # add a package to the repo's packages.list # publish_package () { - local repo=$1 name=$2 + local repo=$1 xipkgs=$(ls $stage/*.xipkg) - mv $stage/build.log $stage/$name.log - packageslist="$local_repo/$repo/packages.list" depsgraph="$local_repo/deps.graph" [ ! -d "$local_repo/$repo" ] && mkdir -p "$local_repo/$repo" @@ -47,7 +49,7 @@ publish_package () { [ -f $stage/$name.xipkg ] && mv $stage/$name.xipkg $local_repo/$repo/$name.xipkg [ -f $stage/$name.xipkg.info ] && mv $stage/$name.xipkg.info $local_repo/$repo/$name.xipkg.info [ -f $stage/$name.xibuild ] && mv $stage/$name.xibuild $local_repo/$repo/$name.xibuild - [ -f $stage/build.log ] && cp $stage/build.log $local_repo/$repo/$name.log + [ -f $logs/$name.log ] && cp $logs/$name.log $local_repo/$repo/$name.log done [ ! -d "$seen" ] && mkdir -p $seen @@ -85,14 +87,20 @@ build_package () { rm -rf $stage mkdir -p $stage - xibuild -v -k $keychain/$priv_key -C $1 -d $stage -r $chroot || return 1 + + [ ! -d "$logs" ] && mkdir -p $logs + rm -f $logs/$name.log + touch $logs/$name.log + + xibuild -v -l $logs/$name.log -k $keychain/$priv_key -C $1 -d $stage -r $chroot || return 1 get_buildfiles_hash $1 > $stage/$name.xibsum } package_install () { local name=$1 local xipkg=$2 - xipkg -qlny -r $3 install $xipkg && printf "${PASS}${CHECKMARK}\n" || printf "${NEUTRAL}${CHECKMARK}\n" + [ -f $xipkg ] && + xipkg -qlny -r $3 install $xipkg && printf "${PASS}${CHECKMARK}\n" || printf "${NEUTRAL}${CHECKMARK}\n" } # get the direct dependencies of a single package @@ -100,10 +108,7 @@ package_install () { get_deps () { local package=$(get_package_build $1) [ -d $package ] && - for buildfile in $package/*.xibuild; do - sed -rn "s/^.*DEPS=\"(.*)\"/\1/p" $buildfile - done | tr '\n' ' ' - + sed -rn "s/^.*DEPS=\"(.*)\"/\1/p" $package/$1.xibuild } list_deps () { @@ -148,8 +153,8 @@ xib_single () { package=$(get_package_build $name) repo=$(echo "$package" | rev | cut -f2 -d'/' | rev) - build_package $package || return 1 - publish_package $repo $name + build_package $package && + publish_package $repo } xib_all () { @@ -157,15 +162,19 @@ xib_all () { package=$(get_package_build $name) [ "${#package}" != 0 ] && [ -d "$package" ] && { + local package_name="$(basename ${package#/*})" xibsum=$(get_buildfiles_hash $package) - [ -f "$seen/$name.xibsum" ] && [ "$(cat "$seen/$name.xibsum")" = "$xibsum" ] && { - printf "${BLUE}$name${LIGHT_BLUE}...already built!\n" + [ -f "$seen/$package_name.xibsum" ] && [ "$(cat "$seen/$package_name.xibsum")" = "$xibsum" ] && { + printf "${BLUE}$package_name${LIGHT_BLUE}...already built!\n" } || { - xib_single $name + xib_single $name || { + $quickfail && return 0 + } } + true + } || { printf "${RED} could not find package for $name in $package $RESET\n" - return 1 } done } @@ -192,6 +201,7 @@ build_order () { } xibd () { + quickfail=false while true; do cd $buildfiles git pull |