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 8632F1393DD for ; Wed, 16 Jul 2014 15:14:47 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 86A27E09AD; Wed, 16 Jul 2014 15:14:46 +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 E6E0FE09AD for ; Wed, 16 Jul 2014 15:14:45 +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 909EE34003D for ; Wed, 16 Jul 2014 15:14:44 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 4CF541807D for ; Wed, 16 Jul 2014 15:14:43 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1404150172.3a25a91a514bfa52b3df508ecd32558cdc044ba5.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/packageinfo.py X-VCS-Directories: roverlay/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 3a25a91a514bfa52b3df508ecd32558cdc044ba5 X-VCS-Branch: master Date: Wed, 16 Jul 2014 15:14:43 +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: a01fe1b9-1ade-4899-90e9-1a4db254aaae X-Archives-Hash: ed78a11e50630fdbfec5ab0bbbf26a90 commit: 3a25a91a514bfa52b3df508ecd32558cdc044ba5 Author: André Erdmann mailerd de> AuthorDate: Mon Jun 30 17:42:52 2014 +0000 Commit: André Erdmann mailerd de> CommitDate: Mon Jun 30 17:42:52 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/R_overlay.git;a=commit;h=3a25a91a packageinfo, revbump(): add 'ebuild_only' param --- roverlay/packageinfo.py | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/roverlay/packageinfo.py b/roverlay/packageinfo.py index 9083d61..a6428d0 100644 --- a/roverlay/packageinfo.py +++ b/roverlay/packageinfo.py @@ -606,12 +606,14 @@ class PackageInfo ( roverlay.util.objects.Referenceable ): return self.hashdict # --- end of make_hashes (...) --- - def revbump ( self, newrev=None ): + def revbump ( self, newrev=None, ebuild_only=False ): """Do whatever necessary to revbump this pakages, that is set/update all data like src_uri_dest and ebuild_verstr. arguments: - * newrev -- new revision, (current rev + 1) is used if this is None + * newrev -- new revision, (current rev + 1) is used if this is None + * ebuild_only -- if set and True: revbump the package only, + keeping the distfile path as-is """ rev = self._info['rev'] + 1 if newrev is None else int ( newrev ) rev_str = ( '-r' + str ( rev ) ) if rev > 0 else '' @@ -619,26 +621,29 @@ class PackageInfo ( roverlay.util.objects.Referenceable ): '.'.join ( str ( k ) for k in self._info['version'] ) + rev_str ) - # preserve destpath directory - # (this allows to handle paths like "a/b.tar/pkg.tgz" properly) - # - old_destpath = self ['package_src_destpath'].rpartition ( os.path.sep ) - - # os.path.splitext does not "recognize" .tar.gz - fhead, ftar, fext = old_destpath[2].rpartition ( '.tar' ) - if not ftar: - fhead, fext = os.path.splitext ( fext ) - - # FIXME: any way to get this reliably (+faster) done without a regex? - # ( a,b,c=fhead.rpartition ( '-r' ); try int(c) ...; ?) - distfile = ( - old_destpath[0] + old_destpath[1] - + self.EBUILDREV_REGEX.sub ( '', fhead ) + rev_str + ftar + fext - ) + if not ebuild_only: + # preserve destpath directory + # (this allows to handle paths like "a/b.tar/pkg.tgz" properly) + # + old_destpath = self ['package_src_destpath'].rpartition ( os.path.sep ) + + # os.path.splitext does not "recognize" .tar.gz + fhead, ftar, fext = old_destpath[2].rpartition ( '.tar' ) + if not ftar: + fhead, fext = os.path.splitext ( fext ) + + # FIXME: any way to get this reliably (+faster) done without a regex? + # ( a,b,c=fhead.rpartition ( '-r' ); try int(c) ...; ?) + distfile = ( + old_destpath[0] + old_destpath[1] + + self.EBUILDREV_REGEX.sub ( '', fhead ) + rev_str + ftar + fext + ) + + self._info ['src_uri_dest'] = distfile + # -- end if self._info ['rev'] = rev self._info ['ebuild_verstr'] = vstr - self._info ['src_uri_dest'] = distfile return self # --- end of revbump (...) ---