summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Booij (tulcod) <auke@tulcod.com>2010-06-26 17:28:32 +0200
committerAuke Booij (tulcod) <auke@tulcod.com>2010-06-26 17:28:32 +0200
commit8ce78a541e384a9286c96c4ce953270fe76f57f1 (patch)
tree69abff930440045c1f497c15b081f0eefaa9f370
parentShould install correctly with distutils now. The g-cran script ends up in /us... (diff)
downloadg-cran-8ce78a541e384a9286c96c4ce953270fe76f57f1.tar.gz
g-cran-8ce78a541e384a9286c96c4ce953270fe76f57f1.tar.bz2
g-cran-8ce78a541e384a9286c96c4ce953270fe76f57f1.zip
Add generate-tree action
-rw-r--r--g_cran/g_cran.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/g_cran/g_cran.py b/g_cran/g_cran.py
index 0b84813..6e92d5d 100644
--- a/g_cran/g_cran.py
+++ b/g_cran/g_cran.py
@@ -24,6 +24,15 @@ def list_packages(repo_location):
for package in packages:
print 'dev-R/'+package.ebuild_vars['pn'],package.ebuild_vars['pv']
+def generate_tree(repo_location):
+ packages=read_packages(os.path.join(repo_location,REPO_MYDIR,'PACKAGES'),repo_location)
+ ebuild_file=os.path.join(os.path.dirname(__file__),'cran.ebuild')
+ for package in packages:
+ ebuild_dir=os.path.join(repo_location,'dev-R',package.ebuild_vars['pn'])
+ if !os.path.exists(ebuild_dir):
+ os.path.makedirs(ebuild_dir)
+ os.symlink(ebuild_file,os.path.join(ebuild_dir,package.ebuild_vars['pn']+'-'+package.ebuild_vars['pv']+'.ebuild'))
+
def action_package(repo_location,package_name):
defined_phases=[]
package=find_package(repo_location,package_name[package_name.find('/')+1:])
@@ -62,6 +71,8 @@ def main():
list_categories(repo_location)
elif action=='list-packages':
list_packages(repo_location)
+ elif action=='generate-tree':
+ generate_tree(repo_location)
elif action=='package':
if len(arguments)<3:
print "The 'package' action takes the following parameters:"