wok-6.x diff cookutils/stuff/pkgdb-no-parallel.patch @ rev 21085
updated john again (1.7.8 -> 1.8.0)
author | Hans-G?nter Theisgen |
---|---|
date | Fri Mar 15 14:47:39 2019 +0100 (2019-03-15) |
parents | |
children | bde99f8d4916 |
line diff
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/cookutils/stuff/pkgdb-no-parallel.patch Fri Mar 15 14:47:39 2019 +0100 1.3 @@ -0,0 +1,64 @@ 1.4 +Parallel execution of pkgdb detected on cooking host. 1.5 +It is necessary to avoid this, as it leads to incorrect databases. 1.6 + 1.7 +--- a/modules/pkgdb 1.8 ++++ b/modules/pkgdb 1.9 +@@ -22,7 +22,15 @@ 1.10 + 1.11 + 1.12 + 1.13 ++# Avoid parallel execution 1.14 + 1.15 ++BLOCK=$PKGS/pkgdb.block 1.16 ++if [ -e "$BLOCK" ]; then 1.17 ++ echo "pkgdb already executed - exiting now" | dblog 1.18 ++ exit 1 1.19 ++fi 1.20 ++touch $BLOCK 1.21 ++ 1.22 + # Create suitable packages list for TazPkg and only for built packages 1.23 + # as well as flavors files for TazLiTo. We don't need logs since we do it 1.24 + # manually to ensure everything is fine before syncing the mirror. 1.25 +@@ -35,6 +43,7 @@ 1.26 + [ -n "$1" ] && PKGS="$1" 1.27 + if [ ! -d "$PKGS" ]; then 1.28 + { newline; _ "Packages directory \"%s\" doesn't exist" "$PKGS"; newline; } | dblog 1.29 ++ rm $BLOCK 1.30 + exit 1 1.31 + fi ;; 1.32 + esac 1.33 +@@ -212,10 +221,14 @@ 1.34 + # Create all flavors files at once. Do we really need code to monitor 1.35 + # flavors changes? Let's just build them with packages lists before 1.36 + # syncing the mirror. 1.37 +-[ "$1" != '--flavors' ] && exit 1 1.38 ++if [ "$1" != '--flavors' ]; then 1.39 ++ rm $BLOCK 1.40 ++ exit 1 1.41 ++fi 1.42 + 1.43 + if [ ! -d "$flavors" ]; then 1.44 + { _ 'Missing flavors folder "%s"' "$flavors"; newline; } | dblog 1.45 ++ rm $BLOCK 1.46 + exit 1 1.47 + fi 1.48 + 1.49 +@@ -246,7 +259,10 @@ 1.50 + for i in $flavors/*; do 1.51 + fl=$(basename $i) 1.52 + _ 'Packing flavor "%s"' "$fl" | dblog 1.53 +- tazlito pack-flavor $fl >/dev/null || exit 1 1.54 ++ if ! tazlito pack-flavor $fl >/dev/null; then 1.55 ++ rm $BLOCK 1.56 ++ exit 1 1.57 ++ fi 1.58 + tazlito show-flavor $fl --brief --noheader 2>/dev/null >> flavors.list 1.59 + done 1.60 + cp -f $live/*.flavor $live/flavors.list $PKGS 1.61 +@@ -257,5 +273,5 @@ 1.62 + 1.63 + > $command 1.64 + 1.65 +- 1.66 ++rm $BLOCK 1.67 + exit 0