Skip to content

Commit 55acd9e

Browse files
authored
[python3]: add dpkg_lock in python3 build (#285)
1 parent e5616f2 commit 55acd9e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

src/python3/Makefile

+9-3
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,16 @@ $(addprefix $(DEST)/, $(MAIN_TARGET)): $(DEST)/% :
2323
## Build
2424
dpkg-source -x $(PYTHON_PNAME)_$(PYTHON_VER)-$(PYTHON_DEB_VER).dsc
2525
pushd $(PYTHON_PNAME)-$(PYTHON_VER)
26-
sudo apt-get install devscripts
2726
mk-build-deps
28-
sudo dpkg -i $(PYTHON_PNAME)-build-deps_$(PYTHON_VER)-$(PYTHON_DEB_VER)_amd64.deb || sudo apt-get install -f
29-
dpkg-buildpackage -us -uc -b
27+
28+
# put a lock here because dpkg does not allow installing packages in parallel
29+
while true; do
30+
if mkdir $(DEST)/dpkg_lock &> /dev/null; then
31+
{ echo here && (sudo dpkg -i $(PYTHON_PNAME)-build-deps_$(PYTHON_VER)-$(PYTHON_DEB_VER)_amd64.deb || sudo apt-get install -f) && rm -d $(DEST)/dpkg_lock && break; } || { rm -d $(DEST)/dpkg_lock && exit 1 ; }
32+
fi
33+
done
34+
35+
dpkg-buildpackage -rfakeroot -us -uc -b
3036
popd
3137

3238
cp $(DERIVED_TARGETS) $* $(DEST)/

0 commit comments

Comments
 (0)