diff options
author | Romain Perier <mrpouet@gentoo.org> | 2009-08-22 09:48:47 +0200 |
---|---|---|
committer | Romain Perier <mrpouet@gentoo.org> | 2009-08-22 09:48:47 +0200 |
commit | 76135128a604beda88ed4b38f40f36562a15ad4d (patch) | |
tree | 7398beb88a5829fc689ad8d1b73c5fa6993e9405 /scripts | |
parent | (games-arcade/megamario) minor changes in megamario-1.6.ebuild (diff) | |
download | gamerlay-76135128a604beda88ed4b38f40f36562a15ad4d.tar.gz gamerlay-76135128a604beda88ed4b38f40f36562a15ad4d.tar.bz2 gamerlay-76135128a604beda88ed4b38f40f36562a15ad4d.zip |
scripts/gamerlay-review: To script to synchronize "devel" and "stable" branch (experimental)
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/gamerlay-review | 51 |
1 files changed, 51 insertions, 0 deletions
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} |