Ok updates. 

Got groups to build but deps are a real issue.

Hacked together a script to help with the factory updates. I read the rmake log 
and parse out the deps. I know this can be better but I wasn't trying very hard 
so anyone who wants to improve please feel free. Most of the Haskell stuff can 
be boiled down to one regex.

# I know I could wrap this in subprocess
rmake q 17605 --logs > rmake-17605-DepsNeeded.log

#!/usr/bin/python

import re
import sys

f = open(sys.argv[1], 'r')
raw = f.read()
f.close()

match = re.compile(r"(?:^\t.+:rpm.+\(SysV.+\))+?", re.M|re.DOTALL)
results = match.findall(raw)
depblock = [ x for x in results[0].split('\t') if x ]


trove_match = re.compile(r"^(.+:rpm.+])?")
deps_match = re.compile(r"(?:((soname|file|rpm):.+))?")

haskell_exclude = re.compile(r"libHS.*ghc.*\.so?")

deps = {}
rebuild = []

for block in depblock:
    data = set()
    trv =  trove_match.findall(block)[0]
    name = trv.split(':')[0]
    if name not in rebuild:
        rebuild.append(name)
    ugly = [ x for x in deps_match.findall(block) if x[0]  ]
    for dep, name in ugly:
        if not haskell_exclude.search(dep):
            data.add(dep)
    if data:
        deps.setdefault(trv, data)

  
template = '''\tr.Requires(exceptDeps="%s")\n'''

print '''# Haskell Exception\nr.Requires(exceptDeps="libHS.*ghc.*\.so?")\n
    '''        
    
for trv, exceptions in deps.iteritems():
    name = trv.split(':')[0]
    exceptions_string = ''
    for strings in exceptions:
        exceptions_string += template % (strings)
    print '''
if r.name == '%s':
%s
           ''' % (name, exceptions_string)        

print "packages to rebuild:\n"
print ' '.join(sorted(rebuild))



This spits out a bunch of ugly  that can be used to write exceptions where 
needed as well as a list of packages that need to be rebuilt after the factory 
is fixed.




--

Brett C. Smith
[email protected]
Sr Software Developer
Platform Deployment Technologies
(919)531-6635  -- x16635
_______________________________________________
Foresight-devel mailing list
[email protected]
https://lists.foresightlinux.org/mailman/listinfo/foresight-devel
_______________________________________________
Foresight-devel mailing list
[email protected]
https://lists.foresightlinux.org/mailman/listinfo/foresight-devel

Reply via email to