Merge "Replace more then just "-" in REPONAME"

This commit is contained in:
Jenkins 2014-03-11 12:51:31 +00:00 committed by Gerrit Code Review
commit ffdd57b8a5
2 changed files with 12 additions and 4 deletions

View File

@ -23,9 +23,17 @@ diskimage-builder which can change the details registered by the element, these
DIB_REPOLOCATION_<name> : change the registered location DIB_REPOLOCATION_<name> : change the registered location
DIB_REPOREF_<name> : change the registered reference DIB_REPOREF_<name> : change the registered reference
for example if you would like diskimage-builder to get ironic from a local For example if you would like diskimage-builder to get ironic from a local
mirror you could set DIB_REPOLOCATION_ironic=git://localgitserver/ironic.git mirror you could set DIB_REPOLOCATION_ironic=git://localgitserver/ironic.git
*As you can see above, the \<name\> of the repo is used in several bash
variables. In order to make this syntactically feasible, any characters not in
the set \[A-Za-z0-9_\] will be converted to \_*
*For instance, a repository named "diskimage-builder" would set a variable called
"DIB_REPOTYPE_diskimage_builder"*
Alternatively if you would like to use the keystone element and build an image with Alternatively if you would like to use the keystone element and build an image with
keystone from a stable branch then you would set DIB_REPOREF_keystone=stable/grizzly keystone from a stable branch then you would set DIB_REPOREF_keystone=stable/grizzly

View File

@ -31,15 +31,15 @@ function get_repos_for_element(){
local REPO_SUB_DIRECTORY=$(dirname $REPO_DEST) local REPO_SUB_DIRECTORY=$(dirname $REPO_DEST)
# REPOTYPE can be overridden with DIB_REPOTYPE_{name} # REPOTYPE can be overridden with DIB_REPOTYPE_{name}
local REPOTYPE_OVERRIDE=DIB_REPOTYPE_${REPONAME//-/_} local REPOTYPE_OVERRIDE=DIB_REPOTYPE_${REPONAME//[^A-Za-z0-9]/_}
REPOTYPE=${!REPOTYPE_OVERRIDE:-$REPOTYPE} REPOTYPE=${!REPOTYPE_OVERRIDE:-$REPOTYPE}
# REPOLOCATION can be overridden with DIB_REPOLOCATION_{name} # REPOLOCATION can be overridden with DIB_REPOLOCATION_{name}
local REPOLOCATION_OVERRIDE=DIB_REPOLOCATION_${REPONAME//-/_} local REPOLOCATION_OVERRIDE=DIB_REPOLOCATION_${REPONAME//[^A-Za-z0-9]/_}
REPOLOCATION=${!REPOLOCATION_OVERRIDE:-$REPOLOCATION} REPOLOCATION=${!REPOLOCATION_OVERRIDE:-$REPOLOCATION}
# REPOREF can be overridden with DIB_REPOREF_{name} # REPOREF can be overridden with DIB_REPOREF_{name}
local REPOREF_OVERRIDE=DIB_REPOREF_${REPONAME//-/_} local REPOREF_OVERRIDE=DIB_REPOREF_${REPONAME//[^A-Za-z0-9]/_}
REPOREF=${!REPOREF_OVERRIDE:-$REPOREF} REPOREF=${!REPOREF_OVERRIDE:-$REPOREF}
# Determine a unique cache path for this repo # Determine a unique cache path for this repo