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 0383C13877A for ; Tue, 12 Aug 2014 11:06:03 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4C83EE0CCC; Tue, 12 Aug 2014 11:06:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DC8F6E0CCC for ; Tue, 12 Aug 2014 11:06:01 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D4247340490 for ; Tue, 12 Aug 2014 11:06:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 93C2F18815 for ; Tue, 12 Aug 2014 11:05:59 +0000 (UTC) From: "Michael Palimaka" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michael Palimaka" Message-ID: <1407841518.dddd95da392dc0e44cfff488be6432645df1a31f.kensington@gentoo> Subject: [gentoo-commits] proj/kde:master commit in: Documentation/maintainers/ X-VCS-Repository: proj/kde X-VCS-Files: Documentation/maintainers/bump-from-set.sh X-VCS-Directories: Documentation/maintainers/ X-VCS-Committer: kensington X-VCS-Committer-Name: Michael Palimaka X-VCS-Revision: dddd95da392dc0e44cfff488be6432645df1a31f X-VCS-Branch: master Date: Tue, 12 Aug 2014 11:05:59 +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: 7355f24b-1563-427b-9af0-aa019ee01c4b X-Archives-Hash: d254d55fe8294f414b29bfac54accb24 commit: dddd95da392dc0e44cfff488be6432645df1a31f Author: Michael Palimaka gentoo org> AuthorDate: Tue Aug 12 11:05:18 2014 +0000 Commit: Michael Palimaka gentoo org> CommitDate: Tue Aug 12 11:05:18 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/kde.git;a=commit;h=dddd95da [Documentation/maintainers] Add new simple script for set-based 9999 -> release bumps. --- Documentation/maintainers/bump-from-set.sh | 71 ++++++++++++++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/Documentation/maintainers/bump-from-set.sh b/Documentation/maintainers/bump-from-set.sh new file mode 100755 index 0000000..741f199 --- /dev/null +++ b/Documentation/maintainers/bump-from-set.sh @@ -0,0 +1,71 @@ +#!/bin/sh + +# requires app-portage/portage-utils and app-portage/gentoolkit-dev + +: ${KEYWORDS:="~amd64"} +: ${PORTDIR:="$(pwd)"} + +get_package_list_from_set() { + + local SET="${1}" + + for entry in $(cat "${PORTDIR}/sets/${SET}") ; do + if [[ ${entry} == \#* || ${entry} == @* ]] ; then + continue + fi + echo $(qatom ${entry} | cut -d " " -f 1-2 | tr " " "/") + done + +} + +help() { + echo Simple set-based version bumper. + echo + echo Given a set file, bumps all packages in the given set given source + echo and destination versions. Designed for workflows where ebuilds are + echo bumped from up-to-date live versions. + echo + echo Reads PORTDIR from your enviroment, defaulting to the current directory. + echo + echo Reads KEYWORDS for the new ebuild from your environment, defaulting to ~amd64. + echo + echo Usage: bump-from-set.sh SETNAME SOURCEVERSION DESTINATIONVERSION + echo Example: bump-from-set.sh kde-plasma-5.0 5.0.9999 5.0.1 + exit 0 +} + + +SETNAME="$1" +SOURCEVERSION="$2" +DESTINATIONVERSION="$3" + +if [[ $1 == "--help" ]] ; then + help +fi + +if [[ -z "${SETNAME}" || -z "${SOURCEVERSION}" || -z "${DESTINATIONVERSION}" ]] ; then + echo ERROR: Not enough arguments + echo + help +fi + +packages=$(get_package_list_from_set ${SETNAME}) + +for package in ${packages} ; do + pushd "${PORTDIR}/${package}" > /dev/null + + pn=$(basename $(pwd)) + source=${pn}-${SOURCEVERSION}.ebuild + destination=${pn}-${DESTINATIONVERSION}.ebuild + + cp ${source} ${destination} + ekeyword ^all ${destination} > /dev/null + + if [[ ${destination} != *9999* ]] ; then + ekeyword ${KEYWORDS} ${destination} > /dev/null + fi + + repoman manifest + + popd > /dev/null +done