Baruch Even's Blog

I have no subtitle...

Quilt-Compile-All
18th April 2005

I'm using quilt to maintain my kernel patches, and it's nice and dandy, but sometimes you need to validate that all your patches are applying and the kernel compiles at all stages, Enter quilt-compile-all script:

#!/bin/bash
set +e
function die {
	echo "$1"
	exit 1
}

[ -d patches ] || die "Are you in a quilt managed directory?"

quilt pop -a
[ $? -ne 2 ] && die "Quilt pop -a failed."
make clean
[ $? -ne 0 ] && die "Make clean failed."
make -j2
[ $? -ne 0 ] && "Initial make failed."

while [ "$(quilt unapplied)" != "" ]; do
	quilt push
	[ $? -ne 0 ] && die "Quilt failed."
	
	make -j2
	[ $? -ne 0 ] && "Make failed."
done

echo "Compilation succeeded."
exit 0

Created by Chronicle v4.4