diff options
author | 2010-08-03 22:49:17 +0200 | |
---|---|---|
committer | 2010-08-03 22:49:17 +0200 | |
commit | 37dcd30b6236b33d7785aabbfa94ea66539371ef (patch) | |
tree | 2da48c3dbcf1d548ee56813af013cdeed96ce529 /g_common | |
parent | Write metadata.xml, clean repo, populate profiles/, call drivers' generate-ma... (diff) | |
download | g-cran-37dcd30b6236b33d7785aabbfa94ea66539371ef.tar.gz g-cran-37dcd30b6236b33d7785aabbfa94ea66539371ef.tar.bz2 g-cran-37dcd30b6236b33d7785aabbfa94ea66539371ef.zip |
Add generate-metadata action to g-cran, small fix in generate-tree action of g-common
Diffstat (limited to 'g_common')
-rw-r--r-- | g_common/g_common.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/g_common/g_common.py b/g_common/g_common.py index e7c8ca1..c1df781 100644 --- a/g_common/g_common.py +++ b/g_common/g_common.py @@ -139,12 +139,14 @@ def generate_tree(repo_location,generate_manifest,generate_metadata): metadata_file.close() #write repo metadata if not os.path.exists(os.path.join(repo_location,'profiles','repo_name')): + import string #make up a name #as a lucky guess, use the last part of the repo_location directory location repo_location_parts=os.path.split(repo_location) if len(repo_location_parts): #repo might be locaten in /... unlikely, but i was in a good mood while typing this + #name chars must be in [a-zA-Z_-] and must not start with a - raw_name=repo_location_parts[-1] - name=''.join([x for x in raw_name if x.isalnum() or x=='_' or x=='-']) #hope that there won't be any utf8 issues + name=''.join([x for x in raw_name if x in string.ascii_letters+string.digits or x=='_' or x=='-']) if name[0]=='-': #name may not begin with a hyphen name=name[1:] else: |