[Libguestfs] [PATCH] GuestOS: Fix _is_installed to return 0 if the package isn't installed
Richard W.M. Jones
rjones at redhat.com
Fri Feb 12 16:41:05 UTC 2010
On Fri, Feb 12, 2010 at 04:39:25PM +0000, Matthew Booth wrote:
> On 12/02/10 14:42, Richard W.M. Jones wrote:
> > On Fri, Feb 12, 2010 at 02:22:43PM +0000, Matthew Booth wrote:
> >> + my $error = $g->sh(join(' ', @$rpmcmd).' 2>&1 ||:');
> >
> > Do we need more quoting here?
> >
> >> + return 0 if ($error =~ /not installed/);
> >
> > I guess this works because LANG=C in the appliance.
> >
> > If we ever enabled locales in the appliance it might break though. It
> > could therefore be a good idea to add LANG=C to the beginning of the
> > shell command above.
> >
> > Rich.
> >
>
> Added more quoting and LANG=C.
Yup, that looks right to me. ACK.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines. Supports shell scripting,
bindings from many languages. http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
More information about the Libguestfs
mailing list