Support cleaning strip step. #382

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
3 participants
Member

kyrofa commented Mar 18, 2016

This PR makes progress on LP: #1537786 toward implementing per-step clean rules by adding one for the strip step. The others are currently placeholders and will be implemented in future PRs.

Coverage Status

Coverage remained the same at 95.288% when pulling cd01294 on kyrofa:feature/1537786/clean_strip_step into 3cc0049 on ubuntu-core:master.

snapcraft/pluginhandler.py
@@ -128,12 +128,11 @@ def is_dirty(self, step):
def should_step_run(self, step, force=False):
return force or self.is_dirty(step)
- def mark_done(self, step):
+ def mark_done(self, step, state={}):
@kyrofa

kyrofa Mar 21, 2016

Member

Ah, my python knowledge just increased! Thanks for the link 😃 .

+ with open(self._step_state_file('strip'), 'r') as f:
+ state = yaml.load(f.read())
+
+ _clean_migrated_files(state['snap-files'], state['snap-directories'],
@sergiusens

sergiusens Mar 19, 2016

Collaborator

before passing this in, you need to load all parts and check if they migrated the same file to remove it from the wipe list

@kyrofa

kyrofa Mar 21, 2016

Member

Oh right, when writing this I assumed that would imply they were dependent parts, but I forgot that multiple independent parts can supply the same file as long as the contents don't change. Good catch, thank you!

Collaborator

sergiusens commented Mar 19, 2016

Looks good, just comment about dict and filesets

Support cleaning strip step.
This adds a --step argument to the clean command, and implements
per-step clean rules. All per-step clean rules are placeholders
except for the strip clean step, which is done.

LP: #1537786

Signed-off-by: Kyle Fazzari <kyle@canonical.com>

Coverage Status

Coverage remained the same at 95.29% when pulling 4445fd5 on kyrofa:feature/1537786/clean_strip_step into 3cc0049 on ubuntu-core:master.

Member

kyrofa commented Mar 21, 2016

This PR needs to land to an intermediate branch. Closing.

@kyrofa kyrofa closed this Mar 21, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment