On Fri, Apr 03, 2020 at 04:55:42PM +0200, Pino Toscano wrote:
On Friday, 3 April 2020 13:50:09 CEST Richard W.M. Jones wrote:
> We actually document that --if-newer can only be used in build mode.
> It sort of makes no sense in prepare mode. So shouldn't this just
> give an error (either here, or earlier) if we're in prepare mode?
Should we error out, or simply ignore it like done for other options
specific to a certain mode (eg --host-cpu)?
Whichever you think is better. I suspect if we error out this one,
we'll end up receiving bugs saying that we do the same for all other
options that aren't relevant in the current mode :-/
Your note also made me discover a bug related to that option:
(on Fedora)
$ touch filesystem
$ supermin --prepare -o foo --if-newer -v filesystem
supermin: version: 5.2.0
supermin: rpm: detected RPM version 4.15
supermin: rpm: detected RPM architecture x86_64
supermin: package handler: fedora/rpm
supermin: prepare: filesystem
[etc..]
$ supermin --prepare -o foo --if-newer -v filesystem
supermin: version: 5.2.0
supermin: rpm: detected RPM version 4.15
supermin: rpm: detected RPM architecture x86_64
supermin: package handler: fedora/rpm
supermin: if-newer: output does not need rebuilding
Yup, that's all wrong (and weird because it's looking at ‘filesystem’
as a file).
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming and virtualization blog:
http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html