Skip to content

Commit

Permalink
[migration-tools] Copy bloom .ignored file if source distribution has…
Browse files Browse the repository at this point in the history
… one. (ros#25477)

Somehow none of the repositories which had ignored packages tripped any
build alarms as I was using this script in testing. Support for ignored
files was added by checking if an ignored file is present for the source
distribution and if so, copy it to the dest distribution and commit the
change.
  • Loading branch information
nuclearsandwich committed Jun 16, 2020
1 parent 0cf9944 commit 5dc357a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions migration-tools/migrate-rosdistro.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import copy
import os
import os.path
import shutil
import subprocess
import sys
import tempfile
Expand Down Expand Up @@ -134,6 +135,14 @@ def write_tracks_file(tracks, commit_msg=None):
subprocess.check_call(['git', 'remote', 'add', 'origin', new_release_repo_url])

if args.source != args.dest:
# Copy a bloom .ignored file from source to target distro.
if os.path.isfile(f'{args.source}.ignored'):
shutil.copyfile(f'{args.source}.ignored', f'{args.dest}.ignored')
with open('.git/rosdistromigratecommitmsg', 'w') as f:
f.write(f'Propagate {args.source} ignore file to {args.dest}.')
subprocess.check_call(['git', 'add', f'{args.dest}.ignored'])
subprocess.check_call(['git', 'commit', '-F', '.git/rosdistromigratecommitmsg'])

# Copy the source track to the new destination.
dest_track = copy.deepcopy(tracks['tracks'][args.source])
dest_track['ros_distro'] = args.dest
Expand Down

0 comments on commit 5dc357a

Please sign in to comment.