Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Feb 2008 13:03:56 -0500
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        freebsd-openoffice@FreeBSD.org
Subject:   Re: openoffice.org-2.3.1_1 depends on libpaper-1.1.21_3
Message-ID:  <200802271303.58748.jkim@FreeBSD.org>
In-Reply-To: <200802271224.31228.jkim@FreeBSD.org>
References:  <fb8f6ef40802260838i3812566awa39d16b6344b334@mail.gmail.com> <fb8f6ef40802270834h5f3b0cd7r9178778b6d0a919@mail.gmail.com> <200802271224.31228.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wednesday 27 February 2008 12:24 pm, Jung-uk Kim wrote:
> On Wednesday 27 February 2008 11:34 am, Richard (Rick) Seay wrote:
> > On Tue, Feb 26, 2008 at 1:05 PM, Jung-uk Kim <jkim@freebsd.org>
>
> wrote:
> > >  AFAIK, paperconf is an optional feature and it is not fatal
> > > error.
> >
> > Thanks for the quick reply.
> >
> > I just reproduced the problem. Here is the message that I got:
> >
> > $ ls ~/.openoffice.org2
> >
> > ls: /home/rick/.openoffice.org2: No such file or directory
> >
> > $ /usr/local/bin/openoffice.org-2.3.1
> >
> > paperconf: not found
> >
> > $
> >
> >
> > There was no pre-existing ~/.openoffice.org2.  Perhaps I should
> > not have used the word "failed".  In fact, the setup dialog
> > completed properly, but the "paperconf: not found" message made
> > me think that there was an error. From your reply, it seems that
> > the message may be safely ignored.  After looking into it
> > further, I find I can produce the error message by just renaming
> > /usr/local/bin/paperconf and running any component of openoffice.
>
> Yes, you can safely ignore the message.  FYI, it is optional
> feature because paperconf is GPL'd:
>
> http://www.openoffice.org/issues/show_bug.cgi?id=77363
>
> Then, Linux people had the same issue:
>
> http://www.openoffice.org/issues/show_bug.cgi?id=78617
>
> So, the final code became like this:
>
> http://lxr.go-oo.org/source/gsl/psprint/source/printer/printerinfom
>anager.cxx#143
>
> Unfortunately it does not work for FreeBSD but I didn't bother
> looking into it. ;-)

Oh, I think I know why it didn't work for FreeBSD.  In non-Solaris 
case:

%cat popen.c
#include <stdio.h>

int
main(void)
{
	FILE *f;

	f = popen("foobar 2>/dev/null", "r");
	if (f) {
		printf("done\n");
		pclose(f);
	} else
		printf("failed\n");

	return (0);
}
%cc -o popen popen.c
%./popen
done
foobar: not found
%

Now let's take a look at Solaris case:

%cat popen.c
#include <stdio.h>

int
main(void)
{
	FILE *f;

	f = popen("sh -c foobar 2>/dev/null", "r");
	if (f) {
		printf("done\n");
		pclose(f);
	} else
		printf("failed\n");

        return (0);
}
%cc -o popen popen.c
%./popen
done
%

It works.  So, the easy solution would be:


-	#ifdef SOLARIS
+	#ifdef LINUX
	// #i78617# workaround missing paperconf command; on e.g. Linux
	// the 2>/dev/null works on the started shell also
-	FILE* pPipe = popen( "sh -c paperconf 2>/dev/null", "r" );
+	FILE* pPipe = popen( "paperconf 2>/dev/null", "r" );
	#else
-	FILE* pPipe = popen( "paperconf 2>/dev/null", "r" );
+	FILE* pPipe = popen( "sh -c paperconf 2>/dev/null", "r" );
	#endif

I.e., Linux is so special. ;-)

Jung-uk Kim



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802271303.58748.jkim>