metan-ucw / runltp-ng

Minimalistic LTP testrunner
11 stars 16 forks source link

install_pkg: Add options to print packages/commands #34

Closed metan-ucw closed 3 years ago

metan-ucw commented 3 years ago

This commit changes the code so that we can print list of packages and/or commands to install them as well.

There are no changes to the runltp-ng behavior.

Signed-off-by: Cyril Hrubis chrubis@suse.cz

pevik commented 3 years ago

Nice improvement, thanks!

$ ./install_pkg.pm -h is cool :), I'd mention that there is help. Later we could add also --list-distro which would print all supported distros. Now I'd just include all of them in help.

Invalid distro works, shouldn't we check a list of valid ones and die on unsupported ones?

$ ./install_pkg.pm --distro foo --run
dosfstools xfsprogs e2fsprogs btrfsprogs bc quota nfs-utils
metan-ucw commented 3 years ago

@pevik good catch we should check the if the distro is valid

metan-ucw commented 3 years ago

Fixed the distribution check.

pevik commented 3 years ago

Reviewed-by: Petr Vorel <pvorel@suse.cz>

Also it'd be nice to print in help command semantics (which options are mandatory or conflicting, which can be combined together). i.e.:

install_pkg.pm --distro DISTRO {--build | --run} [--cmd] [--m32]
install_pkg.pm -h|--help

But not sure how to express that there has to be at least one from --build --run (but can be both).

metan-ucw commented 3 years ago

I've made the help slightly better and pushed, thanks for the review.

pevik commented 3 years ago

OK, I'll fix missing Alpine command.