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

Optionally supress sudo rosdep update warning with flag #915

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion src/rosdep2/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,9 @@ def _rosdep_main(args):
default=[], action='append',
help='Dependency types to install, can be given multiple times. '
'Choose from {}. Default: all except doc.'.format(VALID_DEPENDENCY_TYPES))
parser.add_option('--supress-warning-sudo', dest='supress_warning_sudo', default=False,
action='store_true', help='Suppress warning about sudo usage. '
'This is useful if you are using rosdep in a docker container.')

options, args = parser.parse_args(args)
if options.print_version or options.print_all_versions:
Expand Down Expand Up @@ -655,7 +658,7 @@ def update_error_handler(data_source, exc):
print('reading in sources list data from %s' % (sources_list_dir))
sources_cache_dir = get_sources_cache_dir()
try:
if os.geteuid() == 0:
if os.geteuid() == 0 and not options.supress_warning_sudo:
print("Warning: running 'rosdep update' as root is not recommended.", file=sys.stderr)
print(" You should run 'sudo rosdep fix-permissions' and invoke 'rosdep update' again without sudo.", file=sys.stderr)
except AttributeError:
Expand Down