From owner-svn-ports-head@FreeBSD.ORG Thu Dec 19 14:43:59 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 12474B9D; Thu, 19 Dec 2013 14:43:59 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id F221216C6; Thu, 19 Dec 2013 14:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rBJEhwK9063886; Thu, 19 Dec 2013 14:43:58 GMT (envelope-from bapt@svn.freebsd.org) Received: (from bapt@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rBJEhwjT063883; Thu, 19 Dec 2013 14:43:58 GMT (envelope-from bapt@svn.freebsd.org) Message-Id: <201312191443.rBJEhwjT063883@svn.freebsd.org> From: Baptiste Daroussin Date: Thu, 19 Dec 2013 14:43:58 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r336919 - head/Tools/scripts X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Dec 2013 14:43:59 -0000 Author: bapt Date: Thu Dec 19 14:43:58 2013 New Revision: 336919 URL: http://svnweb.freebsd.org/changeset/ports/336919 Log: Import mfh script to merge to the Q branches Added: head/Tools/scripts/mfh (contents, props changed) Modified: head/Tools/scripts/README Modified: head/Tools/scripts/README ============================================================================== --- head/Tools/scripts/README Thu Dec 19 14:43:27 2013 (r336918) +++ head/Tools/scripts/README Thu Dec 19 14:43:58 2013 (r336919) @@ -31,6 +31,7 @@ getpr - downloads a problem report fro gnomedepends - Analyse pkg/PLIST and give an advice as to which GNOME ports should be listes in {RUN,LIB}_DEPENDS for this port mark_safe.pl - utility to set subsets of ports to MAKE_JOBS_(UN)SAFE=yes +mfh - Merge from head to a given branch neededlibs.sh - Extract direct library dependencies from binaries. plist - automate (mostly, at least) pkg-plist generation portsearch - A utility for searching the ports tree. It allows more detailed Added: head/Tools/scripts/mfh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Tools/scripts/mfh Thu Dec 19 14:43:58 2013 (r336919) @@ -0,0 +1,86 @@ +#!/bin/sh +# +# mfh - Merge from head to a given branch +# Copyright 2013 Baptiste Daroussin +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# MAINTAINER= portmgr@FreeBSD.org + +set -e + +err() { + echo $@ >&2 + exit 1 +} + +clean() { + rm -rf ${dir} + exit 1 +} + +ask() { + question=${1} + + answer=x + while [ "${answer}" != "y" -a "${answer}" != "n" ] ; do + read -p "${question} [yn] " answer + done + + [ "${answer}" = "y" ] && return 0 + return 1 +} + +[ $# -ne 2 ] && err "Takes 2 arguments: " +branch=$1 +rev=$2 +case $rev in +''|*[!0-9]*) err "revision should be a number" ;; +esac + +dir=$(mktemp -d /tmp/merge.XXX) +cd $dir +svn co --depth=empty svn+ssh://svn.FreeBSD.org/ports/branches/${branch} +filelist="" +for f in $(svn diff --summarize -c $rev svn://svn.FreeBSD.org/ports/head); do + case ${f} in + */*) ;; + *)continue;; + esac + f=${f#*/ports/head/} + f=${f%/*} + filelist="$filelist\n$f" +done +filelist=$(echo -e $filelist | sort -u) +echo "MFH: r$rev" > commit.txt +svn log -r$rev svn://svn.freebsd.org/ports/head | sed '1,2d;$d' >> commit.txt +for f in ${filelist}; do + svn up --parents ${branch}/${f} +done +svn merge -c r${rev} ^/head/ ${branch} +svn up --quiet ${branch} +svn diff ${branch} +ask "Do you want to commit?" || clean +${EDITOR:-vi} commit.txt +svn ci -F commit.txt ${branch} +rm -rf $dir