[SLL] cpan, perl module help
Derek Simkowiak
dereks at realloc.net
Sun Sep 14 13:34:16 PDT 2008
Mike,
I don't see the call to mkpath() in the block of code below... what
is this block, and why did you send it to me?
Note, File::Path holds mkpath().
Also, I am unconvinced that mkpath() is really the root cause, as
you suggested below. The error message I saw in your first email
explicitly said "mkdir", which is a separate program that has nothing to
do with Perl:
dereks at dell-laptop:~$ which mkdir
/bin/mkdir
dereks at dell-laptop:~$ ls -la /bin/mkdir
-rwxr-xr-x 1 root root 30472 2008-04-03 23:42 /bin/mkdir
dereks at dell-laptop:~$ file /bin/mkdir
/bin/mkdir: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV),
for GNU/Linux 2.6.8, dynamically linked (uses shared libs), stripped
dereks at dell-laptop:~$
(Perhaps the Perl function mkpath() uses the external program
"mkdir", but that would really surprise me, because "mkdir" is not
cross-platform. Maybe your Install.pm has implemented its own custom
mkpath() which calls "mkdir" underneath?)
/> Is there a way to globally set the mkdir -p option, rather than add
it to the code? /
No, the -p option is a command-line option to the program "mkdir".
There is no global setting.
Look in the Install.pm for the word "mkdir". After all, that is
what the error message said. (Also, don't focus too much on the -p
option. That is just what people use when calling mkdir in a Makefile
or install shell script. If the error message is from Perl, and not the
external program /bin/mkdir, then the -p option won't help you...)
--Derek
Mike Bate wrote:
> Derek, Ana, thanks for the ideas, you gave me some places to look
> around. But no success.
>
> Here is a chunk of the code from Install.pm
> ( mkpath($targetdir) unless $nonono; is line 112)
>
> I'm guessing(!) that mkpath is in one of the standard modules, maybe
> File::Path, but I don't know where to look at that. No "mkdir" in the
> Makefile or Makefile.PL
>
> Is there a way to globally set the mkdir -p option, rather than add it
> to the code?
>
> ---------
> my($source_dir_or_file);
> foreach $source_dir_or_file (sort keys %from_to) {
> #Check if there are files, and if yes, look if the corresponding
> #target directory is writable for us
> opendir DIR, $source_dir_or_file or next;
> for (readdir DIR) {
> next if $_ eq $Curdir || $_ eq $Updir || $_ eq ".exists";
> my $targetdir =
> install_rooted_dir($from_to{$source_dir_or_file});
>
> if (!$nonono && !-w $targetdir) {
> warn "Warning: You do not have permissions to " .
> "install into $from_to{$source_dir_or_file}"
> unless $warn_permissions++;
> }
> }
> closedir DIR;
> }
>
> ---------
More information about the linux-list
mailing list