Lazy retrieve source when checking package existance
- When existance check is needed, don't download source for non-dynamic pkgver packages - Update makedeb
This commit is contained in:
parent
6c1b8792da
commit
7c6c5fd9e0
2
makedeb
2
makedeb
|
@ -1 +1 @@
|
||||||
Subproject commit 9aedecc62e9585ba1d9b88efe083b52105e0947f
|
Subproject commit 985c0e7a06c90a380f76825f6aedbcf2648629f7
|
|
@ -135,25 +135,45 @@ for package in "${_PACKGES_TO_BUILD[@]}" ; do
|
||||||
msg_info "Start for $package"
|
msg_info "Start for $package"
|
||||||
cd "$package"
|
cd "$package"
|
||||||
|
|
||||||
"$MAKEDEB_PATH" --nobuild "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?
|
function retrieve_source {
|
||||||
if [[ $ret -ne 0 ]] ; then
|
"$MAKEDEB_PATH" --nobuild "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?
|
||||||
msg_warn "Error occurred when running makedeb, skip this package"
|
if [[ $ret -ne 0 ]] ; then
|
||||||
exit 4
|
msg_warn "Error occurred when running makedeb, skip this package"
|
||||||
fi
|
exit 4
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
function is_dynamic_pkgver {
|
||||||
|
"$MAKEDEB_PATH" --is-dynamic-pkgver "${MAKEDEB_ARGS[@]}"
|
||||||
|
}
|
||||||
|
|
||||||
package_name="$("$MAKEDEB_PATH" --packagelist "${MAKEDEB_ARGS[@]}")"
|
package_name=""
|
||||||
|
source_ready=0
|
||||||
|
|
||||||
if [[ -n "${PACKAGE_EXISTS_HOOK}" ]] ; then
|
if [[ -n "${PACKAGE_EXISTS_HOOK}" ]] ; then
|
||||||
ret=0
|
if is_dynamic_pkgver ; then
|
||||||
msg_info "Checking if package $package_name exists..."
|
retrieve_source
|
||||||
run_hook "$PACKAGE_EXISTS_HOOK" "{}" "$package_name" log_exe_str || ret="$?"
|
source_ready=1
|
||||||
|
fi
|
||||||
|
|
||||||
|
package_name="$("$MAKEDEB_PATH" --packagelist "${MAKEDEB_ARGS[@]}")"
|
||||||
|
|
||||||
|
msg_info "Checking if package $package_name exists..."
|
||||||
|
|
||||||
|
run_hook "$PACKAGE_EXISTS_HOOK" "{}" "$package_name" log_exe_str && ret="$?" || ret="$?"
|
||||||
if [[ $ret -eq 0 ]] ; then
|
if [[ $ret -eq 0 ]] ; then
|
||||||
msg_info "Package ${package_name} already built, skip"
|
msg_info "Package ${package_name} already built, skip"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if (( ! source_ready )) ; then
|
||||||
|
retrieve_source
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [[ -z "$package_name" ]] ; then
|
||||||
|
package_name="$("$MAKEDEB_PATH" --packagelist "${MAKEDEB_ARGS[@]}")"
|
||||||
|
fi
|
||||||
|
|
||||||
msg_info "Start building..."
|
msg_info "Start building..."
|
||||||
|
|
||||||
"$MAKEDEB_PATH" --noextract "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?
|
"$MAKEDEB_PATH" --noextract "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?
|
||||||
|
|
Loading…
Reference in a new issue