Compare commits

..

2 commits

Author SHA1 Message Date
leafee98 c48987be89 Modify DEBBUILD of remark42
All checks were successful
ci/woodpecker/push/build Pipeline was successful
2023-08-18 20:14:34 +08:00
leafee98 7c6c5fd9e0 Lazy retrieve source when checking package existance
- When existance check is needed, don't download source for non-dynamic
  pkgver packages
- Update makedeb
2023-08-18 20:08:38 +08:00
3 changed files with 32 additions and 12 deletions

@ -1 +1 @@
Subproject commit 9aedecc62e9585ba1d9b88efe083b52105e0947f
Subproject commit 985c0e7a06c90a380f76825f6aedbcf2648629f7

View file

@ -2,7 +2,7 @@
pkgname="remark42"
pkgver=1.12.0
pkgrel=1
pkgrel=2
arch="amd64"
pkgcommit=""
section="utils"
@ -29,6 +29,6 @@ function package {
function debian_postinst {
cat << EOF
touch /etc/default/remark42
useradd --systemd remark42
useradd --system remark42
EOF
}

View file

@ -135,25 +135,45 @@ for package in "${_PACKGES_TO_BUILD[@]}" ; do
msg_info "Start for $package"
cd "$package"
"$MAKEDEB_PATH" --nobuild "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?
if [[ $ret -ne 0 ]] ; then
msg_warn "Error occurred when running makedeb, skip this package"
exit 4
fi
function retrieve_source {
"$MAKEDEB_PATH" --nobuild "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?
if [[ $ret -ne 0 ]] ; then
msg_warn "Error occurred when running makedeb, skip this package"
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
ret=0
msg_info "Checking if package $package_name exists..."
run_hook "$PACKAGE_EXISTS_HOOK" "{}" "$package_name" log_exe_str || ret="$?"
if is_dynamic_pkgver ; then
retrieve_source
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
msg_info "Package ${package_name} already built, skip"
exit 0
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..."
"$MAKEDEB_PATH" --noextract "${MAKEDEB_ARGS[@]}" && ret=$? || ret=$?