summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAuke Booij (tulcod) <auke@tulcod.com>2010-07-31 21:39:25 +0200
committerAuke Booij (tulcod) <auke@tulcod.com>2010-08-01 13:47:28 +0200
commitd98d38418903756c6af93a75c9bd6bf9d44b833b (patch)
tree441e2dae2566c737b42ae35a882b7a0550d71e24
parentMake MYDIR (diff)
downloadg-cran-d98d38418903756c6af93a75c9bd6bf9d44b833b.tar.gz
g-cran-d98d38418903756c6af93a75c9bd6bf9d44b833b.tar.bz2
g-cran-d98d38418903756c6af93a75c9bd6bf9d44b833b.zip
Add support for generating manifests
-rw-r--r--g_common/g_common.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/g_common/g_common.py b/g_common/g_common.py
index 17742bc..90fecfa 100644
--- a/g_common/g_common.py
+++ b/g_common/g_common.py
@@ -89,17 +89,23 @@ def generate_tree(repo_location):
driver_conf=read_driver_config(repo_conf['driver'])
ebuild_file=settings.COMMON_EBUILD_FILE #get from settings
+ import hashlib
+ ebuild_digest=hashlib.sha1(open(ebuild_file).read()).hexdigest()
+ Manifest="EBUILD %s SHA1 "+ebuild_digest
packages_list_pipe=subprocess.Popen(driver_conf['exec']+' '+repo_location+' list-packages',shell=True,stdout=subprocess.PIPE)
os.waitpid(packages_list_pipe.pid,0)
for line in packages_list_pipe.stdout:
category=line[:line.find("/")]
package=line[line.find("/")+1:line.find(" ")]
- version=line[line.find(" ")+1:]
+ version=line[line.find(" ")+1:-1]
ebuild_dir=os.path.join(repo_location,category,package)
if not os.path.exists(ebuild_dir):
os.makedirs(ebuild_dir)
- os.symlink(ebuild_file,os.path.join(ebuild_dir,package+'-'+version+'.ebuild'))
+ 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)
#list package details, in PMS's format
def action_package(repo_location,package_name):