From: Zac Medico Date: Sat, 11 Nov 2006 23:24:22 +0000 (-0000) Subject: For initial gentoo-x86 checkout, if $PORTDIR exists and is empty then remove it so... X-Git-Tag: v2.1.2~482 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c18aa841e4fb54bf59543795a3744cd82d50707e;p=portage.git For initial gentoo-x86 checkout, if $PORTDIR exists and is empty then remove it so that the gentoo-x86 checkout can replace it. svn path=/main/trunk/; revision=5008 --- diff --git a/bin/emerge b/bin/emerge index 89e8633a1..00fca815f 100755 --- a/bin/emerge +++ b/bin/emerge @@ -3405,12 +3405,17 @@ def action_sync(settings, trees, mtimedb, myopts, myaction): if not os.path.exists(myportdir+"/CVS"): #initial checkout print ">>> Starting initial cvs checkout with "+syncuri+"..." - if os.path.exists(myportdir): - print "!!! existing '%s' directory; exiting." % myportdir - sys.exit(1) if os.path.exists(cvsdir+"/gentoo-x86"): print "!!! existing",cvsdir+"/gentoo-x86 directory; exiting." sys.exit(1) + try: + os.rmdir(myportdir) + except OSError, e: + if e.errno != errno.ENOENT: + sys.stderr.write( + "!!! existing '%s' directory; exiting.\n" % myportdir) + sys.exit(1) + del e if portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co -P gentoo-x86",settings,free=1): print "!!! cvs checkout error; exiting." sys.exit(1)