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

Clean up script entry points #185

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion scripts/rosdistro
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ def main():


if __name__ == "__main__":
main()
sys.exit(main())
4 changes: 2 additions & 2 deletions scripts/rosdistro_build_cache
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def main():
ignore_local=args.ignore_local, include_source=args.include_source, debug=args.debug)
except RuntimeError as e:
print(str(e), file=sys.stderr)
sys.exit(1)
return 1

for dist_name, cache in caches.items():
if args.dist_names and dist_name not in args.dist_names:
Expand All @@ -101,4 +101,4 @@ def main():


if __name__ == '__main__':
main()
sys.exit(main())
6 changes: 5 additions & 1 deletion scripts/rosdistro_convert
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,14 @@ def convert_doc(dist_name):
f.write(yaml_str)


if __name__ == '__main__':
def main():
targets = get_targets()
for distro in ['groovy', 'hydro']:
print('\nConverting "%s"\n' % distro)
convert_release(distro, targets)
convert_source(distro)
convert_doc(distro)


if __name__ == '__main__':
sys.exit(main())
2 changes: 1 addition & 1 deletion scripts/rosdistro_freeze_source
Original file line number Diff line number Diff line change
Expand Up @@ -95,4 +95,4 @@ def main():


if __name__ == '__main__':
main()
sys.exit(main())
2 changes: 1 addition & 1 deletion scripts/rosdistro_generate_cache
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ def main():


if __name__ == "__main__":
main()
sys.exit(main())
7 changes: 6 additions & 1 deletion scripts/rosdistro_migrate_to_rep_141
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import argparse
import gzip
import os
import sys

try:
from cStringIO import StringIO
Expand Down Expand Up @@ -163,9 +164,13 @@ def get_dict_parts(d, keys):
return data


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(description='Migrate the distros from REP 137 to REP 141.')
parser.add_argument('index', help='The index.yaml file to migrate')
args = parser.parse_args()

migrate(args.index)


if __name__ == "__main__":
sys.exit(main())
7 changes: 6 additions & 1 deletion scripts/rosdistro_migrate_to_rep_143
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

import argparse
import sys

from rosdistro.verify import _yaml_header_lines

Expand Down Expand Up @@ -32,9 +33,13 @@ def index_to_yaml(data):
return yaml_str


if __name__ == "__main__":
def main():
parser = argparse.ArgumentParser(description='Migrate the distros from REP 141 to REP 143.')
parser.add_argument('index', help='The index.yaml file to migrate')
args = parser.parse_args()

migrate(args.index)


if __name__ == "__main__":
sys.exit(main())
8 changes: 6 additions & 2 deletions scripts/rosdistro_reformat
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def parse_args(args=sys.argv[1:]):
return parser.parse_args(args)


if __name__ == '__main__':
def main():
args = parse_args()
index = args.index
if os.path.isfile(index):
Expand All @@ -64,4 +64,8 @@ if __name__ == '__main__':
success = verify_files_identical(index)
else:
success = reformat_files(index)
sys.exit(0 if success else 1)
return 0 if success else 1


if __name__ == '__main__':
sys.exit(main())
Loading