Fix initial cvs checkout logic for bug #100478.
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Nov 2006 14:00:13 +0000 (14:00 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Nov 2006 14:00:13 +0000 (14:00 -0000)
svn path=/main/trunk/; revision=5006

bin/emerge

index ecc04e04842a08172b4a0f82500d78b8c8c1a411..89e8633a1c5f609b9bfa98f952dff8d1adfd3fc2 100755 (executable)
@@ -3405,14 +3405,16 @@ 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)
                        if portage.spawn("cd "+cvsdir+"; cvs -z0 -d "+cvsroot+" co -P gentoo-x86",settings,free=1):
                                print "!!! cvs checkout error; exiting."
                                sys.exit(1)
-                       if cvsdir!=myportdir:
-                               portage.movefile(cvsdir,settings["PORTDIR"])
+                       os.rename(os.path.join(cvsdir, "gentoo-x86"), myportdir)
                else:
                        #cvs update
                        print ">>> Starting cvs update with "+syncuri+"..."