]> git.pld-linux.org Git - projects/pld-ftp-admin.git/blobdiff - modules/ftptree.py
fix archive handling when moving packages around
[projects/pld-ftp-admin.git] / modules / ftptree.py
index 3234725fc6d289a413872791a9daabb4906b4c7f..e22833117410dd7631003cdef6a28d407c6712f0 100644 (file)
@@ -46,7 +46,7 @@ def mv(src, dst, test = False):
     fsrc = src
     fdst = dst + '/' + src.split('/')[-1]
     if test:
-        if not os.path.exists(src):
+        if not os.path.exists(fsrc):
             pinfo("TEST os.rename(%s, %s): source doesn't exists" % (fsrc, fdst))
         if not os.path.exists(dst):
             pinfo("TEST destination doesn't exist: %s" % dst)
@@ -301,7 +301,8 @@ class FtpTree(BaseFtpTree):
     def testmove(self, dsttree, archivetree = None):
         self.__checkbuild(self.marked4moving)
         self.__checkarchs(dsttree, self.marked4moving)
-        self.__checkduplicates(self.marked4moving)
+        if not dsttree.treename.count("archive"):
+            self.__checkduplicates(self.marked4moving)
 
         self.__checksigns(dsttree, self.marked4moving, test = True)
         self.__checkforobsoletes(dsttree, self.marked4moving, test = True)
@@ -309,8 +310,8 @@ class FtpTree(BaseFtpTree):
 
         if not self.treename.count("archive"):
             self.__rmolderfromsrc(test = True)
-
-        self.__rmotherfromdst(dsttree, test = True, archivetree = archivetree)
+        if not dsttree.treename.count("archive"):
+            self.__rmotherfromdst(dsttree, test = True, archivetree = archivetree)
 
         for pkg in self.marked4moving:
             pkg.move(dsttree, test = True)
@@ -328,8 +329,8 @@ class FtpTree(BaseFtpTree):
 
         if not self.treename.count("archive"):
             self.__rmolderfromsrc()
-
-        self.__rmotherfromdst(dsttree, archivetree = archivetree)
+        if not dsttree.treename.count("archive"):
+            self.__rmotherfromdst(dsttree, archivetree = archivetree)
 
         for pkg in self.marked4moving:
             pkg.move(dsttree)
This page took 0.049213 seconds and 4 git commands to generate.