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)
for arch in self.files.keys():
for rpm in self.files[arch]:
f.write("file:%s:%s\n" % (arch, rpm))
-
+
def remove(self, test = False):
"""
Remove package from ftp
"""
def rpmhdr(pkg):
ts = rpm.ts()
- ts.setVSFlags(rpm._RPMVSF_NOSIGNATURES)
+ ts.setVSFlags(rpm.RPMVSF_NODSAHEADER)
fdno = os.open(pkg, os.O_RDONLY)
hdr = ts.hdrFromFdno(fdno)
os.close(fdno)
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)
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)
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)
def mark4moving(self, wannabepkgs):
self.__mark4something(wannabepkgs, Pkg.mark4moving)
-
# Internal functions below
def __arch_stringify(self, list):
ret = []
- # XXX: is dist line in any config?
- dist = 'ac'
+ dist = config.ftp_dist;
for arch in list:
ret.append(dist + '-' + arch)
return ' '.join(ret)
pkg.error('moving would remove archs: %s' % self.__arch_stringify(missingarchs))
else:
# warn if a package isn't built for all archs
- if (config.separate_noarch and 'noarch' in pkg.files.keys() and len(pkg.files.keys()) == 2):
- continue
- elif len(pkg.files.keys()) != len(config.ftp_archs) + 1:
+ # ftp_archs + SRPMS
+ ftp_archs_num = len(config.ftp_archs) + 1
+ if (config.separate_noarch and 'noarch' in pkg.files.keys()):
+ # ftp_archs + SRPMS + noarch subpackages
+ ftp_archs_num += 1
+ # plain simple noarch package
+ if (len(pkg.files.keys()) == 2):
+ continue
+
+ if len(pkg.files.keys()) != ftp_archs_num:
missingarchs = []
for arch in config.ftp_archs:
if arch not in pkg.files.keys():