update/project/trees: general code cleanup
reduced sloccount, without reducing functionality Signed-off-by: Leah Rowe <leah@libreboot.org>btrfsvols
parent
bcbd3734b3
commit
cd2caecb73
|
@ -42,16 +42,12 @@ download_for_target()
|
||||||
x_ fetch_config "${_target}"
|
x_ fetch_config "${_target}"
|
||||||
|
|
||||||
if [ -d "${project}/${tree}" ]; then
|
if [ -d "${project}/${tree}" ]; then
|
||||||
printf "REMARK: download/%s %s: exists. Skipping.\n" \
|
printf "REMARK: download/%s %s (%s): exists. Skipping.\n" \
|
||||||
"${project}" "${tree}" 1>&2
|
"${project}" "${tree}" "${_target}" 1>&2
|
||||||
[ "${tree}" != "${_target}" ] && \
|
else
|
||||||
printf "(for target: '%s}')\n" "${_target}" 1>&2
|
x_ fetch_from_upstream "${project}"
|
||||||
return 0
|
x_ prepare_new_tree "${_target}" "${tree}" "${rev}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
fetch_from_upstream || \
|
|
||||||
err "download_for_target: cannot fetch: ${project}"
|
|
||||||
x_ prepare_new_tree "${_target}" "${tree}" "${rev}"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fetch_config()
|
fetch_config()
|
||||||
|
@ -111,11 +107,11 @@ check_config_for_target()
|
||||||
|
|
||||||
fetch_from_upstream()
|
fetch_from_upstream()
|
||||||
{
|
{
|
||||||
[ -d "${project}" ] || mkdir -p "${project}" || return 1
|
[ -d "${1}" ] || mkdir -p "${1}" || return 1
|
||||||
[ -d "${project}" ] || return 1
|
[ -d "${1}" ] || return 1
|
||||||
[ -d "${project}/${project}" ] && return 0
|
[ -d "${1}/${1}" ] && return 0
|
||||||
|
|
||||||
./update project repo ${project} || return 1
|
./update project repo ${1} || return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
prepare_new_tree()
|
prepare_new_tree()
|
||||||
|
@ -124,19 +120,15 @@ prepare_new_tree()
|
||||||
tree=${2}
|
tree=${2}
|
||||||
rev=${3}
|
rev=${3}
|
||||||
|
|
||||||
printf "Preparing %s tree: %s\n" ${project} ${tree}
|
printf "Preparing %s tree %s (%s)\n" "${project}" "${tree}" "${target}"
|
||||||
[ "${tree}" != "${target}" ] && \
|
|
||||||
printf "(for target, %s)\n" "${target}"
|
|
||||||
|
|
||||||
x_ cp -R "${project}/${project}" "${project}/${tree}"
|
x_ cp -R "${project}/${project}" "${project}/${tree}"
|
||||||
x_ git_reset_rev "${project}/${tree}" "${rev}" "err"
|
x_ git_reset_rev "${project}/${tree}" "${rev}" "err"
|
||||||
|
|
||||||
(
|
(
|
||||||
x_ cd "${project}/${tree}"
|
x_ cd "${project}/${tree}"
|
||||||
git submodule update --init --checkout || \
|
git submodule update --init --checkout || \
|
||||||
err "prepare_new_tree ${project}/${tree}: can't update git modules"
|
err "prepare_new_tree ${project}/${tree}: can't update git modules"
|
||||||
)
|
)
|
||||||
|
|
||||||
x_ git_am_patches "${PWD}/${project}/${tree}" \
|
x_ git_am_patches "${PWD}/${project}/${tree}" \
|
||||||
"${PWD}/${cfgsdir}/${tree}/patches" "err"
|
"${PWD}/${cfgsdir}/${tree}/patches" "err"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue