Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

do not overwrite pkg_map #42

Merged
merged 6 commits into from
Nov 21, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ notifications:
on_failure: always
env:
- ROS_DISTRO=indigo
script:
before_script:
- export CI_SOURCE_PATH=$(pwd)
- export REPOSITORY_NAME=${PWD##*/}
- if [ ! "$ROS_PARALLEL_JOBS" ]; then export ROS_PARALLEL_JOBS="-j8 -l8"; fi
Expand All @@ -28,7 +28,8 @@ script:
- git clone https://github.com/ros/actionlib actionlib -b ${ROS_DISTRO}-devel
- find actionlib -name CMakeLists.txt -exec sed -i 's@add_subdirectory(test)@#add_subdirectory(test)@' {} \;
- cd ..
- rosdep install -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
- rosdep install -q -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
script:
- source /opt/ros/$ROS_DISTRO/setup.bash
- catkin_make $ROS_PARALLEL_JOBS
# test for roseus
Expand All @@ -38,20 +39,25 @@ script:
- rm -fr devel build src/*
- cd src
- git clone http://github.com/jsk-ros-pkg/jsk_roseus /tmp/jsk_roseus
- (cd /tmp/jsk_roseus; git checkout `git describe --abbrev=0 --tags`)
- cp -r /tmp/jsk_roseus/roseus ./
#- sudo wget https://raw.githubusercontent.com/k-okada/jsk_roseus/fix_generate_all/roseus/scripts/generate-all-msg-srv.sh -O /opt/ros/hydro/share/roseus/scripts/generate-all-msg-srv.sh
- ln -s $CI_SOURCE_PATH . # Link the repo we are testing to the new workspace
- cd ..
# check roseus
- source /opt/ros/$ROS_DISTRO/setup.bash
- rm -fr build devel # need to clean up to check #42 case
- catkin build
- source devel/setup.bash
- cat devel/share/roseus/ros/roseus/manifest.l
- grep -c -e "/opt/ros/${ROS_DISTRO}/share/roseus/package.xml" devel/share/roseus/ros/roseus/manifest.l; [ "$?" == 1 ]; # check https://github.com/jsk-ros-pkg/geneus/pull/42
- rostest roseus test-genmsg.catkin.test
- rostest roseus test-genmsg-oneworkspace.catkin.launch
# check pr2eus
- git clone http://github.com/jsk-ros-pkg/jsk_pr2eus src/jsk_pr2eus
- (cd src/jsk_pr2eus; git checkout `git describe --abbrev=0 --tags`)
- sudo apt-get -qq -f install
- rosdep install -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
- rosdep install -q -r -n --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y
- sudo dpkg -r --force-depends ros-hydro-geneus
- catkin clean -a
- source /opt/ros/$ROS_DISTRO/setup.bash
Expand Down
16 changes: 13 additions & 3 deletions src/geneus/geneus_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,11 @@ def get_pkg_map():
for ws in workspaces.get_spaces():
pkgs = packages.find_packages(ws)
for pkg in pkgs.values():
pkg_map[pkg.name] = pkg
# packages.find_packages(workspaces.get_spaces()) returns package in high-priority-first-order, so we should not overwirte package map which is already found
# https://github.com/ros-infrastructure/catkin_pkg/blob/fa4b136b16e2d2886ab97257684f6bff243edefb/src/catkin_pkg/workspaces.py#L43
# https://github.com/ros-infrastructure/catkin_pkg/blob/fa4b136b16e2d2886ab97257684f6bff243edefb/src/catkin_pkg/packages.py#L71
if pkg.name not in pkg_map:
pkg_map[pkg.name] = pkg
return pkg_map

pkg_map = None
Expand Down Expand Up @@ -141,10 +145,16 @@ def genmain(argv, progname):
if 'geneus' in pkg_map:
pkg_filename = pkg_map['geneus'].filename
pkg_version = pkg_map['geneus'].version
f.write(";; THIS FILE IS AUTOMATICALLY GENERATED BY %s %s %s %s\n"%(__file__,pkg_filename,pkg_version,datetime.datetime.now()))
f.write(";;\n")
pkg = args[1] # ARG_PKG
pkg_dependences = package_depends(pkg) + args[2:] # args[1] ARG_PKG
# write debug information
f.write(";; THIS FILE IS AUTOMATICALLY GENERATED in %s\n"%(datetime.datetime.now()))
try:
f.write(";; FROM %s (%s)\n"%(pkg_map[pkg].filename, pkg_map[pkg].version))
f.write(";; USING %s %s (%s)\n"%(__file__,pkg_filename,pkg_version))
except:
pass
f.write(";;\n")
# load all dependences and then load target package
for p in pkg_dependences:
f.write("(ros::load-ros-package \"%s\")\n"%p)
Expand Down