-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial OpenEmbedded support for rosdep
* Requires related changes in rospkg 1.1.8 and rosdistro ros/rosdistro#20763 * Let us map the generic system dependency name into a recipe name available from OE layer index at http://layers.openembedded.org * Mapping is based on PACKAGE_ARGUMENT free form format of <package>@<meta-layer>, where <package> resides in the OE <meta-layer> * Please see the proposal below: https://discourse.ros.org/t/a-proposal-for-a-superflore-oe-recipe-generation-scheme/8401
- Loading branch information
1 parent
fe63aaa
commit 24c3859
Showing
5 changed files
with
90 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# Copyright (c) 2019, LG Electronics, Inc. | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# * Neither the name of the Willow Garage, Inc. nor the names of its | ||
# contributors may be used to endorse or promote products derived from | ||
# this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
|
||
# Author Andre Rosa/[email protected] | ||
|
||
import subprocess | ||
from rospkg.os_detect import OS_OPENEMBEDDED, OsDetect | ||
from ..installers import PackageManagerInstaller | ||
OPKG_INSTALLER = 'opkg' | ||
|
||
|
||
def register_installers(context): | ||
context.set_installer(OPKG_INSTALLER, OpkgInstaller()) | ||
|
||
|
||
def register_platforms(context): | ||
register_oe(context) | ||
|
||
|
||
def register_oe(context): | ||
context.add_os_installer_key(OS_OPENEMBEDDED, OPKG_INSTALLER) | ||
context.set_default_os_installer_key(OS_OPENEMBEDDED, lambda self: OPKG_INSTALLER) | ||
context.set_os_version_type(OS_OPENEMBEDDED, OsDetect.get_codename) | ||
|
||
|
||
def opkg_detect(pkgs, exec_fn=None): | ||
""" | ||
Given a list of package, return the list of installed packages. | ||
:param pkgs: list of package names, optionally followed by a fixed version (`foo=3.0`) | ||
:param exec_fn: function to execute Popen and read stdout (for testing) | ||
:return: list elements in *pkgs* that were found installed on the system | ||
""" | ||
return [] | ||
|
||
|
||
class OpkgInstaller(PackageManagerInstaller): | ||
""" | ||
An implementation of the Installer for use on oe systems. | ||
""" | ||
|
||
def __init__(self): | ||
super(OpkgInstaller, self).__init__(opkg_detect) | ||
|
||
def get_version_strings(self): | ||
output = subprocess.check_output(['opkg', '--version']) | ||
version = output.splitlines()[0].split(' ')[2] | ||
return [('opkg {}').format(version)] | ||
|
||
def get_install_command(self, resolved, interactive=True, reinstall=False, quiet=False): | ||
packages = self.get_packages_to_install(resolved, reinstall=reinstall) | ||
if not packages: | ||
return [] | ||
base_cmd = ['opkg', 'install'] | ||
if quiet: | ||
base_cmd.append('-V') | ||
return [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters