Bugfix: Make sure buildroot apt update and building stuff can't happen at the same...
authorDaniel Abrecht <public@danielabrecht.ch>
Sat, 14 May 2022 23:12:51 +0000 (01:12 +0200)
committerDaniel Abrecht <public@danielabrecht.ch>
Sat, 14 May 2022 23:12:51 +0000 (01:12 +0200)
chroot-build-helper/real-makefile
script/chns

index 54f61286c1fa65d5a4cd0ebdac127f5ead44afbc..38de510ebe58ec9007f67521f639069dfdd3cf11 100644 (file)
@@ -79,7 +79,7 @@ bin/$(BUILDER_PLATFORM)/$(DISTRO)/$(RELEASE)/%/.build: $$(call repodir,%) build-
        export commit=\"\$$(cd build/src/ && git rev-parse HEAD)\$$([ -z \"\$$(cd build/src/ && git status --porcelain)\" ] || echo -dirty)\"; \
        export version=\"\$$(cd build/src/ && dpkg-parsechangelog --show-field Version | grep -o '^[^+~-]*' | tr -d '\n')+ib~c\$$(cd build/src/ && git rev-list HEAD --count)-\$$commit\"; \
        " \
-       chns "build-env/$(DISTRO)/$(RELEASE)/rootfs/" sh -ex -c "\
+       DO_LOCK=3 chns "build-env/$(DISTRO)/$(RELEASE)/rootfs/" sh -ex -c "\
          if [ \"\$$USE_IMAGE_BUILDER_REPO\" = yes ] && [ \"\$$DONT_BUILD_IF_IN_REPO\" = yes ] && [ -n \"\$$IMAGE_BUILDER_REPO\" ] && [ -n \"\$$IMAGE_BUILDER_REPO_KEY\" ]; \
          then \
            wget -O- \"\$$IMAGE_BUILDER_REPO_KEY\" | apt-key add -; \
index 84f16d7a302f0dd3a06c7acc674eeb2015d42d8b..0b7f4b3c50861206139d76a14df4d8f8c076cd7a 100755 (executable)
@@ -64,10 +64,11 @@ trap true HUP
 if [ -n "$DO_LOCK" ]
 then
   exec 57<.
-  if [ "$DO_LOCK" = 2 ]
-    then flock -n 57
-    else flock 57
-  fi
+  case "$DO_LOCK" in
+    2) flock -n 57 ;;
+    3) flock -s 57 ;;
+    *) flock 57 ;;
+  esac
 fi
 unset DO_LOCK