Skip to content

Add support for patching newer ASF4 code.#292

Merged
dhalbert merged 2 commits into
adafruit:masterfrom
tannewt:patch_asf4
Sep 29, 2017
Merged

Add support for patching newer ASF4 code.#292
dhalbert merged 2 commits into
adafruit:masterfrom
tannewt:patch_asf4

Conversation

@tannewt
Copy link
Copy Markdown
Member

@tannewt tannewt commented Sep 28, 2017

This also updates ASF4 to include flash APIs.

This pull is two separate commits to make it easier to see the patching changes from the ASF4 changes.

This makes it possible to automatically fix newer code.
This is the first automatic update that has caused a few deletions
where code was previously copied instead of moved.

This is a prerequisite for micropython#260.
@tannewt tannewt added this to the 3.0 Beta milestone Sep 28, 2017
@tannewt tannewt requested a review from dhalbert September 28, 2017 22:45
Copy link
Copy Markdown
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The patch stuff is great. I see what you are doing. Is there some way to get git to do it instead by merging? Maybe we'd need a separate ASF4 repo.

for patch in os.listdir("asf4/patches/" + chip):
patch = "patches/" + chip + "/" + patch
print(patch)
result = subprocess.run(["patch", "-l", "-F", "10", "-u", "-p", "1", "-d", tmp_dir, "-i", "../" + patch])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't need to be changed, but consider using subprocess.run("some {} command {}".format(...), shell=True) to make the command line easier to change and read.

@dhalbert dhalbert merged commit 0bbb7a8 into adafruit:master Sep 29, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants