summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2022-11-11 09:32:24 +0100
committerMichael Olbrich <m.olbrich@pengutronix.de>2022-11-11 14:26:40 +0100
commitc71efc375cfed88cf686413bb3ce79e699e8e5dd (patch)
tree825608e65fdf9d9c67d520f52cd7504da27b1e06
parent448d9beaae484d35753b4a2689b32174fb791a7c (diff)
downloadptxdist-c71efc375cfed88cf686413bb3ce79e699e8e5dd.tar.gz
ptxdist-c71efc375cfed88cf686413bb3ce79e699e8e5dd.tar.xz
ptxd_make_xpkg_pkg: only use flock when its actually needed
It's only necessary if packages are installed in parallel and skiping locking can save quite a bit of time during targetinstall for large packages. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
-rw-r--r--scripts/lib/ptxd_make_xpkg_pkg.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/scripts/lib/ptxd_make_xpkg_pkg.sh b/scripts/lib/ptxd_make_xpkg_pkg.sh
index 9e5288418..a683243dc 100644
--- a/scripts/lib/ptxd_make_xpkg_pkg.sh
+++ b/scripts/lib/ptxd_make_xpkg_pkg.sh
@@ -131,6 +131,11 @@ export -f ptxd_install_setup_global
ptxd_install_lock() {
local lockfile
+ # locking is only needed if packages are built in parallel
+ if [ "${PTXDIST_PARALLELMFLAGS_EXTERN}" = "-j1" ]; then
+ return
+ fi
+
if [ -n "${dst}" ]; then
lockfile="${PTXDIST_TEMPDIR}/locks/${dst//\//-}"
else
@@ -147,6 +152,10 @@ export -f ptxd_install_lock
ptxd_install_unlock() {
local ret=$?
+ if [ "${PTXDIST_PARALLELMFLAGS_EXTERN}" = "-j1" ]; then
+ return "${ret}"
+ fi
+
if [ -z "${dst_lock}" ]; then
ptxd_bailout "dst_lock must be set when ptxd_install_unlock() is called"
fi