f=open(default_to+'SRPMS/.metadata/'+srpm+'.info', 'a')
for rpm in srcpkg.files['ARCH']:
- if rpm[-11:]=='.noarch.rpm':
+ if rpm[-11:]=='.noarch.rpm' and config.separate_noarch:
move_noarch(f, arch, rpm, dstpkg)
else:
f.write("file:%s:%s\n" % (arch, rpm))
import sys, os
sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules')
from common import checkdir
-from config import ftp_dir,ftp_archs
+from config import ftp_dir,all_ftp_archs
import ftpio
if len(sys.argv) < 2:
for tree in trees:
print '-------------------------- %s --------------------------' % tree
- for arch in ['noarch'] + ftp_archs:
+ for arch in all_ftp_archs:
print 'ARCHITECTURE: %s' % arch
os.system('%s.stat/bin/poldek --cachedir=%s/tmp/poldek --conf %s.stat/etc/poldek.conf -s %s%s/%s/RPMS/ --mkidxz --mkidx-type pdir' %
(ftp_dir,home,ftp_dir,ftp_dir,tree,arch))
f.close()
+default_to=value['ftp_dir']+'/'+value['default_to']+'/'
ftp_dir=value['ftp_dir']+'/'
incoming_dir=value['ftp_dir']+'/'+value['incoming_dir']+'/'
-default_to=value['ftp_dir']+'/'+value['default_to']+'/'
-ftp_archs=value['ftp_archs'].split(' ')
test_builds_dir=value['ftp_dir']+'/'+value['test_builds_dir']+'/'
+ftp_archs=value['ftp_archs'].split(' ')
+
+if value['separate_noarch']=='yes':
+ separate_noarch=True
+else:
+ separate_noarch=False
+
+if separate_noarch:
+ all_ftp_archs=['noarch'] + ftp_archs
+else:
+ all_ftp_archs=ftp_archs
errnum=errnum+1
print msg
+def pwarning(msg):
+ print msg
+
def rm(file):
os.remove(file)
#print 'rm: '+file
self.marked4moving=[]
self.pkgnames=[]
self.__loadpkgnames()
- self.do_checkbuild=True
if loadall:
for pkgname in self.pkgnames:
self.loadedpkgs[pkgname]=Pkg(pkgname, self)
+ # Tests:
+ self.do_checkbuild=True
def __getitem__(self, key):
if self.loadedpkgs.has_key(key):
return pkg
else:
raise KeyError, key
+
def has_key(self, key):
if key in self.pkgnames:
return True
else:
return False
+
def keys(self):
return self.pkgnames
perror('Package %s has only src.rpm built' % pkg)
continue
otherpkgnames=self.__find_other_pkgs(pkg, dsttree)
- curarchs=[]
- missingarchs=[]
- for somepkg in otherpkgnames:
- curarchs.extend(Pkg(somepkg, dsttree).files.keys())
- for arch in curarchs:
- if arch not in pkg.files.keys():
- missingarchs.append(arch)
- if missingarchs:
- perror('Moving %s would remove archs: %s' % (pkg, missingarchs))
+ if otherpkgnames: # check if we're not removing some archs
+ curarchs=[]
+ missingarchs=[]
+ for somepkg in otherpkgnames:
+ curarchs.extend(Pkg(somepkg, dsttree).files.keys())
+ for arch in curarchs:
+ if arch not in pkg.files.keys():
+ missingarchs.append(arch)
+ if missingarchs:
+ perror('Moving %s would remove archs: %s' %
+ (pkg, missingarchs))
+ else: # warn if a package isn't built for all archs
+ pass
def __rmolderfromsrc(self):
for pkg in self.marked4moving: