[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Ovirt-devel] [PATCH ovirt-node-image] fix ovirt-node-image.spec



Alan Pevec <apevec redhat com> wrote:
> From: Chris Lalancette <clalance redhat com>
>
>     1) Removed a redundant BuildRequires line.
>     2) More importantly, added a %post script for the pxe RPM to run cobbler
>     sync iff cobbler exists.  With this in place, running "rpm -Uvh" with a new
>     ovirt-managed-node-pxe RPM will actually cause managed nodes to pick up the
>     new image instead of the old one.
>
>     Signed-off-by: Chris Lalancette <clalance redhat com>
> ---
>  ovirt-node-image.spec |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/ovirt-node-image.spec b/ovirt-node-image.spec
> index 9e47e54..ebe674d 100644
> --- a/ovirt-node-image.spec
> +++ b/ovirt-node-image.spec
> @@ -28,7 +28,6 @@ At the moment, this RPM just packages prebuilt ISO.
>  %package pxe
>  Summary: oVirt Node boot PXE image
>  Group: Applications/System
> -BuildRequires: livecd-tools >= 017
>
>  %description pxe
>  The PXE boot image for oVirt Node network boot from oVirt Server.
> @@ -82,6 +81,9 @@ mkdir %{buildroot}
>  %clean
>  %{__rm} -rf %{buildroot}
>
> +%post pxe
> +[ -x /usr/bin/cobbler ] && /usr/bin/cobbler sync

Good idea!

How about this (functionally equivalent code) instead?

  (cobbler --help) > /dev/null 2>&1 && cobbler sync

It's good to avoid absolute names[*], and guaranteed to
be ok in this case, since livecd-creator (also in /usr/bin)
is used above with no dir prefix.

Jim

[*] What if cobbler moves to /bin or /usr/sbin some day?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]