ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Is there a way to set defaults for package.xml (Maintainer name

asked 2015-03-06 18:20:53 -0500

Benjamin Blumer gravatar image

I'm hoping to set it so that when I catkin_create_pkg the package.xml will be populated with my name as the maintainer and my email address as the maintainer email. It'd also be a bonus to have GPLV3 set as the license.

Is there anyway to achieve this?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2015-03-07 12:18:01 -0500

Wolf gravatar image

updated 2015-03-09 02:55:17 -0500

Yes it is. See the output of catkin_create_pkg --help

catkin_create_pkg --help
usage: catkin_create_pkg [-h] [-s [SYS_DEPS [SYS_DEPS ...]]]
                         [-b [BOOST_COMPS [BOOST_COMPS ...]]] [-V PKG_VERSION]
                         [-D DESCRIPTION] [-l LICENSE] [-a AUTHOR]
                         [-m MAINTAINER] [--rosdistro ROSDISTRO]
                         name [dependencies [dependencies ...]]

Creates a new catkin package

positional arguments:
  name                  The name for the package
  dependencies          Catkin package Dependencies

optional arguments:
  -h, --help            show this help message and exit
  -s [SYS_DEPS [SYS_DEPS ...]], --sys-deps [SYS_DEPS [SYS_DEPS ...]]
                        System Dependencies
  -b [BOOST_COMPS [BOOST_COMPS ...]], --boost-comps [BOOST_COMPS [BOOST_COMPS ...]]
                        Boost Components
  -V PKG_VERSION, --pkg_version PKG_VERSION
                        Initial Package version
  -D DESCRIPTION, --description DESCRIPTION
                        Description
  -l LICENSE, --license LICENSE
                        Name for License, (e.g. BSD, MIT, GPLv3...)
  -a AUTHOR, --author AUTHOR
                        A single author, may be used multiple times
  -m MAINTAINER, --maintainer MAINTAINER
                        A single maintainer, may be used multiple times
  --rosdistro ROSDISTRO
                        The ROS distro (default: environment variable
                        ROS_DISTRO if defined)

If you want to "permanently" fix some of these settings for your on your machine it's probably the easiest way to add a bash alias to your ~/.bashrc file as @ahendrix suggested in his comment:

alias my_create_pkg catkin_create_pkg -l GPLv3 -a nobody@nowhere.com

Then call it anywhere like

my_create_pkg my_new_package_name roscpp other_depending_package
edit flag offensive delete link more

Comments

1

I think @Benjamin Blumer is asking for a way to configure this once, so that it will be used in all future invocations of catkin_create_pkg. The command line options you showed do allow users to specify values to be set, but this will have to be repeated each invocation of catkin_create_pkg.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-07 13:09:19 -0500 )edit
2

Even if this can't be set in a config file, it should be possible to create a bash alias which passes the desired arguments, something like alias my_create_pkg catkin_create_pkg -l GPLv3 -a nobody@nowhere.com

ahendrix gravatar image ahendrix  ( 2015-03-07 14:45:04 -0500 )edit

@Wolf: I think you'll need to append $* to that. Not for an alias, obviously.

gvdhoorn gravatar image gvdhoorn  ( 2015-03-09 03:07:45 -0500 )edit

Yeah, I was hoping for a ROS config file to edit. In the absence of such a file, I'll settle for making an alias.

Benjamin Blumer gravatar image Benjamin Blumer  ( 2015-03-10 17:03:05 -0500 )edit

Has something happend in this time to this topic? Just want to put the maintainer information in, but the command only takes my name, not my email address.

AlexChris003 gravatar image AlexChris003  ( 2018-02-23 11:28:32 -0500 )edit

Same here, still looking for a decent way to set default values once for all. Hopefully something like git global configuration file would emerge.

huangzonghao gravatar image huangzonghao  ( 2019-04-27 23:01:04 -0500 )edit

@AlexChris003 and @huangzonghao: the fastest way to get this implemented would be to contribute a PR yourself. Waiting for others to do this will probably not result in things moving quickly.

gvdhoorn gravatar image gvdhoorn  ( 2019-04-28 08:12:02 -0500 )edit

@gvdhoorn Yep, everyone knows that.

huangzonghao gravatar image huangzonghao  ( 2019-04-28 11:00:13 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-06 18:20:53 -0500

Seen: 1,068 times

Last updated: Mar 09 '15