diff options
Diffstat (limited to 'mk')
-rwxr-xr-x | mk | 38 |
1 files changed, 16 insertions, 22 deletions
@@ -163,7 +163,7 @@ trees() return 1 fi - [ -f "config/git/$project/pkg.cfg" ] || $err "'$project' not defined" + x_ e "config/git/$project/pkg.cfg" f for d in "elf" "config/data" "config" "src"; do eval "${d#*/}dir=\"$d/$project\"" @@ -175,7 +175,7 @@ trees() mkhelpercfg="$datadir/mkhelper.cfg" if e "$mkhelpercfg" f missing; then - mkhelpercfg="$TMPDIR/mkhelper.cfg" + mkhelpercfg="$xbmktmp/mkhelper.cfg" x_ touch "$mkhelpercfg" fi @@ -249,10 +249,9 @@ configure_project() xarch xlang badhash`" _tcfg="$1/target.cfg" [ -f "$_tcfg" ] || btype="auto" - [ -f "$datadir/mkhelper.cfg" ] && \ - eval "`setcfg "$datadir/mkhelper.cfg"`" + e "$datadir/mkhelper.cfg" f && eval "`setcfg "$datadir/mkhelper.cfg"`" - while [ -f "$_tcfg" ] || [ "$cmd" != "build_project" ]; do + while e "$_tcfg" f || [ "$cmd" != "build_project" ]; do eval "`setvars "" rev tree`" eval "`setcfg "$_tcfg"`" printf "Loading %s config: %s\n" "$project" "$_tcfg" @@ -293,30 +292,26 @@ build_dependencies() check_project_hashes() { - x_ mkdir -p "$XBMK_CACHE/hash" - old_pjhash="" + old_pjhash="" && x_ mkdir -p "$XBMK_CACHE/hash" [ ! -f "$XBMK_CACHE/hash/$project$tree" ] || \ read -r old_pjhash < "$XBMK_CACHE/hash/$project$tree" - x_ rm -f "$TMPDIR/project.list" "$TMPDIR/project.hash" \ - "$TMPDIR/project.tmp" - x_ touch "$TMPDIR/project.tmp" - x_ touch "$TMPDIR/project.hash" + x_ rm -f "$xbmktmp/project.list" "$xbmktmp/project.hash" \ + "$xbmktmp/project.tmp" + x_ touch "$xbmktmp/project.tmp" "$xbmktmp/project.hash" for rmchk in "$datadir" "$configdir/$tree" "$mdir"; do - [ -d "$rmchk" ] || continue - find "$rmchk" -type f -not -path "*/.git*/*" >> \ - "$TMPDIR/project.tmp" || $err "!find $rmchk > project.tmp" + [ ! -d "$rmchk" ] || find "$rmchk" -type f -not -path \ + "*/.git*/*" >> "$xbmktmp/project.tmp" || $err "!fh $rmchk" done - sort "$TMPDIR/project.tmp" > "$TMPDIR/project.list" || \ - $err "!sort project tmp/list" + sort "$xbmktmp/project.tmp" > "$xbmktmp/project.list" || $err "!pj srt" while read -r rmchk; do [ ! -f "$rmchk" ] || x_ sha512sum "$rmchk" | awk \ - '{print $1}' >> "$TMPDIR/project.hash" || $err "!h $rmchk" - done < "$TMPDIR/project.list" + '{print $1}' >> "$xbmktmp/project.hash" || $err "!h $rmchk" + done < "$xbmktmp/project.list" - pjhash="$(sha512sum "$TMPDIR/project.hash" | awk '{print $1}')" || : + pjhash="$(sha512sum "$xbmktmp/project.hash" | awk '{print $1}')" || : [ "$pjhash" != "$old_pjhash" ] && badhash="y" [ -f "$XBMK_CACHE/hash/$project$tree" ] || badhash="y" @@ -391,9 +386,8 @@ check_gnu_path() rm -f "$XBMK_CACHE/gnupath/"* || $err "Cannot clear gnupath/" cd "$XBMK_CACHE/gnupath" || $err "Can't cd to gnupath/" for _gnubin in "$_gnudir/$2"*"-$_gnuver"; do - [ -e "$_gnubin" ] || continue - _gnuutil="${_gnubin##*/}" - x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}" + _gnuutil="${_gnubin##*/}" && [ -e "$_gnubin" ] && \ + x_ ln -s "$_gnubin" "${_gnuutil%"-$_gnuver"}" done ) || $err "Cannot create $2-$_gnuver link in $_gnudir"; : } |