[Pkg-haskell-commits] darcs: tools: Use dose-builddebcheck to avoid attempting builds that will fail
Joachim Breitner
mail at joachim-breitner.de
Fri Oct 19 15:53:34 UTC 2012
Fri Oct 19 15:52:59 UTC 2012 Joachim Breitner <mail at joachim-breitner.de>
* Use dose-builddebcheck to avoid attempting builds that will fail
Ignore-this: 7080804eac6ff3924d5d56d64f9071f3
M ./mass-build.sh -5 +93
Fri Oct 19 15:52:59 UTC 2012 Joachim Breitner <mail at joachim-breitner.de>
* Use dose-builddebcheck to avoid attempting builds that will fail
Ignore-this: 7080804eac6ff3924d5d56d64f9071f3
diff -rN -u old-tools//mass-build.sh new-tools//mass-build.sh
--- old-tools//mass-build.sh 2012-10-19 15:53:34.478755133 +0000
+++ new-tools//mass-build.sh 2012-10-19 15:53:34.494982832 +0000
@@ -101,10 +101,22 @@
tobuild="$($ORDER_SOURCES $tobuild)"
fi
-echo "Starting builds..."
+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)"
+tobuild2=""
for dir in $tobuild
do
- echo "Building $dir..."
if ! pushd "$dir" >/dev/null
then
echo "Failed to switch to \"$dir\""
@@ -113,16 +125,90 @@
repodir=$PWD
popd >/dev/null
- pushd $result >/dev/null
+ if ! pushd "$result" >/dev/null
+ then
+ echo "Failed to switch to $result"
+ exit
+ fi
- dpkg-scanpackages . > Packages
- dpkg-scansources . > Sources
+ PACKAGE=`dpkg-parsechangelog -l$repodir/changelog -c1 | grep-dctrl -n -s Source .`
+ VERSION=`dpkg-parsechangelog -l$repodir/changelog -c1 | grep-dctrl -n -s Version .`
+ DISTRIBUTION=$(dpkg-parsechangelog -l$repodir/changelog -c1 |grep-dctrl -n -s Distribution .)
+ DSC=${PACKAGE}_${VERSION}.dsc
+
+ if ! $DEBIAN2DSC $repodir
+ then
+ echo "Failed to create .dsc for $dir."
+ buildfailed="$buildfailed $dir"
+ popd >/dev/null
+ continue
+ fi
+
+ popd >/dev/null
+
+ if ! pushd "$tmpdir" >/dev/null
+ then
+ echo "Failed to switch to $tmpdir"
+ exit
+ fi
+
+ if ! ln -s "../$DSC"
+ then
+ echo "Failed to link $DSC"
+ buildfailed="$buildfailed $dir"
+ popd >/dev/null
+ continue
+ fi
+
+ tobuild2="$tobuild2 $dir"
+ popd >/dev/null
+done
+
+echo "Checking build-installability..."
+if ! pushd "$tmpdir" >/dev/null
+then
+ echo "Failed to switch to $tmpdir"
+ exit
+fi
+dpkg-scansources . > Sources
+schroot -c $schroot -- bash -c "cat /var/lib/apt/lists/*Packages" > Packages
+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
+do
+ echo "Building $dir..."
+ if ! pushd "$dir" >/dev/null
+ then
+ echo "Failed to switch to \"$dir\""
+ continue
+ fi
+ repodir=$PWD
+ popd >/dev/null
PACKAGE=`dpkg-parsechangelog -l$repodir/changelog -c1 | grep-dctrl -n -s Source .`
VERSION=`dpkg-parsechangelog -l$repodir/changelog -c1 | grep-dctrl -n -s Version .`
DISTRIBUTION=$(dpkg-parsechangelog -l$repodir/changelog -c1 |grep-dctrl -n -s Distribution .)
DSC=${PACKAGE}_${VERSION}.dsc
+ if ! echo $installable | fgrep -wq $dir
+ then
+ echo "Package was found to be uninstallable, skipping.."
+ uninstallable="$uninstallable dir"
+ continue
+ fi
+
+ pushd $result >/dev/null
+
+ dpkg-scanpackages . > Packages
+
if ! $DEBIAN2DSC $repodir
then
echo "Failed to create $DSC."
@@ -174,3 +260,5 @@
echo $buildok
echo "Packages failed to build:"
echo $buildfailed
+echo "Packages not yet buildable:"
+echo $uninstallable
More information about the Pkg-haskell-commits
mailing list