[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Make and globbing (alpha)



Jason Gunthorpe <jgg@gpu.srv.ualberta.ca> writes:
> Okay, are you guys going to be using faure for compiling as well or would
> you like me to encourage other developers to at least check their builds
> on faure once in a bit or what? We now have the entire archive push
> mirrored and NFS mounted..

I use the following script all the time to do builds of my packages on
i386 (I use the alpha as my primary architecture).  After I've
compiled on the alpha (with -uc passed to dpkg-buildpackage so that it
doesn't sign the changes file) I simply do:

remotebuild vega whatever.dsc

This goes out and tries to build the package for me on my i386 box.
If it succeeds, it grabs the resulting deb's and the .changes file.

It works here quite well.  It could be smarter, of course---a lot
smarter in fact.  Enhancements I can think of right offhand would be
for it to 1) clean up after itself and 2) grab the .messages file if
the build fails.

Do people think it's worthwhile for me to enhance it?  Even make a
package out of it, so that its easy for people to install?

Mike.

-----8<-----
#!/bin/sh -e

builddir=/usr/local/src/rebuild

# Get the hostname as the first argument
host=$1; shift

# Shamelessly stolen from James Troup
parsedsc() {
        awk '/^Files: / { files=1; next }
             files && /^ / && NF == 3 { print $3 }
             files && !(/^ / && NF == 3) { files=0 }' "$1"
}

sourcedsc() {
         "$1"
}

for file in $*; do
    case "$file" in
    *.dsc)
	sourcename=`awk '/^Source: / { print $2 }' $file`
	other_files=$(parsedsc "$file")
	echo "Creating build directory"
	ssh $host test -e $builddir || mkdir $builddir
	for i in $file $other_files; do
	    echo "Copying $i to buildhost"
	    scp $i $host:$builddir
	done
	echo "Building"
	ssh $host "cd $builddir && dbuild -s --no-signature-checks $file"
	echo "Retrieving binaries"
	scp $host:$builddir/OK/*.{deb,changes} .
	;;
    *)
        echo "Not a .changes file!"
	;;
    esac
done
----->8-----


Reply to: