# HG changeset patch # User Aleksej Bobylev # Date 1547900289 -7200 # Node ID a18d2c96de515be35177cbc79c438eb015091696 # Parent 35f179a3bcbc897797b5d4d7731bda74de567ae6 cookutils: patch to avoid parallel execution of pkgdb diff -r 35f179a3bcbc -r a18d2c96de51 cookutils/receipt --- a/cookutils/receipt Sat Jan 19 13:41:36 2019 +0200 +++ b/cookutils/receipt Sat Jan 19 14:18:09 2019 +0200 @@ -21,6 +21,7 @@ { sed -i 's|\. receipt|. ./receipt|' cook patch -p1 -i $stuff/pkgdb-absolute.patch + patch -p1 -i $stuff/pkgdb-no-parallel.patch mkdir -p $DESTDIR/usr/bin $DESTDIR/etc/slitaz make DESTDIR=$DESTDIR install } diff -r 35f179a3bcbc -r a18d2c96de51 cookutils/stuff/pkgdb-no-parallel.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/cookutils/stuff/pkgdb-no-parallel.patch Sat Jan 19 14:18:09 2019 +0200 @@ -0,0 +1,64 @@ +Parallel execution of pkgdb detected on cooking host. +It is necessary to avoid this, as it leads to incorrect databases. + +--- a/modules/pkgdb ++++ b/modules/pkgdb +@@ -22,7 +22,15 @@ + + + ++# Avoid parallel execution + ++BLOCK=$PKGS/pkgdb.block ++if [ -e "$BLOCK" ]; then ++ echo "pkgdb already executed - exiting now" | dblog ++ exit 1 ++fi ++touch $BLOCK ++ + # Create suitable packages list for TazPkg and only for built packages + # as well as flavors files for TazLiTo. We don't need logs since we do it + # manually to ensure everything is fine before syncing the mirror. +@@ -35,6 +43,7 @@ + [ -n "$1" ] && PKGS="$1" + if [ ! -d "$PKGS" ]; then + { newline; _ "Packages directory \"%s\" doesn't exist" "$PKGS"; newline; } | dblog ++ rm $BLOCK + exit 1 + fi ;; + esac +@@ -212,10 +221,14 @@ + # Create all flavors files at once. Do we really need code to monitor + # flavors changes? Let's just build them with packages lists before + # syncing the mirror. +-[ "$1" != '--flavors' ] && exit 1 ++if [ "$1" != '--flavors' ]; then ++ rm $BLOCK ++ exit 1 ++fi + + if [ ! -d "$flavors" ]; then + { _ 'Missing flavors folder "%s"' "$flavors"; newline; } | dblog ++ rm $BLOCK + exit 1 + fi + +@@ -246,7 +259,10 @@ + for i in $flavors/*; do + fl=$(basename $i) + _ 'Packing flavor "%s"' "$fl" | dblog +- tazlito pack-flavor $fl >/dev/null || exit 1 ++ if ! tazlito pack-flavor $fl >/dev/null; then ++ rm $BLOCK ++ exit 1 ++ fi + tazlito show-flavor $fl --brief --noheader 2>/dev/null >> flavors.list + done + cp -f $live/*.flavor $live/flavors.list $PKGS +@@ -257,5 +273,5 @@ + + > $command + +- ++rm $BLOCK + exit 0