Re: Default library paths

2001-06-16 Thread Matthew Robinson


Had a brain wave this evening and came up with the following solution.

Replace /usr/lib/perl5 with /usr/local/.p5 in the perl binary[1].  Then
create a symlink from /usr/local/.p5 to /usr/local/lib/perl5.  The .p5
directory doesn't display in /usr/local so everything looks neat and tidy.

I am then left with the whole perl installation entirely contained in
/usr/local which means I can remove the Compact Flash card (containing perl)
without leaving any loose ends lying around in the main filesystem of my
iPAQ.

The next challenge will be getting gcc onto the iPAQ so that I can then
rebuild perl from scratch :)

Matt

[1] Strangely enough, perl came in pretty handy for this task.

--
s&&!msfQ!&&s&$&utvK&&s&(Q)&\1!sfiupoB&&s&^&reverse Ibdlfs&e&s&^&#
&&s&$&#!uojsq&&s&(.)&chr(ord($1)-1)&ge&s&(.*)&reverse $1&see

- Original Message -
From: Paul Makepeace <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, June 11, 2001 9:43 PM
Subject: Re: Default library paths


> On Mon, Jun 11, 2001 at 10:25:32AM +0100, Dominic Mitchell wrote:
> > You're very probably stuck.  Whilst you can use a hex editor to change
> > strings in the binary, you can't expand the length of those strings,
> > only contract them or retain the same length.
> >
> > However, a solution would be to change the perl binary to use /opt/lib
> > instead of /usr/lib and make /opt a symlink to /usr/local.
> >
> > There's a couple of reasonable hex editors out there, but I usually just
> > tend to use M-x hexl-find-file in emacs.  If you're a vim user, see
> > xxd(1).
>
> Presumably if you know the string, and they're all going to be replaced
> (as sounds like the case) you could use perl -pi -0e
> 's~/usr/lib/~/opt/lib~g' in whole-file-slurp mode (is that the right
> switch, -0?).
>
> Paul
>
> --
> Intentions
> -credibility of
> -nobility of
> -humility of
>




Re: Default library paths

2001-06-12 Thread Redvers Davies

> There's a couple of reasonable hex editors out there, but I usually just
> tend to use M-x hexl-find-file in emacs.  If you're a vim user, see
> xxd(1).

or bvi (Binary vi)



Re: Default library paths

2001-06-11 Thread Paul Makepeace

On Mon, Jun 11, 2001 at 10:25:32AM +0100, Dominic Mitchell wrote:
> You're very probably stuck.  Whilst you can use a hex editor to change
> strings in the binary, you can't expand the length of those strings,
> only contract them or retain the same length.
> 
> However, a solution would be to change the perl binary to use /opt/lib
> instead of /usr/lib and make /opt a symlink to /usr/local.
> 
> There's a couple of reasonable hex editors out there, but I usually just
> tend to use M-x hexl-find-file in emacs.  If you're a vim user, see
> xxd(1).

Presumably if you know the string, and they're all going to be replaced
(as sounds like the case) you could use perl -pi -0e
's~/usr/lib/~/opt/lib~g' in whole-file-slurp mode (is that the right
switch, -0?).

Paul

-- 
Intentions 
-credibility of
-nobility of
-humility of



Re: Default library paths

2001-06-11 Thread Dominic Mitchell

On Sun, Jun 10, 2001 at 05:40:38PM +0100, Matthew Robinson wrote:
> Apologies in advance if I have missed something blindingly obvious :)
> 
> I need to change the default library paths in a compiled copy of perl.
> Basically, I want to move /usr/lib/perl5 into /usr/local/lib/perl5.  I am
> unable to recompile perl as it is compiled for arm-linux and I don't have
> either the cross-compiler or the correct configuration to get perl to build
> for this architecture.
> 
> Currently, I am using a soft link from my /usr/lib to /usr/local/lib.
> However, I would prefer to keep the whole installation on /usr/local as this
> is mounted from a removable disk and I would prefer not to have dangling
> links when the device is removed.
> 
> Any suggestions, or am I stuck with the link in /usr/lib.

You're very probably stuck.  Whilst you can use a hex editor to change
strings in the binary, you can't expand the length of those strings,
only contract them or retain the same length.

However, a solution would be to change the perl binary to use /opt/lib
instead of /usr/lib and make /opt a symlink to /usr/local.

There's a couple of reasonable hex editors out there, but I usually just
tend to use M-x hexl-find-file in emacs.  If you're a vim user, see
xxd(1).

-Dom

-- 
| Semantico: creators of major online resources  |
|   URL: http://www.semantico.com/   |
|   Tel: +44 (1273) 72   |
|   Address: 33 Bond St., Brighton, Sussex, BN1 1RD, UK. |



Re: Default library paths

2001-06-10 Thread Matthew Robinson

On Sun, 10 June 2001, Jonathan Stowe wrote:
> On Sun, 10 Jun 2001, Matthew Robinson wrote:
>
> > Apologies in advance if I have missed something blindingly obvious :)
> >
> > I need to change the default library paths in a compiled copy of perl.
> > Basically, I want to move /usr/lib/perl5 into /usr/local/lib/perl5.  I
am
> > unable to recompile perl as it is compiled for arm-linux and I don't
have
> > either the cross-compiler or the correct configuration to get perl to
build
> > for this architecture.
> >
>
> PERL5LIB ?

I suppose I could use PERL5LIB but I would still prefer the entirely self
contained setup.  Also PERL5LIB won't work with taint checking (not that I
will be doing much taint checking on my iPAQ).

Matt





Re: Default library paths

2001-06-10 Thread Jonathan Stowe

On Sun, 10 Jun 2001, Matthew Robinson wrote:

> Apologies in advance if I have missed something blindingly obvious :)
>
> I need to change the default library paths in a compiled copy of perl.
> Basically, I want to move /usr/lib/perl5 into /usr/local/lib/perl5.  I am
> unable to recompile perl as it is compiled for arm-linux and I don't have
> either the cross-compiler or the correct configuration to get perl to build
> for this architecture.
>

PERL5LIB ?

/J\




Default library paths

2001-06-10 Thread Matthew Robinson

Apologies in advance if I have missed something blindingly obvious :)

I need to change the default library paths in a compiled copy of perl.
Basically, I want to move /usr/lib/perl5 into /usr/local/lib/perl5.  I am
unable to recompile perl as it is compiled for arm-linux and I don't have
either the cross-compiler or the correct configuration to get perl to build
for this architecture.

Currently, I am using a soft link from my /usr/lib to /usr/local/lib.
However, I would prefer to keep the whole installation on /usr/local as this
is mounted from a removable disk and I would prefer not to have dangling
links when the device is removed.

Any suggestions, or am I stuck with the link in /usr/lib.

Matt

--
s&&!msfQ!&&s&$&utvK&&s&(Q)&\1!sfiupoB&&s&^&reverse Ibdlfs&e&s&^&#
&&s&$&#!uojsq&&s&(.)&chr(ord($1)-1)&ge&s&(.*)&reverse $1&see