X-Git-Url: http://dolda2000.com/gitweb/?p=dcp.git;a=blobdiff_plain;f=dcp-init;h=f8f3667d905d493b32312231e9bda3d30862a853;hp=fa89bcaef9f25d1cd64a77a5edd996014d7d3491;hb=HEAD;hpb=ad9aaa9813f05060ad852cea417f495b072f4783 diff --git a/dcp-init b/dcp-init index fa89bca..f8f3667 100755 --- a/dcp-init +++ b/dcp-init @@ -3,10 +3,11 @@ set -e usage() { - echo "usage: dcp-init [-sh] [-C key=val] [-d REPODIR] PACKAGE [PATCH...]" + echo "usage: dcp-init [-sh] [-C key=val] [-d REPODIR] PACKAGE [(PATCH|-m)...]" echo " PATCH ::= [-p LEVEL] [-bB BRANCH] FILE" echo " -b creates a new branch at the current patch" echo " -B creates a new branch at the upstream sources" + echo " -m merges the current branch into the master branch" } rungit() { @@ -58,7 +59,12 @@ readconf() { if [ -r "\$HOME/.dcp-build-conf" ]; then while read key val; do export "CONF_\$key"="\$val" - done <"$HOME/.dcp-build-conf" + done <"\$HOME/.dcp-build-conf" + fi + if [ -r "/etc/dcp-conf" ]; then + while read key val; do + export "CONF_\$key"="\$val" + done <"/etc/dcp-conf" fi while read key val; do export "CONF_\$key"="\$val" @@ -68,6 +74,24 @@ readconf() { rungit() { (cd repo; git "\$@") || false } + +logchange() { + tag="\${CONF_VERTAG:-dcp}" + ver="\$(dpkg-parsechangelog -lrepo/src/debian/changelog | sed -n 's/^Version: \(.*\)$/\1/p')" + [ -n "\$ver" ] + maint="\$CONF_MAINTAINER" + if [ -z "\$maint" ]; then + maint="\$(id -un) <\$(id -un)@\$(hostname -f)>" + fi + cat - repo/src/debian/changelog >repo/src/debian/changelog.new <"$td/control/build" <"$td/control/update.d/post-logchange" <>"$td/control/conf" rungit add control/conf } @@ -206,6 +250,7 @@ initvals() { level=0 } initvals +curbranch=master while [ $# -gt 0 ]; do arg="$1" shift @@ -214,10 +259,16 @@ while [ $# -gt 0 ]; do level="$1" shift elif [ "$arg" = -b ]; then - rungit checkout -q -b "$1" + curbranch="$1" shift + rungit checkout -q -b "$curbranch" elif [ "$arg" = -B ]; then - rungit checkout -q -b "$1" upstream + curbranch="$1" + shift + rungit checkout -q -b "$curbranch" upstream + elif [ "$arg" = -m ]; then + rungit checkout -q master + rungit merge -n "$curbranch" else echo "dcp-init: unknown patch option '$arg'" >&2 exit 1