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

install_geographiclib_datasets.sh fails on empty directories #867

Closed
fnoop opened this issue Nov 20, 2017 · 3 comments
Closed

install_geographiclib_datasets.sh fails on empty directories #867

fnoop opened this issue Nov 20, 2017 · 3 comments

Comments

@fnoop
Copy link
Contributor

fnoop commented Nov 20, 2017

Issue details

If download of the geographiclib datasets fails for any reason (like it hangs downloading or can't reach), it leaves empty subdirectories of /usr/share/GeographicLib. The bash script only checks for existence of these directories, not of the datasets within so any subsequent runs of the script do nothing even if the datasets are not present.

Instead, it should check for the actual files. Change:

	if [[ -d "/usr/share/GeographicLib/$dir" or -d "/usr/local/share/GeographicLib/$dir" ]]; then
		return
	fi

to (eg.)

	files=$(shopt -s nullglob dotglob; echo /usr/share/GeographicLib/$dir/$model* /usr/local/share/GeographicLib/$dir/$model*)
	if (( ${#files} )); then
		return
	fi

MAVROS version and platform

Mavros: master
ROS: Lunar
Ubuntu: Debian 9 / Ubuntu 16.04

@TSC21
Copy link
Member

TSC21 commented Nov 20, 2017

Thanks for pointing that @fnoop. Would you mind making a PR with this change? Thanks

@fnoop
Copy link
Contributor Author

fnoop commented Nov 20, 2017

Sure, PR #868 raised

@TSC21
Copy link
Member

TSC21 commented Nov 29, 2017

Closed by #868

@TSC21 TSC21 closed this as completed Nov 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants