Perry Myers
2008-Sep-15 01:20 UTC
[Ovirt-devel] [PATCH node-image] Fix %post for pxe pkg to succeed regardless of whether or not cobbler is present
Old %post would generate error if cobbler was not installed. This method tries cobbler sync but regardless of success || : ensures that %post succeeds. This eliminates error on livecd creation of Appliance since ovirt-node installs before cobbler is installed. Signed-off-by: Perry Myers <pmyers at redhat.com> --- ovirt-node-image.spec | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/ovirt-node-image.spec b/ovirt-node-image.spec index 01d906a..01b7c29 100644 --- a/ovirt-node-image.spec +++ b/ovirt-node-image.spec @@ -85,7 +85,7 @@ mkdir %{buildroot} %{__rm} -rf %{buildroot} %post pxe -(cobbler --help) > /dev/null 2>&1 && cobbler sync +cobbler sync > /dev/null 2>&1 || : %files %defattr(-,root,root,0644) -- 1.5.5.1
Chris Lalancette
2008-Sep-15 07:30 UTC
[Ovirt-devel] [PATCH node-image] Fix %post for pxe pkg to succeed regardless of whether or not cobbler is present
Perry Myers wrote:> diff --git a/ovirt-node-image.spec b/ovirt-node-image.spec > index 01d906a..01b7c29 100644 > --- a/ovirt-node-image.spec > +++ b/ovirt-node-image.spec > @@ -85,7 +85,7 @@ mkdir %{buildroot} > %{__rm} -rf %{buildroot} > > %post pxe > -(cobbler --help) > /dev/null 2>&1 && cobbler sync > +cobbler sync > /dev/null 2>&1 || :Ah, I see. My previous version didn't cause a problem, but just printed out a bogus %post error message (which is probably why I didn't notice). This way, %post exits with a 0 exit code, as you say above. Good. ACK -- Chris Lalancette