diff options
author | Auke Booij (tulcod) <auke@tulcod.com> | 2010-08-01 19:31:36 +0200 |
---|---|---|
committer | Auke Booij (tulcod) <auke@tulcod.com> | 2010-08-01 19:31:36 +0200 |
commit | e8415add21f267ccc48d33bf352f4f9aa9e82535 (patch) | |
tree | c02482860a831e6f61a50c86404607c0a2121bf3 /g_common | |
parent | Fix Manifest generation: forgot filesize field (diff) | |
download | g-cran-e8415add21f267ccc48d33bf352f4f9aa9e82535.tar.gz g-cran-e8415add21f267ccc48d33bf352f4f9aa9e82535.tar.bz2 g-cran-e8415add21f267ccc48d33bf352f4f9aa9e82535.zip |
Conditional metadata+manifest generation
Diffstat (limited to 'g_common')
-rw-r--r-- | g_common/g_common.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/g_common/g_common.py b/g_common/g_common.py index d9ca599..31057e5 100644 --- a/g_common/g_common.py +++ b/g_common/g_common.py @@ -77,10 +77,13 @@ def list_packages(repo_location): #generate a tree of ebuilds... note that we only link ebuild files, instead of generating them #we will, however, generate metadata.xml and Manifest files -def generate_tree(repo_location): +def generate_tree(repo_location,generate_manifest,generate_metadata): repo_conf=read_repo_config(repo_location) driver_conf=read_driver_config(repo_conf['driver']) + if generate_metadata: + raise NotImplementedError + ebuild_file=settings.COMMON_EBUILD_FILE #get from settings import hashlib ebuild_digest=hashlib.sha1(open(ebuild_file).read()).hexdigest() @@ -97,8 +100,9 @@ def generate_tree(repo_location): os.makedirs(ebuild_dir) package_file=package+'-'+version+'.ebuild' os.symlink(ebuild_file,os.path.join(ebuild_dir,package_file)) - manifest_file=open(os.path.join(ebuild_dir,'Manifest'),"w") - manifest_file.write(Manifest % package_file) + if generate_manifest: + manifest_file=open(os.path.join(ebuild_dir,'Manifest'),"w") + manifest_file.write(Manifest % package_file) return 0 #list package details, in PMS's format @@ -146,7 +150,16 @@ def main(): elif action=='list-packages': return list_packages(repo_location) elif action=='generate-tree': - return generate_tree(repo_location) + if '--without-manifest' in arguments: + manifest=False + else: + manifest=True + if '--without-metadata' in arguments: + metadata=False + else: + metadata=True + + return generate_tree(repo_location,manifest,metadata) elif action=='package': if len(arguments)<3 or 'help' in arguments: print "The 'package' action takes the following parameters:" |