diff options
author | 2010-08-04 11:31:55 +0200 | |
---|---|---|
committer | 2010-08-04 11:31:55 +0200 | |
commit | bcbb02c4cf40e6519525a771c11da1b1cfcba3d6 (patch) | |
tree | 504ee52e51eed3469f091cd1f5e30ffd0ad415bc | |
parent | Add generate-metadata action to g-cran, small fix in generate-tree action of ... (diff) | |
download | g-cran-bcbb02c4cf40e6519525a771c11da1b1cfcba3d6.tar.gz g-cran-bcbb02c4cf40e6519525a771c11da1b1cfcba3d6.tar.bz2 g-cran-bcbb02c4cf40e6519525a771c11da1b1cfcba3d6.zip |
Fix a bug where drivers don't exit because of a filled buffer
-rw-r--r-- | g_common/g_common.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/g_common/g_common.py b/g_common/g_common.py index c1df781..33b7664 100644 --- a/g_common/g_common.py +++ b/g_common/g_common.py @@ -97,11 +97,8 @@ def generate_tree(repo_location,generate_manifest,generate_metadata): #create directory structure packages_list_pipe=subprocess.Popen(driver_conf['exec']+' '+repo_location+' list-packages',shell=True,stdout=subprocess.PIPE) - os.waitpid(packages_list_pipe.pid,0) - if packages_list_pipe.returncode: - return returncode packages=[] - for line in packages_list_pipe.stdout: + for line in iter(packages_list_pipe.stdout.readline,''): category=line[:line.find("/")] package=line[line.find("/")+1:line.find(" ")] version=line[line.find(" ")+1:-1] @@ -109,6 +106,9 @@ def generate_tree(repo_location,generate_manifest,generate_metadata): packages.append(line) if not os.path.exists(ebuild_dir): #obvious race condition, but whatever os.makedirs(ebuild_dir) + os.waitpid(packages_list_pipe.pid,0) + if packages_list_pipe.returncode: + return returncode os.makedirs(os.path.join(repo_location,'profiles')) #call driver generate-metadata to give it a chance to fill up the repo |