[Pkg-haskell-commits] darcs: tools: Make mass-build able to build chains of packages

Joachim Breitner mail at joachim-breitner.de
Sun Oct 21 13:57:15 UTC 2012


Sun Oct 21 13:54:38 UTC 2012  Joachim Breitner <mail at joachim-breitner.de>
  * Make mass-build able to build chains of packages
  Ignore-this: 2670a18323d483d736ca3a7a8ec57839

    M ./mass-build.sh -18 +33

Sun Oct 21 13:54:38 UTC 2012  Joachim Breitner <mail at joachim-breitner.de>
  * Make mass-build able to build chains of packages
  Ignore-this: 2670a18323d483d736ca3a7a8ec57839
diff -rN -u old-tools//mass-build.sh new-tools//mass-build.sh
--- old-tools//mass-build.sh	2012-10-21 13:57:15.103172298 +0000
+++ new-tools//mass-build.sh	2012-10-21 13:57:15.110254794 +0000
@@ -101,16 +101,6 @@
 	tobuild="$($ORDER_SOURCES $tobuild)"
 fi
 
-echo "Updateing Packages"
-if ! pushd "$result" >/dev/null
-then
-	echo "Failed to switch to $result"
-	exit
-fi
-dpkg-scanpackages . > Packages
-sudo sbuild-update --update --upgrade $schroot
-popd >/dev/null
-
 
 echo "Creating source packages..."
 tmpdir="$(mktemp -d --tmpdir=$result mass-build-XXXXX)"
@@ -165,10 +155,30 @@
 		continue
 	fi
 
-	tobuild2="$tobuild2 $dir"
+	nextround="$nextround $dir"
 	popd >/dev/null
 done
 
+retry=yes
+
+while [ "$retry" = yes ]
+do
+
+retry=no
+thisround="$nextround"
+nextround=""
+
+echo "Updateing Packages"
+if ! pushd "$result" >/dev/null
+then
+	echo "Failed to switch to $result"
+	exit
+fi
+dpkg-scanpackages . > Packages
+sudo sbuild-update --update --upgrade $schroot
+popd >/dev/null
+
+
 echo "Checking build-installability..."
 if ! pushd "$tmpdir" >/dev/null
 then
@@ -180,14 +190,11 @@
 installable=$(dose-builddebcheck -s --deb-native-arch=amd64 Packages Sources|perl -ne 'print "$1\n" if /package: src%3a(.*)/')
 popd >/dev/null
 
-rm -rf "$tmpdir"
-
-
 #echo "The following $(echo $uninstallable|wc -w) packages are uninstallable:"
 #echo $uninstallable
 
 echo "Starting builds..."
-for dir in $tobuild2
+for dir in $thisround
 do
 	echo "Building $dir..."
 	if ! pushd "$dir" >/dev/null
@@ -208,10 +215,10 @@
 	DISTRIBUTION=$(dpkg-parsechangelog -l$repodir/changelog -c1 |grep-dctrl -n -s Distribution .)
 	DSC=${PACKAGE}_${VERSION}.dsc
 
-	if ! echo $installable | fgrep -wq $dir
+	if ! echo $installable | fgrep -wq "$PACKAGE"
 	then
 		echo "Package was found to be uninstallable, skipping.."
-		uninstallable="$uninstallable $dir"
+		nextround="$nextround $dir"
 		continue
 	fi
 
@@ -254,6 +261,7 @@
 		debcommit -r
 		popd >/dev/null
 		echo "Building $dir was successful"
+		retry=yes
 	else
 		#rm -f setup.sh
 		buildfailed="$buildfailed $dir"
@@ -264,11 +272,18 @@
 			echo "Reverting release marker."
 			darcs revert -a
 		fi
+		if darcs diff|diffstat|tail -n1|fgrep -q '1 file changed, 1 insertion(+), 1 deletion(-)'
+		then
+			echo "Reverting release marker."
+			darcs revert -a
+		fi
 		popd >/dev/null
 		echo "Building $dir failed"
 	fi
 done
 
+done
+rm -rf "$tmpdir"
 
 echo "Summary:"
 echo "Packages not to build:"
@@ -276,7 +291,7 @@
 echo "Packages already released:"
 echo $released
 echo "Packages not yet buildable:"
-echo $uninstallable
+echo $nextround
 echo "Packages successfully build:"
 echo $buildok
 echo "Packages failed to build:"





More information about the Pkg-haskell-commits mailing list