/[soft]/mga-gnome/trunk/mga-gnome
ViewVC logotype

Diff of /mga-gnome/trunk/mga-gnome

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3449 by ovitters, Tue Mar 13 21:57:09 2012 UTC revision 3498 by ovitters, Thu Mar 15 13:08:18 2012 UTC
# Line 472  def get_upstream_names(): Line 472  def get_upstream_names():
472  def get_downstream_names():  def get_downstream_names():
473      re_file = re.compile(r'^(?P<module>.*?)[_-](?:(?P<oldversion>([0-9]+[\.])*[0-9]+)-)?(?P<version>([0-9]+[\.\-])*[0-9]+)\.(?P<format>(?:tar\.|diff\.)?[a-z][a-z0-9]*)$')      re_file = re.compile(r'^(?P<module>.*?)[_-](?:(?P<oldversion>([0-9]+[\.])*[0-9]+)-)?(?P<version>([0-9]+[\.\-])*[0-9]+)\.(?P<format>(?:tar\.|diff\.)?[a-z][a-z0-9]*)$')
474    
475      contents = subprocess.check_output(['urpmf', '--files', '.', "--media", MEDIA], close_fds=True).strip("\n").splitlines()      contents = subprocess.check_output(['urpmf', '--qf', '%name|%version|%files', '.', "--media", MEDIA], close_fds=True).strip("\n").splitlines()
476    
477      FILES = {}      FILES = {}
478      TARBALLS = {}      TARBALLS = {}
479    
480      for line in  contents:      for line in  contents:
481          try:          try:
482              srpm, filename = line.split(":")              srpm, version, filename = line.split("|")
483          except ValueError:          except ValueError:
484              print >>sys.stderr, line              print >>sys.stderr, line
485              continue              continue
# Line 491  def get_downstream_names(): Line 491  def get_downstream_names():
491                  module = fileinfo['module']                  module = fileinfo['module']
492    
493                  if module not in TARBALLS:                  if module not in TARBALLS:
494                      TARBALLS[module] = set()                      TARBALLS[module] = {}
495                  TARBALLS[module].add(srpm)                  TARBALLS[module][srpm] = version
496    
497          if srpm not in FILES:          if srpm not in FILES:
498              FILES[srpm] = set()              FILES[srpm] = set()
# Line 509  def get_downstream_from_upstream(upstrea Line 509  def get_downstream_from_upstream(upstrea
509    
510      if len(downstream[upstream]) != 1:      if len(downstream[upstream]) != 1:
511          # XXX - Make it more intelligent          # XXX - Make it more intelligent
512          raise ValueError("Multiple packages found for %s: %s" % (upstream, ", ".join(downstream[upstream])))          raise ValueError("Multiple packages found for %s: %s" % (upstream, ", ".join(downstream[upstream].keys())))
513    
514      return list(downstream[upstream])      return downstream[upstream].keys()
515    
516  def write_file(path, data):  def write_file(path, data):
517      with tempfile.NamedTemporaryFile(dir=os.path.dirname(path), delete=False) as fdst:      with tempfile.NamedTemporaryFile(dir=os.path.dirname(path), delete=False) as fdst:
# Line 527  def cmd_co(options, parser): Line 527  def cmd_co(options, parser):
527    
528      matches = upstream & set(downstream.keys())      matches = upstream & set(downstream.keys())
529      for module in matches:      for module in matches:
530          print module, "\t".join(downstream[module])          print module, "\t".join(downstream[module].keys())
531          for package in downstream[module]:          for package in downstream[module].keys():
532              subprocess.call(['mgarepo', 'co', package], cwd=cwd)              subprocess.call(['mgarepo', 'co', package], cwd=cwd)
533    
534  def join_streams():  def join_streams():
# Line 537  def join_streams(): Line 537  def join_streams():
537    
538      matches = upstream & set(downstream.keys())      matches = upstream & set(downstream.keys())
539      for module in matches:      for module in matches:
540          for package in downstream[module]:          for package in downstream[module].keys():
541              yield (package, module)              yield (package, module)
542    
543  def cmd_ls(options, parser):  def cmd_ls(options, parser):
# Line 554  def cmd_patches(options, parser): Line 554  def cmd_patches(options, parser):
554    
555      matches = upstream & set(downstream.keys())      matches = upstream & set(downstream.keys())
556      for module in sorted(matches):      for module in sorted(matches):
557          for srpm in downstream[module]:          for srpm in downstream[module].keys():
558              for filename in downstream_files[srpm]:              for filename in downstream_files[srpm]:
559                  if '.patch' in filename or '.diff' in filename:                  if '.patch' in filename or '.diff' in filename:
560    

Legend:
Removed from v.3449  
changed lines
  Added in v.3498

  ViewVC Help
Powered by ViewVC 1.1.30