For bug #187806, use mkstemp to create tmpservertimestampfile (instead of using PORTA...
authorZac Medico <zmedico@gentoo.org>
Wed, 15 Aug 2007 20:34:01 +0000 (20:34 -0000)
committerZac Medico <zmedico@gentoo.org>
Wed, 15 Aug 2007 20:34:01 +0000 (20:34 -0000)
svn path=/main/branches/2.1.2.9/; revision=7615

bin/emerge

index 0543338d2f2a091d6aec8380bef25f5c554fb71f..0f75d7d35ff087749f118a751645e524bb98fe83 100755 (executable)
@@ -3923,7 +3923,6 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
        if myaction == "metadata":
                print "skipping sync"
                updatecache_flg = True
-               tmpservertimestampfile = None
        elif syncuri[:8]=="rsync://":
                if not os.path.exists("/usr/bin/rsync"):
                        print "!!! /usr/bin/rsync does not exist, so rsync support is disabled."
@@ -4038,9 +4037,6 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                # Real local timestamp file.
                servertimestampfile = os.path.join(
                        myportdir, "metadata", "timestamp.chk")
-               # Temporary file for remote server timestamp comparison.
-               tmpservertimestampfile = os.path.join(
-                       settings["PORTAGE_TMPDIR"], "timestamp.chk")
 
                content = portage_util.grabfile(servertimestampfile)
                mytimestamp = 0
@@ -4154,6 +4150,10 @@ def action_sync(settings, trees, mtimedb, myopts, myaction):
                        # connection attempt to an unresponsive server which rsync's
                        # --timeout option does not prevent.
                        if True:
+                               # Temporary file for remote server timestamp comparison.
+                               from tempfile import mkstemp
+                               fd, tmpservertimestampfile = mkstemp()
+                               os.close(fd)
                                mycommand = rsynccommand[:]
                                mycommand.append(dosyncuri.rstrip("/") + \
                                        "/metadata/timestamp.chk")