Skip to content

Commit

Permalink
download Packages.gz instead of Packages (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
mathias-luedtke authored Sep 4, 2020
1 parent 9b2550a commit ab57137
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions docker_templates/packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

import gzip
import string
import re
import urllib.request
Expand All @@ -29,11 +30,11 @@
}

indexUrlTemplateLookup = {
'gazebo_packages': string.Template('http://packages.osrfoundation.org/gazebo/$os_name-$release/dists/$os_code_name/main/binary-$arch/Packages'),
'ros_packages': string.Template('http://packages.ros.org/ros/ubuntu/dists/$os_code_name/main/binary-$arch/Packages'),
'ros2_packages': string.Template('http://packages.ros.org/ros2/ubuntu/dists/$os_code_name/main/binary-$arch/Packages'),
'ros_packages_snapshots': string.Template('http://snapshots.ros.org/$rosdistro_name/final/ubuntu/dists/$os_code_name/main/binary-$arch/Packages'),
'ros2_packages_snapshots': string.Template('http://snapshots.ros.org/$ros2distro_name/final/ubuntu/dists/$os_code_name/main/binary-$arch/Packages'),
'gazebo_packages': string.Template('http://packages.osrfoundation.org/gazebo/$os_name-$release/dists/$os_code_name/main/binary-$arch/Packages.gz'),
'ros_packages': string.Template('http://packages.ros.org/ros/ubuntu/dists/$os_code_name/main/binary-$arch/Packages.gz'),
'ros2_packages': string.Template('http://packages.ros.org/ros2/ubuntu/dists/$os_code_name/main/binary-$arch/Packages.gz'),
'ros_packages_snapshots': string.Template('http://snapshots.ros.org/$rosdistro_name/final/ubuntu/dists/$os_code_name/main/binary-$arch/Packages.gz'),
'ros2_packages_snapshots': string.Template('http://snapshots.ros.org/$ros2distro_name/final/ubuntu/dists/$os_code_name/main/binary-$arch/Packages.gz'),
}

packageNameVersionTemplateLookup = {
Expand All @@ -54,7 +55,7 @@ def getPackageIndex(data, package_index_url):
# Download package index
req = urllib.request.Request(package_index_url)
with urllib.request.urlopen(req) as response:
package_index = response.read().decode('utf-8')
package_index = gzip.decompress(response.read()).decode('utf-8')

return package_index

Expand Down

0 comments on commit ab57137

Please sign in to comment.