Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add --upstream-repo argument #128

Merged
merged 4 commits into from
Feb 6, 2018
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 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ install:
script:
- sudo rosdep init
- rosdep update
- python -m 'nose' --exclude test_pull
- python -m 'nose' --exclude test_pull --exclude test_run
- python -m 'flake8' superflore --import-order-style=google
22 changes: 21 additions & 1 deletion superflore/generators/bitbake/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@ def main():
help='comment to add to the PR',
type=str
)
parser.add_argument(
'--upstream-repo',
help='location of the upstream repository',
type=str
)
selected_targets = active_distros
args = parser.parse_args(sys.argv[1:])
pr_comment = args.pr_comment
Expand All @@ -81,13 +86,28 @@ def main():
warn('"{0}" distro detected...'.format(args.ros_distro))
selected_targets = [args.ros_distro]
preserve_existing = False
repo_org = 'allenh1'
repo_name = 'meta-ros'
if args.upstream_repo:
# check the repo is GitHub
if 'github.com' not in args.upstream_repo:
raise RuntimeError('Non-GitHub repos are not supported!')
upstream = args.upstream_repo
upstream = upstream.replace('https://github.com/', '').split('/')
repo_org = upstream[0]
repo_name = upstream[1]
# open cached tar file if it exists
with TempfileManager(args.output_repository_path) as _repo:
if not args.output_repository_path:
# give our group write permissions to the temp dir
os.chmod(_repo, 17407)
# clone if args.output-repository_path is None
overlay = RosMeta(_repo, not args.output_repository_path)
overlay = RosMeta(
_repo,
not args.output_repository_path,
org=repo_org,
repo=repo_name
)
if not args.only:
pr_comment = pr_comment or (
'Superflore yocto generator began regeneration of all ' +
Expand Down
22 changes: 21 additions & 1 deletion superflore/generators/ebuild/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ def main():
help='comment to add to the PR',
type=str
)
parser.add_argument(
'--upstream-repo',
help='location of the upstream repository',
type=str
)
args = parser.parse_args(sys.argv[1:])
pr_comment = args.pr_comment
selected_targets = None
Expand Down Expand Up @@ -125,12 +130,27 @@ def main():
sys.exit(1)
if not selected_targets:
selected_targets = active_distros
repo_org = 'ros'
repo_name = 'ros-overlay'
if args.upstream_repo:
# check that the upstream_repo is a github repo
if 'github.com' not in args.upstream_repo:
raise RuntimeError('Non-GitHub repos are not supported!')
upstream = args.upstream_repo
upstream = upstream.replace('https://github.com/', '').split('/')
repo_org = upstream[0]
repo_name = upstream[1]
with TempfileManager(args.output_repository_path) as _repo:
if not args.output_repository_path:
# give our group write permissions to the temp dir
os.chmod(_repo, 17407)
# clone if args.output_repository_path is None
overlay = RosOverlay(_repo, not args.output_repository_path)
overlay = RosOverlay(
_repo,
not args.output_repository_path,
org=repo_org,
repo=repo_name
)
if not preserve_existing and not args.only:
pr_comment = pr_comment or (
'Superflore ebuild generator began regeneration of all'
Expand Down