Changeset 761 for server/fedora/config


Ignore:
Timestamp:
Jun 3, 2008, 1:23:48 PM (16 years ago)
Author:
presbrey
Message:
gem replication install script
File:
1 edited

Legend:

Unmodified
Added
Removed
  • server/fedora/config/gems.py

    r204 r761  
    44Joe Presbrey <presbrey@mit.edu"""
    55
    6 import commands, re
     6import commands, re, sys
    77
    88def scripts_gems():
    9         cout = commands.getoutput('gem list --local')
    10         return re.findall('([^\s]+)\s\([0-9\.]+\)', cout)
     9    o = commands.getoutput('gem list --local')
     10    return map(lambda x: len(x) > 1 and (x[0], x[1].split(', ')) or x,
     11               re.findall('([^\s]+)\s\(([^\)]+)\)', o))
    1112
    1213if __name__ == "__main__":
    13         for x in gems_local():
    14                 if x == 'sources': continue
    15                 print x
     14    for x in scripts_gems():
     15        if x[0] == 'sources': continue
     16        #print >>sys.stderr, x
     17        for y in x[1]:
     18            print 'gem install %s --version %s -y' % (x[0], y)
Note: See TracChangeset for help on using the changeset viewer.