All of lore.kernel.org
 help / color / mirror / Atom feed
* [wic patch 0/5] Add option to wic and use argparse
@ 2017-04-21 12:11 Andreas J. Reichel
  2017-04-21 12:11 ` [wic patch 1/5] wic: Catch errors during image files clean-up Andreas J. Reichel
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Andreas J. Reichel @ 2017-04-21 12:11 UTC (permalink / raw)
  To: openembedded-core; +Cc: Jan Kiszka, Daniel Wagner, Andreas Reichel

This series consists of the following changes to wic:

    * wic previously introduced deletion of all single partition
        image files. In some cases, this deletion can fail, however
        this is no reason for wic to fail. Thus, exception handling
        was added to the clean-up function of the direct imager
        plugin.
    
    * wic uses optparse and a rather complicated approach of its
        initialization. It is much easier to switch from the
        deprecated optparse to the argparse library, which also
        supports sub-commands, which wic heavily makes use of.
        The second patch replaces optparse by argparse.

    * For some embedded projects it is necessary to keep the single
        partition image files to further process them. This is
        the case if a user has no rights to mount and cannot extract
        the images from the already merged .direct file, for example.

        For this purpose, a new option is introduced:

            -P, --keep-partition-images

        which prevents deletion of .p* files created by the direct
        imager plugin.

    * Maintainability improvement in engine.py by comparing parameters
        with enum-like string constants rather than repeating the
        strings and fixes in help texts.

The new argument parser was tested with random sampling manually, since
variable names were not changed inside the core of the subcommands and
transition from optparse to argparse is straight forward regarding access
to argument values.

Signed-off-by: Andreas Reichel <andreas.reichel.ext@siemens.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>

Reichel Andreas (5):
  wic: Catch errors during image files clean-up
  wic: Use argparse instead of optparse
  wic: Add missing text to usage and help strings
  wic: Add option to keep partition images
  wic: Use enum like dicts for string constants

 scripts/lib/wic/engine.py                |  21 ++-
 scripts/lib/wic/help.py                  |  30 +++--
 scripts/lib/wic/plugins/imager/direct.py |  23 +++-
 scripts/wic                              | 215 +++++++++++++++++++------------
 4 files changed, 191 insertions(+), 98 deletions(-)

-- 
2.11.0



^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2017-05-03 12:31 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-21 12:11 [wic patch 0/5] Add option to wic and use argparse Andreas J. Reichel
2017-04-21 12:11 ` [wic patch 1/5] wic: Catch errors during image files clean-up Andreas J. Reichel
2017-05-02 12:56   ` Ed Bartosh
2017-05-03  8:45     ` Andreas Reichel
2017-05-03 10:32       ` Ed Bartosh
2017-04-21 12:11 ` [wic patch 2/5] wic: Use argparse instead of optparse Andreas J. Reichel
2017-04-23 19:58   ` Burton, Ross
2017-04-26 10:34     ` Andreas Reichel
2017-04-26 13:03       ` Burton, Ross
2017-04-21 12:11 ` [wic patch 3/5] wic: Add missing text to usage and help strings Andreas J. Reichel
2017-04-21 12:11 ` [wic patch 4/5] wic: Add option to keep partition images Andreas J. Reichel
2017-04-21 12:11 ` [wic patch 5/5] wic: Use enum like dicts for string constants Andreas J. Reichel
2017-05-02 13:36   ` Ed Bartosh
2017-05-03  8:47     ` Andreas Reichel
2017-05-03 12:18       ` Ed Bartosh
2017-05-02 14:37 ` [wic patch 0/5] Add option to wic and use argparse Ed Bartosh
2017-05-03  8:49   ` Andreas Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.