Skip to content
Snippets Groups Projects

clean: handle common options

Merged Lyndon Brown requested to merge jnqnfe/live-build:clean into master
1 unresolved thread

i encountered failure from lb clean --debug, realising then that clean did not actually handle most of the set of common options.

a refactor was required to achieve the goal of fixing this, which also significantly simplifies it, avoiding all of the recursive execution.

Edited by Lyndon Brown

Merge request reports

Pipeline #136924 passed

Pipeline passed for 263f84fe on jnqnfe:clean

Approval is optional

Merged by Lyndon BrownLyndon Brown 5 years ago (May 15, 2020 9:09pm UTC)

Merge details

  • Changes merged into with 263f84fe.
  • Deleted the source branch.

Pipeline #136941 passed

Pipeline passed for 263f84fe on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Lyndon Brown added 20 commits

    added 20 commits

    • 37a3e411...9d5665c6 - 6 commits from branch live-team:master
    • 5f368531 - config: optimisation for fresh configs
    • 742bc0d9 - config: optimise --ignore-system-defaults
    • 17bc93c5 - config: add --ignore-saved option
    • 43b6e1f9 - config: add --purge-saved option
    • 74d888af - examples: use `lb config --purge-config` in `auto/clean`
    • cc51afca - examples: use --ignore-saved in `auto/config`
    • 9a3e3844 - clean: add --saved-config option
    • e774b320 - examples: use `--saved-config` with `lb clean`
    • aafdc8d0 - clean: improve arg handling
    • 3130cd15 - clean: fix missing 'noauto' param for substage execution
    • 8a685129 - clean: switch "cleaning chroot" to be a debug message
    • 8a493693 - clean: expand debugging
    • b1bef174 - clean: add missing common option handling
    • 90ed006f - clean: fix option handling with refactor

    Compare with previous version

  • Lyndon Brown added 15 commits

    added 15 commits

    • b4156e14 - 1 commit from branch live-team:master
    • 75426c38 - config: optimisation for fresh configs
    • 15569de1 - config: optimise --ignore-system-defaults
    • dafcc34b - config: add --ignore-saved option
    • babeb80d - config: add --purge-saved option
    • 7dfa32ad - examples: use `lb config --purge-config` in `auto/clean`
    • 4cfb05e6 - examples: use --ignore-saved in `auto/config`
    • 143adbc3 - clean: add --saved-config option
    • a90a6436 - examples: use `--saved-config` with `lb clean`
    • 4b4141ae - clean: improve arg handling
    • 5720ebc0 - clean: fix missing 'noauto' param for substage execution
    • 372e02f3 - clean: switch "cleaning chroot" to be a debug message
    • 6d3d722b - clean: expand debugging
    • 8934ba8e - clean: add missing common option handling
    • 5cab070d - clean: fix option handling with refactor

    Compare with previous version

  • Author Developer

    @hertzog with the dependent MR delayed, I can very easily rebase this without it beneath to allow it to go through if you'd like. (I'll try to not do this dependency thing in future as requested).

    • Please do if you want me to consider it now.

      I have a few comments:

      • I think I prefer to keep the message for "Cleaning chroot" visible by default, because the step takes a long time to remove all the files and it's reassuring to know what the script is doing when it seems to be stuck... if you need to make the other steps visible for consistency, then so be it.
      • The processing of common options is not satisfying... you're duplicating it once more and options only take effect if they have been specified before the action. This seems to be not worth the effort.
    • Author Developer

      Ok. done.

      There are two core commits introducing support, the first indeed only allows them to work in certain orders, but the second refactors things such that it's more simple, and such that all combinations work as to be expected. I guess I could have implemented the commits the other way around, to refactor then add support, but it just came out this way and I didn't think it worth the effort to redo it the other way around.

      • I took care of the very minor fixes that were part of this, to save effort. I'd obviously submitted this before you'd clarified that some similar small things in a different MR were fine. So this is now reduced down to the core change.
      • I removed the commit changing the message to debug, as requested. I left the others debug, with a comment besides the one non-debug one so no-one thinks it's a mistake.

      The duplication of the options is certainly not ideal, and I'd like to take a further look at reworking it to make use of Arguments() instead. I can do this before merging if you want me to, otherwise I'll look into it after.

    • Author Developer

      Since config also duplicates common options, and taking a moment to further consider that aspect, I think what I might like to do is create a simple common function that handles executing the right action for a common action, such that all three places handling common options (config, clean and Arguments()) will have a case entry for all common options, and will take the action of passing the option on to this common function that take action on it. This thus removes all of that duplication.

      Can I take care of that after?

      Edited by Lyndon Brown
    • Author Developer

      Update: in fact I just de-duplicated the common option handling between config and Arguments(), so I'll revise this accordingly, then things will be much nicer...

    • Author Developer

      Ok, sorry for the noise, but I've revised things to be much nicer now.

      • I took care of making a common helper for taking action on common options, shared by config, clean and Arguments().
      • I switched the order of the two commits here, so we have a clean refactor first, then addition of the common option support.
      • The common option support now uses the new helper, such that there's no horrible duplication.
    • Please register or sign in to reply
  • Lyndon Brown added 26 commits

    added 26 commits

    Compare with previous version

  • Lyndon Brown changed title from clean: handle common options [dep #193] to clean: handle common options

    changed title from clean: handle common options [dep #193] to clean: handle common options

  • Lyndon Brown changed the description

    changed the description

  • Lyndon Brown marked as a Work In Progress

    marked as a Work In Progress

  • Lyndon Brown added 4 commits

    added 4 commits

    Compare with previous version

  • Lyndon Brown unmarked as a Work In Progress

    unmarked as a Work In Progress

  • Lyndon Brown added 1 commit

    added 1 commit

    • 1197b869 - clean: add missing common option handling

    Compare with previous version

  • Lyndon Brown added 1 commit

    added 1 commit

    • 3dc73939 - clean: handle all common options

    Compare with previous version

  • Lyndon Brown added 19 commits

    added 19 commits

    Compare with previous version

  • Lyndon Brown added 3 commits

    added 3 commits

    • 76459a39 - 1 commit from branch live-team:master
    • a8a165b2 - clean: refactor
    • 6162baf9 - clean: handle all common options

    Compare with previous version

  • Lyndon Brown added 4 commits

    added 4 commits

    Compare with previous version

  • Lyndon Brown added 22 commits

    added 22 commits

    Compare with previous version

  • Lyndon Brown added 6 commits

    added 6 commits

    Compare with previous version

  • Lyndon Brown enabled an automatic merge when the pipeline for 263f84fe succeeds

    enabled an automatic merge when the pipeline for 263f84fe succeeds

  • merged

Please register or sign in to reply
Loading