Skip Menu |

This queue is for tickets about the Shipwright CPAN distribution.

Report information
The Basics
Id: 50540
Status: resolved
Priority: 0/
Queue: Shipwright

People
Owner: Nobody in particular
Requestors: phalenor [...] bx.psu.edu
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: -z `which readlink` doesn't work
Date: Thu, 15 Oct 2009 17:50:24 -0400 (EDT)
To: bug-Shipwright [...] rt.cpan.org
From: Andy Cobaugh <phalenor [...] bx.psu.edu>
When testing for readlink, testing with -z `which readlink` will never return true, as which will return something like "which: no foo in $PATH" or "no foo in $PATH" if you're on solaris. Not sure what the best way to test for the lack of readlink is, though. Right now I'm just testing for what platform I'm on, and adding /opt/sfw/bin to the PATH to get readlink. --andy
Hi Andy Sorry, I don't have solaris at hand, so I can't test. maybe you can try to test if the output of `which readlink` is "which: no readlink in $PATH" or alike? I'll be very glad to hear back from you, and if it works, I will update code for it too. thanks. best wishes sunnavy On Thu Oct 15 17:50:48 2009, phalenor@bx.psu.edu wrote: Show quoted text
> > When testing for readlink, testing with -z `which readlink` will never > return true, as which will return something like "which: no foo in $PATH" > or "no foo in $PATH" if you're on solaris. > > Not sure what the best way to test for the lack of readlink is, though. > Right now I'm just testing for what platform I'm on, and adding > /opt/sfw/bin to the PATH to get readlink. > > --andy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Sat, 17 Oct 2009 11:49:56 -0400 (EDT)
To: sunnavy via RT <bug-Shipwright [...] rt.cpan.org>
From: Andy Cobaugh <phalenor [...] bx.psu.edu>
On 2009-10-16 at 23:05, sunnavy via RT ( bug-Shipwright@rt.cpan.org ) said: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50540 > > > Hi Andy > > Sorry, I don't have solaris at hand, so I can't test. > maybe you can try to test if the output of `which readlink` is > "which: no readlink in $PATH" or alike? > > I'll be very glad to hear back from you, and if it works, I > will update code for it too.
$ /usr/bin/which readlink no readlink in /opt/local/bin /opt/local/sbin /opt/SUNWspro/bin /usr/sfw/bin /usr/sfw/sbin /usr/local/sbin /usr/local/bin /usr/ccs/bin /usr/sbin /usr/bin Fwiw, the shipwright vessel that either you or Jesse gave to me for RT 3.8.2 (this was late 2008 I think), after updating the RT dist to 3.8.5, built more or less perfectly on Solaris 10 SPARC. There were a couple of minor issues, like tweaking a couple of build files to specify gmake instead of make, specifying --make /usr/sfw/bin/gmake to shipwright-build, and symlinking /usr/lib/libdb.so.1 to /usr/lib/libdb.so so Perl could build. --andy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Mon, 19 Oct 2009 09:58:22 +0800
To: bug-Shipwright [...] rt.cpan.org
From: sun navy <sunnavy [...] gmail.com>
Hi Andy maybe the error output of `which readlink` is to STDERR? what happens if you run `which readlink 2>/dev/null` ? On Sat, Oct 17, 2009 at 11:50 PM, phalenor@bx.psu.edu via RT <bug-Shipwright@rt.cpan.org> wrote: Show quoted text
>       Queue: Shipwright >  Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=50540 > > > On 2009-10-16 at 23:05, sunnavy via RT ( bug-Shipwright@rt.cpan.org ) said:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=50540 > >> >> Hi Andy >> >> Sorry, I don't have solaris at hand, so I can't test. >> maybe you can try to test if the output of `which readlink` is >> "which: no readlink in $PATH" or alike? >> >> I'll be very glad to hear back from you, and if it works, I >> will update code for it too.
> > $ /usr/bin/which readlink > no readlink in /opt/local/bin /opt/local/sbin /opt/SUNWspro/bin /usr/sfw/bin /usr/sfw/sbin /usr/local/sbin /usr/local/bin /usr/ccs/bin /usr/sbin /usr/bin > > Fwiw, the shipwright vessel that either you or Jesse gave to me for RT > 3.8.2 (this was late 2008 I think), after updating the RT dist to 3.8.5, > built more or less perfectly on Solaris 10 SPARC. There were a couple of > minor issues, like tweaking a couple of build files to specify gmake > instead of make, specifying --make /usr/sfw/bin/gmake to shipwright-build, > and symlinking /usr/lib/libdb.so.1 to /usr/lib/libdb.so so Perl could > build. > > --andy > >
-- best wishes sunnavy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Sun, 18 Oct 2009 22:04:59 -0400 (EDT)
To: sunnavy via RT <bug-Shipwright [...] rt.cpan.org>
From: Andy Cobaugh <phalenor [...] bx.psu.edu>
On 2009-10-18 at 21:58, sunnavy via RT ( bug-Shipwright@rt.cpan.org ) said: Show quoted text
> <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > > > Hi Andy > > maybe the error output of `which readlink` is to STDERR? > what happens if you run `which readlink 2>/dev/null` ?
nope, it's to stdout. that would be too easy ;) --andy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Mon, 19 Oct 2009 10:20:54 +0800
To: bug-Shipwright [...] rt.cpan.org
From: sun navy <sunnavy [...] gmail.com>
heh, ok, let's try this? change the line if [ -z `which readlink` ]; then to if [ -z `which readlink` ] || [ -n `which readlink | grep 'no readlink' ` ]; then how is this? I'm sorry that I'm not familiar with sh. On Mon, Oct 19, 2009 at 10:05 AM, phalenor@bx.psu.edu via RT <bug-Shipwright@rt.cpan.org> wrote: Show quoted text
>       Queue: Shipwright >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > > > On 2009-10-18 at 21:58, sunnavy via RT ( bug-Shipwright@rt.cpan.org ) said:
>> <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > >> >> Hi Andy >> >> maybe the error output of `which readlink` is to STDERR? >> what happens if you run `which readlink 2>/dev/null` ?
> > nope, it's to stdout. that would be too easy ;) > > --andy > >
-- best wishes sunnavy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Sun, 18 Oct 2009 22:34:01 -0400 (EDT)
To: sunnavy via RT <bug-Shipwright [...] rt.cpan.org>
From: Andy Cobaugh <phalenor [...] bx.psu.edu>
On 2009-10-18 at 22:21, sunnavy via RT ( bug-Shipwright@rt.cpan.org ) said: Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=50540 > > > heh, ok, let's try this? > > change the line > if [ -z `which readlink` ]; then > to > if [ -z `which readlink` ] || [ -n `which readlink | grep 'no > readlink' ` ]; then > > how is this? > > I'm sorry that I'm not familiar with sh.
The argument to -n would have to be included in quotes, such as: [ -n "`which readlink | grep 'no readlink'`" ] Then it works. --andy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Mon, 19 Oct 2009 11:26:23 +0800
To: bug-Shipwright [...] rt.cpan.org
From: sun navy <sunnavy [...] gmail.com>
quotes are not so right, what does it say if without quotes? On Mon, Oct 19, 2009 at 10:34 AM, phalenor@bx.psu.edu via RT <bug-Shipwright@rt.cpan.org> wrote: Show quoted text
>       Queue: Shipwright >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > > > On 2009-10-18 at 22:21, sunnavy via RT ( bug-Shipwright@rt.cpan.org ) said:
>> <URL: https://rt.cpan.org/Ticket/Display.html?id=50540 > >> >> heh, ok, let's try this? >> >> change the line >> if [ -z `which readlink` ]; then >> to >> if [ -z `which readlink` ] || [ -n `which readlink | grep 'no >> readlink' ` ]; then >> >> how is this? >> >> I'm sorry that I'm not familiar with sh.
> > The argument to -n would have to be included in quotes, such as: > > [ -n "`which readlink | grep 'no readlink'`" ] > > Then it works. > > --andy > >
-- best wishes sunnavy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Mon, 19 Oct 2009 09:21:06 -0400 (EDT)
To: sunnavy via RT <bug-Shipwright [...] rt.cpan.org>
From: Andy Cobaugh <phalenor [...] bx.psu.edu>
Then it ends up trying to evaluate the entire output of `which readlink`. It ends up looking like this: [ -n no readlink in $PATH ] which test doesn't like, it has to be in quotes for it to read it as one argument. --andy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Wed, 21 Oct 2009 10:22:25 +0800
To: bug-Shipwright [...] rt.cpan.org
From: sun navy <sunnavy [...] gmail.com>
ahh, nod nod. thanks very much, I'll update the wrapper soon On Mon, Oct 19, 2009 at 9:21 PM, phalenor@bx.psu.edu via RT <bug-Shipwright@rt.cpan.org> wrote: Show quoted text
>       Queue: Shipwright >  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > > > > Then it ends up trying to evaluate the entire output of `which readlink`. > It ends up looking like this: > > [ -n no readlink in $PATH ] > > which test doesn't like, it has to be in quotes for it to read it as one > argument. > > --andy > >
-- best wishes sunnavy
Subject: Re: [rt.cpan.org #50540] -z `which readlink` doesn't work
Date: Wed, 21 Oct 2009 10:28:12 +0800
To: bug-Shipwright [...] rt.cpan.org
From: sun navy <sunnavy [...] gmail.com>
fixed in revision b99c80cbd35, which will be included in the next version of Shipwright, i.e. 2.4.4 On Wed, Oct 21, 2009 at 10:22 AM, sun navy <sunnavy@gmail.com> wrote: Show quoted text
> ahh, nod nod. > > thanks very much, I'll update the wrapper  soon > > On Mon, Oct 19, 2009 at 9:21 PM, phalenor@bx.psu.edu via RT > <bug-Shipwright@rt.cpan.org> wrote:
>>       Queue: Shipwright >>  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > >> >> >> Then it ends up trying to evaluate the entire output of `which readlink`. >> It ends up looking like this: >> >> [ -n no readlink in $PATH ] >> >> which test doesn't like, it has to be in quotes for it to read it as one >> argument. >> >> --andy >> >>
> > > > -- > best wishes > sunnavy >
-- best wishes sunnavy
Maybe you already considered (and discarded) this in the past, but you could use a different test: if [ ! -x `which readlink` ] ; then #... In this way, you're checking if the output of "which readlink" is a path to something executable, which "no readlink in $PATH" is hopefully not. Cheers, Flavio. On Mar. 20 Oct. 2009 22:28:29, SUNNAVY wrote: Show quoted text
> fixed in revision b99c80cbd35, which will be included in the next > version of Shipwright, i.e. 2.4.4 > > On Wed, Oct 21, 2009 at 10:22 AM, sun navy <sunnavy@gmail.com> wrote:
> > ahh, nod nod. > > > > thanks very much, I'll update the wrapper  soon > > > > On Mon, Oct 19, 2009 at 9:21 PM, phalenor@bx.psu.edu via RT > > <bug-Shipwright@rt.cpan.org> wrote:
> >>       Queue: Shipwright > >>  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > > >> > >> > >> Then it ends up trying to evaluate the entire output of `which readlink`. > >> It ends up looking like this: > >> > >> [ -n no readlink in $PATH ] > >> > >> which test doesn't like, it has to be in quotes for it to read it as one > >> argument. > >> > >> --andy > >> > >>
> > > > > > > > -- > > best wishes > > sunnavy > >
> > >
iirc, "which" only searches executable files, so no need to check this again ;) On Sun Dec 06 11:08:48 2009, POLETTIX wrote: Show quoted text
> Maybe you already considered (and discarded) this in the past, but you > could use a different > test: > > if [ ! -x `which readlink` ] ; then #... > > In this way, you're checking if the output of "which readlink" is a > path to something > executable, which "no readlink in $PATH" is hopefully not. > > Cheers, > > Flavio. > > > On Mar. 20 Oct. 2009 22:28:29, SUNNAVY wrote:
> > fixed in revision b99c80cbd35, which will be included in the next > > version of Shipwright, i.e. 2.4.4 > > > > On Wed, Oct 21, 2009 at 10:22 AM, sun navy <sunnavy@gmail.com>
> wrote:
> > > ahh, nod nod. > > > > > > thanks very much, I'll update the wrapper  soon > > > > > > On Mon, Oct 19, 2009 at 9:21 PM, phalenor@bx.psu.edu via RT > > > <bug-Shipwright@rt.cpan.org> wrote:
> > >>       Queue: Shipwright > > >>  Ticket <URL: http://rt.cpan.org/Ticket/Display.html?id=50540 > > > >> > > >> > > >> Then it ends up trying to evaluate the entire output of `which
> readlink`.
> > >> It ends up looking like this: > > >> > > >> [ -n no readlink in $PATH ] > > >> > > >> which test doesn't like, it has to be in quotes for it to read it
> as one
> > >> argument. > > >> > > >> --andy > > >> > > >>
> > > > > > > > > > > > -- > > > best wishes > > > sunnavy > > >
> > > > > >
> >