From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from <gentoo-commits+bounces-392062-garchives=archives.gentoo.org@lists.gentoo.org>) id 1REu4h-0007fP-Uf for garchives@archives.gentoo.org; Sat, 15 Oct 2011 02:34:12 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id DEA6321C021; Sat, 15 Oct 2011 02:34:03 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 9E7B721C021 for <gentoo-commits@lists.gentoo.org>; Sat, 15 Oct 2011 02:34:03 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D56011B4029 for <gentoo-commits@lists.gentoo.org>; Sat, 15 Oct 2011 02:34:02 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 2FCBA80042 for <gentoo-commits@lists.gentoo.org>; Sat, 15 Oct 2011 02:34:02 +0000 (UTC) From: "Zac Medico" <zmedico@gentoo.org> To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" <zmedico@gentoo.org> Message-ID: <4983b670cdb44d860b9a46325f5ae28cd9685586.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:master commit in: bin/ X-VCS-Repository: proj/portage X-VCS-Files: bin/repoman X-VCS-Directories: bin/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 4983b670cdb44d860b9a46325f5ae28cd9685586 Date: Sat, 15 Oct 2011 02:34:02 +0000 (UTC) Precedence: bulk List-Post: <mailto:gentoo-commits@lists.gentoo.org> List-Help: <mailto:gentoo-commits+help@lists.gentoo.org> List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org> List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org> List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org> X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: 953d7cce4d6ae5a8c69c212db1cbf37b commit: 4983b670cdb44d860b9a46325f5ae28cd9685586 Author: Zac Medico <zmedico <AT> gentoo <DOT> org> AuthorDate: Sat Oct 15 02:33:32 2011 +0000 Commit: Zac Medico <zmedico <AT> gentoo <DOT> org> CommitDate: Sat Oct 15 02:33:32 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a= =3Dcommit;h=3D4983b670 repoman --if-modified: handle removed files --- bin/repoman | 26 ++++++++++++++++++++++---- 1 files changed, 22 insertions(+), 4 deletions(-) diff --git a/bin/repoman b/bin/repoman index 11fb56a..ffc622c 100755 --- a/bin/repoman +++ b/bin/repoman @@ -544,6 +544,11 @@ else: else: vcs =3D None =20 +if options.if_modified =3D=3D "y" and vcs is None: + logging.info("Not in a version controlled repository; " + "disabling --if-modified.") + options.if_modified =3D "n" + # Disable copyright/mtime check if vcs does not preserve mtime (bug #324= 075). vcs_preserves_mtime =3D vcs not in ('git',) =20 @@ -1068,25 +1073,41 @@ if vcs =3D=3D "cvs": mycvstree =3D cvstree.getentries("./", recursive=3D1) mychanged =3D cvstree.findchanged(mycvstree, recursive=3D1, basedir=3D"= ./") mynew =3D cvstree.findnew(mycvstree, recursive=3D1, basedir=3D"./") + if options.if_modified =3D=3D "y": + myremoved =3D cvstree.findremoved(mycvstree, recursive=3D1, basedir=3D= "./") + if vcs =3D=3D "svn": svnstatus =3D os.popen("svn status").readlines() mychanged =3D [ "./" + elem.split()[-1:][0] for elem in svnstatus if el= em and elem[:1] in "MR" ] mynew =3D [ "./" + elem.split()[-1:][0] for elem in svnstatus if el= em.startswith("A") ] + if options.if_modified =3D=3D "y": + myremoved =3D [ "./" + elem.split()[-1:][0] for elem in svnstatus if e= lem.startswith("D")] + elif vcs =3D=3D "git": mychanged =3D os.popen("git diff-index --name-only --relative --diff-fi= lter=3DM HEAD").readlines() mychanged =3D ["./" + elem[:-1] for elem in mychanged] =20 mynew =3D os.popen("git diff-index --name-only --relative --diff-filter= =3DA HEAD").readlines() mynew =3D ["./" + elem[:-1] for elem in mynew] + if options.if_modified =3D=3D "y": + myremoved =3D os.popen("git diff-index --name-only --relative --diff-f= ilter=3DD HEAD").readlines() + myremoved =3D ["./" + elem[:-1] for elem in myremoved] + elif vcs =3D=3D "bzr": bzrstatus =3D os.popen("bzr status -S .").readlines() mychanged =3D [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem= in bzrstatus if elem and elem[1:2] =3D=3D "M" ] mynew =3D [ "./" + elem.split()[-1:][0].split('/')[-1:][0] for elem= in bzrstatus if elem and ( elem[1:2] =3D=3D "NK" or elem[0:1] =3D=3D "R"= ) ] + if options.if_modified =3D=3D "y": + myremoved =3D [ "./" + elem.split()[-3:-2][0].split('/')[-1:][0] for e= lem in bzrstatus if elem and ( elem[1:2] =3D=3D "K" or elem[0:1] =3D=3D "= R" ) ] + elif vcs =3D=3D "hg": mychanged =3D os.popen("hg status --no-status --modified .").readlines(= ) mychanged =3D ["./" + elem.rstrip() for elem in mychanged] mynew =3D os.popen("hg status --no-status --added .").readlines() mynew =3D ["./" + elem.rstrip() for elem in mynew] + if options.if_modified =3D=3D "y": + myremoved =3D os.popen("hg status --no-status --removed .").readlines(= ) + myremoved =3D ["./" + elem.rstrip() for elem in myremoved] =20 if vcs: new_ebuilds.update(x for x in mynew if x.endswith(".ebuild")) @@ -1130,9 +1151,6 @@ except FileNotFound: herd_base =3D None =20 modified_pkgs =3D 0 -if options.if_modified =3D=3D "y" and not vcs: - logging.info("Not in a version controlled repository; disabling --if-mo= dified.") - options.if_modified =3D "n" =20 for x in scanlist: #ebuilds and digests added to cvs respectively. @@ -1150,7 +1168,7 @@ for x in scanlist: if options.if_modified =3D=3D "y": checkdir_modified =3D False checkdir_pattern =3D checkdir_relative.rstrip(os.sep) + os.sep - for f in chain(mychanged, mynew): + for f in chain(mychanged, mynew, myremoved): if f.startswith(checkdir_pattern): checkdir_modified =3D True modified_pkgs +=3D 1