Skip to content

Commit

Permalink
Remove support for pip-style repository URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke committed Jan 29, 2021
1 parent a7a51c9 commit 42376ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ Each workspace can be composed as a sequence of the following items:
* ``bitbucket`` for Bitbucket repositories
* ``git``/``git+*``: for any other git repository

For convenience ``@`` (pip-style) can be used as a separator as well.
Please note that a version is mandatory. If you really want to use the default branch, which is error-prone and therefore not recommended, you can set it to ``HEAD``.

* URL (=starts with http or https) of a ``*.repos`` or ``*.rosinstall`` file
Expand Down
2 changes: 1 addition & 1 deletion industrial_ci/_wrap_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ set -e # exit script on errors
if [ -n "$_EXTERNAL_REPO" ]; then
export TRAVIS_BUILD_DIR; TRAVIS_BUILD_DIR=$(mktemp -d)
source ./industrial_ci/src/workspace.sh
IFS=" " read -r -a parts <<< "$(ici_resolve_scheme "$_EXTERNAL_REPO")" # name, type, url, version
IFS=" " read -r -a parts <<< "$(ici_parse_repository_url "$_EXTERNAL_REPO")" # name, type, url, version
echo "Cloning '${parts[2]}'...'"
git clone -q "${parts[2]}" "$TRAVIS_BUILD_DIR"
git -C "$TRAVIS_BUILD_DIR" checkout "${parts[3]}"
Expand Down
9 changes: 4 additions & 5 deletions industrial_ci/src/workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@

export _DEFAULT_DEBS=${_DEFAULT_DEBS:-}

function ici_resolve_scheme {
function ici_parse_repository_url {
local url=$1; shift
if [[ $url =~ ([^:]+):([^#@]+)[#@](.+) ]]; then
if [[ $url =~ ([^:]+):([^#]+)#(.+) ]]; then
local fragment="${BASH_REMATCH[3]}"
local repo=${BASH_REMATCH[2]}
local name=${repo##*/}
Expand Down Expand Up @@ -49,7 +49,6 @@ function ici_resolve_scheme {
else
ici_error "Could not parse URL '$url'. It does not match the expected pattern: <scheme>:<resource>#<version>."
fi

}

function ici_apt_install {
Expand Down Expand Up @@ -128,8 +127,8 @@ function ici_import_repository {

ici_install_pkgs_for_command vcs python3-vcstool

local resolved; resolved=$(ici_resolve_scheme "$url")
IFS=" " read -r -a parts <<< "$resolved" # name, type, url, version
local parsed; parsed=$(ici_parse_repository_url "$url")
IFS=" " read -r -a parts <<< "$parsed" # name, type, url, version
echo "${parts[*]}"

case "${parts[1]}" in
Expand Down

0 comments on commit 42376ea

Please sign in to comment.