From c18aa841e4fb54bf59543795a3744cd82d50707e Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sat, 11 Nov 2006 23:24:22 +0000 Subject: [PATCH] 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 --- bin/emerge | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) -- 2.26.2