ros-infrastructure/rosdep — pull request #365 by wjwwood (2014-12-04 19:44:26+00:00)
Title: Alternative patch to support REP-143

This patch just changes the hashing function to support lists of strings rather than just a single string. This allows the cache to be hashed on a list of urls rather than a single one.

The list of urls is also passed to the internal `self.url` in the DataSource object, but this isn't a problem in any code paths which use the rosdistro files as a source from what I can tell. The `self.url` seems to only be used for debug output, including the `index` file at the root of the cache which lists the files that make up the cache. In this case you get something like this:

```
# First with regular rosdep
% rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://github.com/ros/rosdistro/raw/master/rosdep/osx-homebrew.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/gentoo.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/ruby.yaml
Hit https://github.com/ros/rosdistro/raw/master/releases/fuerte.yaml
Ignore legacy gbpdistro "groovy"
Ignore legacy gbpdistro "hydro"
Query rosdistro index https://raw.github.com/ros/rosdistro/master/index.yaml
Add distro "groovy"
Add distro "hydro"
Add distro "indigo"
updated cache in /Users/william/.ros/rosdep/sources.cache

% cat /Users/william/.ros/rosdep/sources.cache/index
#autogenerated by rosdep, do not edit. use 'rosdep update' instead
yaml https://github.com/ros/rosdistro/raw/master/rosdep/osx-homebrew.yaml osx
yaml https://github.com/ros/rosdistro/raw/master/rosdep/gentoo.yaml gentoo
yaml https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml
yaml https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml
yaml https://github.com/ros/rosdistro/raw/master/rosdep/ruby.yaml
yaml https://github.com/ros/rosdistro/raw/master/releases/fuerte.yaml fuerte
yaml https://raw.github.com/ros/rosdistro/master/groovy/distribution.yaml groovy
yaml https://raw.github.com/ros/rosdistro/master/hydro/distribution.yaml hydro
yaml https://raw.github.com/ros/rosdistro/master/indigo/distribution.yaml indigo

# Then with the modified rosdep and rosdistro
% ROSDISTRO_INDEX_URL=https://raw.githubusercontent.com/ros/rosdistro/ec2test/index.yaml /tmp/rosdep_rep_143/bin/rosdep update
reading in sources list data from /etc/ros/rosdep/sources.list.d
Hit https://github.com/ros/rosdistro/raw/master/rosdep/osx-homebrew.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/gentoo.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml
Hit https://github.com/ros/rosdistro/raw/master/rosdep/ruby.yaml
Hit https://github.com/ros/rosdistro/raw/master/releases/fuerte.yaml
Ignore legacy gbpdistro "groovy"
Ignore legacy gbpdistro "hydro"
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/ec2test/index.yaml
Add distro "groovy"
Add distro "hydro"
Add distro "indigo"
updated cache in /Users/william/.ros/rosdep/sources.cache

% cat /Users/william/.ros/rosdep/sources.cache/index
#autogenerated by rosdep, do not edit. use 'rosdep update' instead
yaml https://github.com/ros/rosdistro/raw/master/rosdep/osx-homebrew.yaml osx
yaml https://github.com/ros/rosdistro/raw/master/rosdep/gentoo.yaml gentoo
yaml https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml
yaml https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml
yaml https://github.com/ros/rosdistro/raw/master/rosdep/ruby.yaml
yaml https://github.com/ros/rosdistro/raw/master/releases/fuerte.yaml fuerte
yaml ['https://raw.githubusercontent.com/ros/rosdistro/ec2test/groovy/distribution.yaml'] groovy
yaml ['https://raw.githubusercontent.com/ros/rosdistro/ec2test/hydro/distribution.yaml'] hydro
yaml ['https://raw.githubusercontent.com/ros/rosdistro/ec2test/indigo/distribution.yaml'] indigo
```

Which I think is ok. I can optionally change it so that for the `self.url` it just takes the first url, but my opinion is that this patch is good as it stands.