From: "Alexis Ballier" <aballier@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/rospkg/files/, dev-python/rospkg/
Date: Wed, 16 Sep 2015 21:33:01 +0000 (UTC) [thread overview]
Message-ID: <1442439151.98d56a43b063e8961a2c2a1e497da87e57c2534e.aballier@gentoo> (raw)
commit: 98d56a43b063e8961a2c2a1e497da87e57c2534e
Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
AuthorDate: Wed Sep 16 21:32:31 2015 +0000
Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
CommitDate: Wed Sep 16 21:32:31 2015 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=98d56a43
dev-python/rospkg: Initial import. Ebuild by me.
Package-Manager: portage-2.2.20.1
dev-python/rospkg/Manifest | 1 +
dev-python/rospkg/files/norecurse.patch | 64 +++++++++++++++++++++++++++++++++
dev-python/rospkg/metadata.xml | 5 +++
dev-python/rospkg/rospkg-1.0.35.ebuild | 56 +++++++++++++++++++++++++++++
dev-python/rospkg/rospkg-9999.ebuild | 56 +++++++++++++++++++++++++++++
5 files changed, 182 insertions(+)
diff --git a/dev-python/rospkg/Manifest b/dev-python/rospkg/Manifest
new file mode 100644
index 0000000..c0522ad
--- /dev/null
+++ b/dev-python/rospkg/Manifest
@@ -0,0 +1 @@
+DIST rospkg-1.0.35.tar.gz 88589 SHA256 9ce13cb1d0f470f24cdb7f665d53948fcd0db19be7c8946ad998cbcf3998da30 SHA512 01e59dc3eb8290af661dc54902da950649a81b3caa0b65ad7dba18c0c6d0ba1ed08bec802edbced49f65515f20f1b8db719bfb576eb38c87982386aac22a2e31 WHIRLPOOL 20ebafd588c6cf8598d155cdd6ec76a9f1b7ce1bb9f1a545159a75d4fe5c3621005ea5abb5b15080716439bdec91a943855a564014eee295999126caed5c34e3
diff --git a/dev-python/rospkg/files/norecurse.patch b/dev-python/rospkg/files/norecurse.patch
new file mode 100644
index 0000000..4b7aae9
--- /dev/null
+++ b/dev-python/rospkg/files/norecurse.patch
@@ -0,0 +1,64 @@
+commit c2e06e0ea0b4a1cbb67049ab77a80f53646fb0b2
+Author: Alexis Ballier <aballier@gentoo.org>
+Date: Tue Dec 23 12:27:19 2014 +0100
+
+ Add support for rospack_norecurse to avoid recursing into all subdirectories when looking for a package.
+
+ I am installing ros into /usr, hence this searches in /usr/share. I have a lot of directories, not ROS related, into /usr/share (e.g. a full TeX Live install), and I get these timings:
+
+ Without rospack_norecurse in /usr/share:
+ $ time rosversion rospack
+ 2.2.5
+
+ real 0m2.861s
+ user 0m1.588s
+ sys 0m1.267s
+
+ With rospack_norecurse in /usr/share:
+ $ time rosversion rospack
+ 2.2.5
+
+ real 0m0.135s
+ user 0m0.100s
+ sys 0m0.034s
+
+ This is on a desktop with a SSD drive. On an arm board, with much less packages in /usr/share but way much slower I/O I remember hitting the 10 seconds timeout for roscore to start.
+
+diff --git a/src/rospkg/rospack.py b/src/rospkg/rospack.py
+index e55acec..7ed98de 100644
+--- a/src/rospkg/rospack.py
++++ b/src/rospkg/rospack.py
+@@ -42,7 +42,7 @@ from .stack import parse_stack_file, InvalidStack
+ _cache_lock = Lock()
+
+
+-def list_by_path(manifest_name, path, cache):
++def list_by_path(manifest_name, path, cache, recurse=True):
+ """
+ List ROS stacks or packages within the specified path.
+
+@@ -53,6 +53,7 @@ def list_by_path(manifest_name, path, cache):
+ :param manifest_name: MANIFEST_FILE or STACK_FILE, ``str``
+ :param path: path to list resources in, ``str``
+ :param cache: path cache to update. Maps resource name to directory path, ``{str: str}``
++ :param recurse: search recursively in subdirectories ``bool``
+ :returns: complete list of resources in ROS environment, ``[str]``
+ """
+ resources = []
+@@ -89,9 +90,15 @@ def list_by_path(manifest_name, path, cache):
+ # optimization for stacks.
+ del dirs[:]
+ continue #leaf
+- elif 'rospack_nosubdirs' in files:
++ elif 'rospack_nosubdirs' in files or not recurse:
+ del dirs[:]
+ continue #leaf
++ elif 'rospack_norecurse' in files:
++ for sd in dirs:
++ spath = os.path.join(d, sd)
++ resources += list_by_path(manifest_name, spath, cache, False)
++ del dirs[:]
++ continue
+ # remove hidden dirs (esp. .svn/.git)
+ [dirs.remove(di) for di in dirs if di[0] == '.']
+ return resources
diff --git a/dev-python/rospkg/metadata.xml b/dev-python/rospkg/metadata.xml
new file mode 100644
index 0000000..c42ea5b
--- /dev/null
+++ b/dev-python/rospkg/metadata.xml
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>ros</herd>
+</pkgmetadata>
diff --git a/dev-python/rospkg/rospkg-1.0.35.ebuild b/dev-python/rospkg/rospkg-1.0.35.ebuild
new file mode 100644
index 0000000..06dd93b
--- /dev/null
+++ b/dev-python/rospkg/rospkg-1.0.35.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+SCM=""
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://github.com/ros-infrastructure/rospkg"
+fi
+
+inherit ${SCM} distutils-r1
+
+DESCRIPTION="Standalone Python library for the ROS package system"
+HOMEPAGE="http://wiki.ros.org/rospkg"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SRC_URI=""
+ KEYWORDS=""
+ # Needed for tests
+ S="${WORKDIR}/${PN}"
+ EGIT_CHECKOUT_DIR="${S}"
+else
+ SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
+ http://github.com/ros-infrastructure/rospkg/archive/${PV}.tar.gz -> ${P}.tar.gz
+ "
+ KEYWORDS="~amd64 ~arm"
+fi
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="test"
+
+RDEPEND="dev-python/pyyaml[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/coverage[${PYTHON_USEDEP}]
+ )
+"
+PATCHES=(
+ "${FILESDIR}/norecurse.patch"
+)
+
+python_test() {
+ nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ # Avoid recursing into /usr/share when looking for packages.
+ dodir /usr/share
+ touch "${ED}/usr/share/rospack_norecurse"
+}
diff --git a/dev-python/rospkg/rospkg-9999.ebuild b/dev-python/rospkg/rospkg-9999.ebuild
new file mode 100644
index 0000000..06dd93b
--- /dev/null
+++ b/dev-python/rospkg/rospkg-9999.ebuild
@@ -0,0 +1,56 @@
+# Copyright 1999-2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+PYTHON_COMPAT=( python{2_7,3_3,3_4} )
+
+SCM=""
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SCM="git-r3"
+ EGIT_REPO_URI="http://github.com/ros-infrastructure/rospkg"
+fi
+
+inherit ${SCM} distutils-r1
+
+DESCRIPTION="Standalone Python library for the ROS package system"
+HOMEPAGE="http://wiki.ros.org/rospkg"
+if [ "${PV#9999}" != "${PV}" ] ; then
+ SRC_URI=""
+ KEYWORDS=""
+ # Needed for tests
+ S="${WORKDIR}/${PN}"
+ EGIT_CHECKOUT_DIR="${S}"
+else
+ SRC_URI="http://download.ros.org/downloads/${PN}/${P}.tar.gz
+ http://github.com/ros-infrastructure/rospkg/archive/${PV}.tar.gz -> ${P}.tar.gz
+ "
+ KEYWORDS="~amd64 ~arm"
+fi
+
+LICENSE="BSD"
+SLOT="0"
+IUSE="test"
+
+RDEPEND="dev-python/pyyaml[${PYTHON_USEDEP}]"
+DEPEND="${RDEPEND}
+ test? (
+ dev-python/nose[${PYTHON_USEDEP}]
+ dev-python/coverage[${PYTHON_USEDEP}]
+ )
+"
+PATCHES=(
+ "${FILESDIR}/norecurse.patch"
+)
+
+python_test() {
+ nosetests --with-coverage --cover-package=rospkg --with-xunit test || die
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ # Avoid recursing into /usr/share when looking for packages.
+ dodir /usr/share
+ touch "${ED}/usr/share/rospack_norecurse"
+}
next reply other threads:[~2015-09-16 21:33 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-16 21:33 Alexis Ballier [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-02-23 18:38 [gentoo-commits] repo/gentoo:master commit in: dev-python/rospkg/files/, dev-python/rospkg/ Alexis Ballier
2016-10-07 15:55 Alexis Ballier
2017-02-28 11:27 Alexis Ballier
2019-12-11 15:26 Alexis Ballier
2020-03-29 7:31 Michał Górny
2020-04-14 12:54 Alexis Ballier
2023-01-24 20:20 Jakov Smolić
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1442439151.98d56a43b063e8961a2c2a1e497da87e57c2534e.aballier@gentoo \
--to=aballier@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox