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

Simple script for remote building of packages...



One of the things that has always driven me crazy about maintaining my
packages for multiple architectures is the PITA associated with
copying stuff around, etc.

To help alleviate this, I've created this rather simple script (with
one incredibly helpful routine taken from James Troup, whose debbuild
script this uses), which, given a .dsc file, will copy all necessary
components to a directory on a remote server you specify, compile the
package, and grab all the resulting binaries, etc., all using ssh and
scp.

The application is obvious: given access to appropriate well-heeled
non-i386 machines, maintainers should be able to easily recompile
their packages without needing additional "architecture" maintainers.

I encourage people to send me suggestions and patches to make this
more robust and/or faster.

Mike.

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

# 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 mkdir ~/$sourcename
	for i in $file $other_files; do
	    echo "Copying $i to buildhost"
	    scp $i $host:~/$sourcename
	done
	echo "Building"
	ssh $host "cd ~/$sourcename && ~/bin/debbuild $file"
	echo "Retrieving binaries"
	scp $host:~/$sourcename/*.{deb,changes} .
	;;
    *)
        echo "Not a .changes file!"
	;;
    esac
done
---->8----


--  
To UNSUBSCRIBE, email to debian-devel-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org


Reply to: