From 76135128a604beda88ed4b38f40f36562a15ad4d Mon Sep 17 00:00:00 2001 From: Romain Perier Date: Sat, 22 Aug 2009 09:48:47 +0200 Subject: scripts/gamerlay-review: To script to synchronize "devel" and "stable" branch (experimental) --- scripts/gamerlay-review | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100755 scripts/gamerlay-review (limited to 'scripts') diff --git a/scripts/gamerlay-review b/scripts/gamerlay-review new file mode 100755 index 0000000..c3d19d2 --- /dev/null +++ b/scripts/gamerlay-review @@ -0,0 +1,51 @@ +#!/bin/sh +# Copyright 1999-2009 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# gamerlay-review - Automates the Gentoo GamerLay Overlay commit process +# Released into the public domain. + +. /etc/init.d/functions.sh + +tmpdir="/tmp/$(basename ${0}).$$" +patchset=${tmpdir}/gamerlay-patchset.patch +review_msg="Reviewed up $(date "+%Y/%m/%d %H:%M")" +have_binaries="" +exclude_list="" + +die() { + eerror $1 + exit 1 +} + + +test -d ${tmpdir} || mkdir ${tmpdir} +git diff --patch-with-stat --full-index master > ${patchset} \ + || die "Diff between devel and stable branches failed" + +for file in $(ls -d *-*/*/files/* 2>/dev/null); do + # charset=binary, so we have to deal with a binary file + # we need to exclude it from git apply. + if [ "$(file -i ${file} | cut -d '=' -f 2)" == "binary" ]; then + have_binaries="1" + exclude_list="${exclude_list} --exclude=${file}" + backupdir=${tmpdir}/$(dirname ${file}) + test -d ${backupdir} || mkdir -p ${backupdir} + # Then backup it, and handle it later in a tarball + cp -p ${file} ${backupdir} + fi +done + +if [ ${have_binaries} ]; then + pushd ${tmpdir} + tar cjpf binaries.tar.bz2 $(ls -d *-*/) + popd +fi + +git checkout master || die "Switch to stable branch failed" +git apply --whitespace=nowarn --exclude='Documentation' --exclude='scripts' \ + ${exclude_list} ${patchset} || die "Unable to apply patchset" +[ ${have_binaries} ] && tar xjpf ${tmpdir}/binaries.tar.bz2 +#repoman commit -m ${review_msg} +einfo "${review_msg}...commited" +rm -rf ${tmpdir} -- cgit v1.2.3-65-gdbad