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-393002-garchives=archives.gentoo.org@lists.gentoo.org>)
	id 1RFbFP-0006Un-G7
	for garchives@archives.gentoo.org; Mon, 17 Oct 2011 00:40:07 +0000
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 0376C21C09D;
	Mon, 17 Oct 2011 00:39:59 +0000 (UTC)
Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183])
	by pigeon.gentoo.org (Postfix) with ESMTP id CBECC21C09D
	for <gentoo-commits@lists.gentoo.org>; Mon, 17 Oct 2011 00:39:59 +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 5579B1B4025
	for <gentoo-commits@lists.gentoo.org>; Mon, 17 Oct 2011 00:39:59 +0000 (UTC)
Received: from localhost.localdomain (localhost [127.0.0.1])
	by pelican.gentoo.org (Postfix) with ESMTP id 6F28380042
	for <gentoo-commits@lists.gentoo.org>; Mon, 17 Oct 2011 00:39:58 +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: <375127ef9e265ec311dce3dd23a4fa2feb729717.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: 375127ef9e265ec311dce3dd23a4fa2feb729717
Date: Mon, 17 Oct 2011 00:39:58 +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: 57770ac174c20c0a8d4733eb2db79429

commit:     375127ef9e265ec311dce3dd23a4fa2feb729717
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 17 00:39:47 2011 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 17 00:39:47 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=3Dproj/portage.git;a=
=3Dcommit;h=3D375127ef

repoman: simplify autoadd code

---
 bin/repoman |   36 +++++++++++-------------------------
 1 files changed, 11 insertions(+), 25 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index 1d7d71a..efd8a01 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -18,6 +18,7 @@ import optparse
 import re
 import signal
 import stat
+import subprocess
 import sys
 import tempfile
 import textwrap
@@ -2459,33 +2460,18 @@ else:
=20
 	if myautoadd:
 		print(">>> Auto-Adding missing Manifest/ChangeLog file(s)...")
+		add_cmd =3D [vcs, "add"]
+		add_cmd +=3D myautoadd
 		if options.pretend:
-			if vcs =3D=3D "cvs":
-				print("(cvs add "+" ".join(myautoadd)+")")
-			elif vcs =3D=3D "svn":
-				print("(svn add "+" ".join(myautoadd)+")")
-			elif vcs =3D=3D "git":
-				print("(git add "+" ".join(myautoadd)+")")
-			elif vcs =3D=3D "bzr":
-				print("(bzr add "+" ".join(myautoadd)+")")
-			elif vcs =3D=3D "hg":
-				print("(hg add "+" ".join(myautoadd)+")")
-			retval =3D os.EX_OK
+			portage.writemsg_stdout("(%s)\n" % " ".join(add_cmd),
+				noiselevel=3D-1)
 		else:
-			if vcs =3D=3D "cvs":
-				retval =3D os.system("cvs add "+" ".join(myautoadd))
-			elif vcs =3D=3D "svn":
-				retval =3D os.system("svn add "+" ".join(myautoadd))
-			elif vcs =3D=3D "git":
-				retval =3D os.system("git add "+" ".join(myautoadd))
-			elif vcs =3D=3D "bzr":
-				retval =3D os.system("bzr add "+" ".join(myautoadd))
-			elif vcs =3D=3D "hg":
-				retval =3D os.system("hg add "+" ".join(myautoadd))
-		if retval !=3D os.EX_OK:
-			writemsg_level("!!! Exiting on %s (shell) error code: %s\n" % \
-				(vcs, retval), level=3Dlogging.ERROR, noiselevel=3D-1)
-			sys.exit(retval)
+			add_cmd =3D [_unicode_encode(arg) for arg in add_cmd]
+			retcode =3D subprocess.call(add_cmd)
+			if retcode !=3D os.EX_OK:
+				logging.error(
+					"Exiting on %s error code: %s\n" % (vcs, retcode))
+				sys.exit(retcode)
=20
 		myupdates +=3D myautoadd
=20