summaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rwxr-xr-xbuild25
1 files changed, 6 insertions, 19 deletions
diff --git a/build b/build
index fdb47947..b28ce954 100755
--- a/build
+++ b/build
@@ -28,7 +28,7 @@ main()
[ $# -lt 1 ] && $err "Check $projectname documentation for help."
spath="script/$1"
- [ "$1" = "dependencies" ] && x_ install_packages $@ && xbmk_exit 0
+ [ "$1" = "dependencies" ] && x_ install_packages $@ && return 0
which git 1>/dev/null 2>/dev/null || \
git_err "git not installed. please install git-scm."
@@ -50,7 +50,6 @@ main()
shift 1; "$spath" $@ || $err "excmd: ${spath} ${@}" ;;
esac
set -u -e # some commands disable them. turn them on!
- xbmk_exit 0
}
install_packages()
@@ -66,13 +65,10 @@ install_packages()
. "config/dependencies/${2}"
- x_ ${pkg_add} ${pkglist}
- [ -z "${aur_notice}" ] && return 0
- printf "You must install AUR packages: %s\n" "$aur_notice" 1>&2
+ x_ $pkg_add $pkglist && [ -n "$aur_notice" ] && \
+ printf "Please install AUR packages: %s\n" "$aur_notice" 1>&2; return 0
}
-# release archives contain .gitignore, but not .git.
-# xbmk can be run from xbmk.git, or an archive.
git_init()
{
[ -L ".git" ] && $err "Reference .git is a symlink"
@@ -125,13 +121,11 @@ build_release()
) || $err "can't create release files"
git log --graph --pretty=format:'%Cred%h%Creset %s %Creset' \
- --abbrev-commit > "${srcdir}/CHANGELOG" || \
- $err "build_release $srcdir: couldn't generate changelog"
+ --abbrev-commit > "${srcdir}/CHANGELOG" || $err "!gitlog $srcdir"
(
cd "${srcdir%/*}" || $err "${_xm}: mktarball \"${srcdir}\""
- mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || \
- $err "$_xm: mksrc"
+ mktarball "${srcdir##*/}" "${srcdir##*/}.tar.xz" || $err "$_xm: mksrc"
) || $err "can't create src tarball"
[ "${mode}" = "src" ] && return 0
@@ -151,22 +145,14 @@ fetch_trees()
for x in $(items config/git); do
./update trees -f "$x" || $err "$_xm: fetch $x"
done
-
for x in config/*/build.list; do
[ -f "$x" ] && xp="${x#*/}" && xp="${xp%/*}"
[ ! -f "$x" ] || [ -L "$xp" ] || x_ rm -Rf "src/$xp/$xp"
done
-
rmgit .
rm -Rf tmp .git src/u-boot/*/test/lib/strlcat.c || $err "$_xm !rm"
}
-xbmk_exit()
-{
- tmp_cleanup || err_ "xbmk_exit: can't rm tmpdir upon exit $1: $tmpdir"
- exit $1
-}
-
fail()
{
tmp_cleanup || printf "WARNING: can't rm tmpdir: %s\n" "$tmpdir" 1>&2
@@ -180,3 +166,4 @@ tmp_cleanup()
}
main $@
+tmp_cleanup || err_ "can't rm tmpdir upon non-zero exit: $tmpdir"