From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 04B5B1381F3 for ; Sun, 21 Jul 2013 03:49:08 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B0BABE08E8; Sun, 21 Jul 2013 03:49:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id D9BE9E08E8 for ; Sun, 21 Jul 2013 03:49:02 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id C938D33DAB3 for ; Sun, 21 Jul 2013 03:49:01 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 10ABEE5458 for ; Sun, 21 Jul 2013 03:49:00 +0000 (UTC) From: "Arfrever Frehtes Taifersar Arahesis" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arfrever Frehtes Taifersar Arahesis" Message-ID: <1374378491.6845fb0333e1a68fd58f0653341c093639b558c7.arfrever@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: / X-VCS-Repository: proj/portage X-VCS-Files: make.conf-repatch.sh X-VCS-Directories: / X-VCS-Committer: arfrever X-VCS-Committer-Name: Arfrever Frehtes Taifersar Arahesis X-VCS-Revision: 6845fb0333e1a68fd58f0653341c093639b558c7 X-VCS-Branch: master Date: Sun, 21 Jul 2013 03:49:00 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: f9c18b92-8861-487b-b52f-68421c04b34f X-Archives-Hash: 732cc4c0922353e60e56261c33ab318b commit: 6845fb0333e1a68fd58f0653341c093639b558c7 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun Jul 21 03:48:11 2013 +0000 Commit: Arfrever Frehtes Taifersar Arahesis gmail com> CommitDate: Sun Jul 21 03:48:11 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6845fb03 make.conf-repatch.sh: Port to git and improve coding style. --- make.conf-repatch.sh | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/make.conf-repatch.sh b/make.conf-repatch.sh old mode 100644 new mode 100755 index 6589e6b..790e667 --- a/make.conf-repatch.sh +++ b/make.conf-repatch.sh @@ -6,35 +6,36 @@ die() { exit 1 } -if [ ! -f "make.conf" -o ! -f "make.conf.x86.diff" -o ! -d ".svn" ]; then +if [[ ! -f make.conf || ! -f make.conf.x86.diff || ! -d ../.git ]]; then echo "ERROR: current directory is invalid" > /dev/stderr exit 1 fi -svn diff make.conf > make.conf.diff -svn revert make.conf +git diff --no-prefix --relative="$(basename "$(pwd)")" make.conf > make.conf.diff +git checkout -- make.conf +archs=() for x in make.conf.*.diff; do - archs="$archs $(basename ${x:10} .diff)" + archs+=("$(basename ${x:10} .diff)") done -for arch in $archs; do - echo "* Patching $arch" - cp make.conf make.conf.$arch || die "copy failed" - patch -p0 make.conf.$arch < make.conf.${arch}.diff > /dev/null || die "arch-patch failed" - patch -p0 make.conf.$arch < make.conf.diff > /dev/null || die "patch failed" +for arch in "${archs[@]}"; do + echo "* Patching ${arch}" + cp make.conf make.conf.${arch} || die "copy failed" + patch -p0 make.conf.${arch} < make.conf.${arch}.diff > /dev/null || die "arch-patch failed" + patch -p0 make.conf.${arch} < make.conf.diff > /dev/null || die "patch failed" done echo "* Re-patching make.conf" patch -p0 make.conf < make.conf.diff > /dev/null || die "repatch failed" -for arch in $archs; do - echo "* Creating diff for $arch" - diff -u make.conf make.conf.$arch > make.conf.${arch}.diff - [ -z "${KEEP_ARCH_MAKE_CONF}" ] && rm -f make.conf.$arch make.conf.${arch}.orig +for arch in "${archs[@]}"; do + echo "* Creating diff for ${arch}" + diff -u make.conf make.conf.${arch} > make.conf.${arch}.diff + [[ -z ${KEEP_ARCH_MAKE_CONF} ]] && rm -f make.conf.${arch} make.conf.${arch}.orig done rm make.conf.diff -echo "Done" \ No newline at end of file +echo "Done"