aboutsummaryrefslogtreecommitdiff
path: root/cbc/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'cbc/utils.py')
-rw-r--r--cbc/utils.py19
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