diff options
| author | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-07 00:27:51 -0400 | 
|---|---|---|
| committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2015-07-07 00:27:51 -0400 | 
| commit | 83c8fd7a2411fdf356523b6243c294b5605a8afe (patch) | |
| tree | c0681e05b0c2197aafdf8363c07236ed960432f6 | |
| parent | 0cbf164badeeef519f3e514b763e3d9ffa4468c0 (diff) | |
| download | cbc-83c8fd7a2411fdf356523b6243c294b5605a8afe.tar.gz | |
Fix conda_search... I think.
| -rw-r--r-- | cbc/utils.py | 19 | 
1 files changed, 12 insertions, 7 deletions
diff --git a/cbc/utils.py b/cbc/utils.py index e276566..0ea8dd5 100644 --- a/cbc/utils.py +++ b/cbc/utils.py @@ -8,16 +8,20 @@ def conda_search(pkgname):      proc = Popen(command, stdout=PIPE)      out, _ = proc.communicate()     +    found = ''      for line in out.decode('utf-8').splitlines():          if line.startswith('#'):              continue -        line = line.split(); -        break -     + +        line = line.split() +         +        if line[0] == pkgname: +            found = line[:3] +              if not line:          return '' -    return '-'.join(line) +    return '-'.join(found)  def conda_install(pkgname): @@ -50,12 +54,13 @@ def conda_builder(metadata, args):      bad_egg = 'UNKNOWN.egg-info'      command = ['conda', 'build', metadata.env.pkgdir ] -         +      try: -        for line in (check_output(command).decode('utf-8').splitlines()): +        for line in (check_output(command, stderr=STDOUT).decode('utf-8').splitlines()):              if line.startswith('#'):                  continue              print(line) +                          if bad_egg in line:                  raise CondaBuildError('Bad setuptools metadata produced UNKNOWN.egg-info instead of {0}*.egg-info!'.format(metadata.local['package']['name']))                #OK Conda, let's play rough. stdout/stderr only, no exit for you. @@ -65,4 +70,4 @@ def conda_builder(metadata, args):          print(cpe)          return False -    return True
\ No newline at end of file +    return True  | 
