diff --git a/elements/source-repositories/README.md b/elements/source-repositories/README.md index f72168f0..7ed9c9b6 100644 --- a/elements/source-repositories/README.md +++ b/elements/source-repositories/README.md @@ -23,9 +23,17 @@ diskimage-builder which can change the details registered by the element, these DIB_REPOLOCATION_ : change the registered location DIB_REPOREF_ : 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 +*As you can see above, the \ 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 keystone from a stable branch then you would set DIB_REPOREF_keystone=stable/grizzly diff --git a/elements/source-repositories/extra-data.d/98-source-repositories b/elements/source-repositories/extra-data.d/98-source-repositories index 61bc9618..ae08f1e2 100755 --- a/elements/source-repositories/extra-data.d/98-source-repositories +++ b/elements/source-repositories/extra-data.d/98-source-repositories @@ -29,15 +29,15 @@ function get_repos_for_element(){ local REPO_SUB_DIRECTORY=$(dirname $REPO_DEST) # 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} # 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} # 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} # Determine a unique cache path for this repo