develooper Front page | perl.perl5.porters | Postings from September 2006

[rfc-patch] help lndir users by avoiding > symlink altering of originaltree.

Thread Next
From:
Jim Cromie
Date:
September 28, 2006 09:47
Subject:
[rfc-patch] help lndir users by avoiding > symlink altering of originaltree.
Message ID:
451BFCAD.4000503@gmail.com

I use lndir to clone perl trees, thereby saving disk space.
This has some subtle problems, in that some of the files
are written back thru the symlink to the old file,
thus interfering with the original tree.

drwxr-xr-x   2 jimc jimc    4096 Sep 27 01:51 utils
drwxr-xr-x   2 jimc jimc    4096 Sep 27 01:51 pod
drwxr-xr-x   2 jimc jimc    4096 Sep 27 01:51 x2p
drwxr-xr-x  60 jimc jimc   12288 Sep 27 02:10 lib
drwxr-xr-x  14 jimc jimc    4096 Sep 27 02:18 t
-rw-rw-r--   1 jimc jimc    7196 Sep 27 02:45 DynaLoader.o
-rwxrwxr-x   1 jimc jimc 1534813 Sep 27 02:45 perl
-rw-rw-r--   1 jimc jimc 1838672 Sep 27 02:45 libperl.a

these are newer than the most recent build in this (original) dir

-rw-rw-r--   1 jimc jimc    5550 Sep 27 03:10 Policy.sh
-rwxr-xr-x   1 jimc jimc    2629 Sep 27 03:10 myconfig
-rw-rw-r--   1 jimc jimc   34026 Sep 27 03:10 Makefile
-rw-rw-r--   1 jimc jimc  138179 Sep 27 03:10 config.h
-rw-rw-r--   1 jimc jimc       0 Sep 27 03:10 uni.data
-rw-rw-r--   1 jimc jimc    4533 Sep 27 03:16 perlmain.c



Attached patch fixes these by testing if its a symlink 1st, and altering 
it if so.

Caveats:

1 - bash has 'test -L $file'  to tell if its a symlink, Im not sure if 
other shells have it.

2 - Ive renamed the $file to $file.orig mostly, and one $file.link
    its perhaps better (less cluttered) to just delete them.
    Do .orig suffixes have a consistent meaning & treatment which 
current approach undermines ?



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About