reformat the code and check if the ring prjs to clean is all green

Without green state it's very dangerous to remove things not needed
*at that moment*
This commit is contained in:
Stephan Kulow 2014-02-12 15:15:11 +01:00
parent f60ce04797
commit 48174c6ab4

View File

@ -515,42 +515,54 @@ def _staging_fill_pkgdeps(self, prj, repo, arch, opts):
self.pkgdeps[b] = source
def _staging_check_depinfo_ring(self, prj, nextprj, opts):
self._staging_fill_pkgdeps(prj, 'standard', 'x86_64', opts)
url = makeurl(opts.apiurl, ['build', prj, '_result'] )
root = ET.parse(http_GET(url)).getroot()
for repo in root.findall('result'):
repostate = repo.get('state', 'missing')
if not repostate in ['unpublished', 'published']:
print "Repo %s/%s is in state %s" % (repo.get('project'), repo.get('repository'), repostate)
return False
for package in repo.findall('status'):
code = package.get('code')
if not code in ['succeeded', 'excluded']:
print "Package %s/%s/%s is %s" % (repo.get('project'), repo.get('repository'), package.get('package'), code)
return False
if prj == 'openSUSE:Factory:Rings:1-MinimalX':
url = makeurl(opts.apiurl, ['build', prj, 'images', 'x86_64', 'Test-DVD-x86_64', '_buildinfo'] )
root = ET.parse(http_GET(url)).getroot()
for bdep in root.findall('bdep'):
if not bdep.attrib.has_key('name'): continue
b = bdep.attrib['name']
if not self.bin2src.has_key(b): continue
b = self.bin2src[b]
self.pkgdeps[b] = 'MYdvd'
self._staging_fill_pkgdeps(prj, 'standard', 'x86_64', opts)
# if ($prj eq 'openSUSE:Factory:MainDesktops') {
# $dinfo->{MYcds} = {};
# $dinfo->{MYcds}->{pkgdep} = ();
# $dinfo->{MYcds}->{source} = 'MYcds';
# push(@{$dinfo->{MYcds}->{pkgdep}}, 'kiwi-image-livecd-gnome');
# push(@{$dinfo->{MYcds}->{pkgdep}}, 'kiwi-image-livecd-kde');
if prj == 'openSUSE:Factory:Rings:0-Bootstrap':
url = makeurl(opts.apiurl, ['build', prj, 'standard', '_buildconfig'] )
for line in http_GET(url).read().split('\n'):
if line.startswith('Preinstall:') or line.startswith('Support:'):
for prein in line.split(':')[1].split():
if not self.bin2src.has_key(prein): continue
b = self.bin2src[prein]
self.pkgdeps[b] = 'MYinstall'
for source in self.sources:
# next if ($key =~ m/^MY/ || $key =~ m/^texlive-specs-/ || $key =~ m/^kernel-/);
if not self.pkgdeps.has_key(source):
print "osc rdelete -m cleanup", prj, source
if nextprj:
print "osc linkpac -c openSUSE:Factory", source, nextprj
if prj == 'openSUSE:Factory:Rings:1-MinimalX':
url = makeurl(opts.apiurl, ['build', prj, 'images', 'x86_64', 'Test-DVD-x86_64', '_buildinfo'] )
root = ET.parse(http_GET(url)).getroot()
for bdep in root.findall('bdep'):
if not bdep.attrib.has_key('name'): continue
b = bdep.attrib['name']
if not self.bin2src.has_key(b): continue
b = self.bin2src[b]
self.pkgdeps[b] = 'MYdvd'
# if ($prj eq 'openSUSE:Factory:MainDesktops') {
# $dinfo->{MYcds} = {};
# $dinfo->{MYcds}->{pkgdep} = ();
# $dinfo->{MYcds}->{source} = 'MYcds';
# push(@{$dinfo->{MYcds}->{pkgdep}}, 'kiwi-image-livecd-gnome');
# push(@{$dinfo->{MYcds}->{pkgdep}}, 'kiwi-image-livecd-kde');
if prj == 'openSUSE:Factory:Rings:0-Bootstrap':
url = makeurl(opts.apiurl, ['build', prj, 'standard', '_buildconfig'] )
for line in http_GET(url).read().split('\n'):
if line.startswith('Preinstall:') or line.startswith('Support:'):
for prein in line.split(':')[1].split():
if not self.bin2src.has_key(prein): continue
b = self.bin2src[prein]
self.pkgdeps[b] = 'MYinstall'
for source in self.sources:
# next if ($key =~ m/^MY/ || $key =~ m/^texlive-specs-/ || $key =~ m/^kernel-/);
if not self.pkgdeps.has_key(source):
print "osc rdelete -m cleanup", prj, source
if nextprj:
print "osc linkpac -c openSUSE:Factory", source, nextprj
@cmdln.option('-e', '--everything', action='store_true',
help='during check do not stop on first first issue and show them all')
@cmdln.option('-p', '--parent', metavar='TARGETPROJECT',