[psoc-2008] Week[3] Report: On-Schedule and More Features!
Jos I. Boumans
jos at dwim.org
Mon Jun 23 20:17:35 UTC 2008
Hi Sam,
On 22 Jun 2008, at 21:34, Skaman Sam Tyler wrote:
> Since my report this week is pretty long and includes screenshots,
> please visit my blog entry at http://wxcpan.wordpress.com/
> 2008/06/22/week3-report-on-schedule-and-more-features/.
Checking your blog, I see you've run into some issues I might be able
to help with:
* Files [problems]
This lists all of the files in an installed module. Apparently,
the CPANPLUS::Module::files()
method only works for the installed version, so I need a way to
get the module object for the
installed version.
Actually you don't. The objects are the same, and you simply need to
call the right method to
find out the information you need.
So, you can do:
@mods = $cb->installed; # all installed modules
and on the entries in this array you can call:
@files = $mod->files;
Any module not returned by ->installed or where $mod->is_uptodate
( version => 0 ) returns
false, is not installed.
We have no way of knowing what files are in an uninstalled (remote)
tarball unfortunately,
so at the very least you'd have to download & extract it. Of course,
not all files from
the tarball are going to be installed so $mod->files and 'find $mod-
>status->extract -type f'
will not return the same files.
* Status [problems]
This is where most of the information from $module->status() is
displayed. It is mostly checkboxes and textfields. I am not sure
where or even if there is a problem, but almost all modules return a
status object with all values set to undef. Maybe status() is only
used during installation?
Status is used as you do 'things' to the object. For example, if you
call:
$mod->readme
The readme will be stored in $mod->status->readme so it will not need
to be refetched.
It's mostly for internal use, as most operations return the value
you're interested in,
but the API is fully there for use. See here for details:
http://search.cpan.org/~kane/CPANPLUS/lib/CPANPLUS/
Module.pm#STATUS_ACCESSORS
Prerequisites are determined when 'perl Makefile.PL' or 'perl
Build.PL' is run, which
is at the *minimum*:
$mod->prepare;
which involves downloading, extracting and running the above code.
This information is
not available via the CPAN indexes. However, there's a project that
might help you:
http://cpandeps.cantrell.org.uk
Which is a webpage that stores some of this information
* Prerequisites [major problems]
This is a tree display of all the prerequisites for a module. It
doesn’t seem to work with any modules. I am attempting to fix this.
I'm assuming the problem you mention is somewhere in the GUI code, and
not CPANPLUS (as we rely on that structure ourselves to resolve
prereqs ;)
But just to be complete, after you've run ->prepare (or anything
encompassing
that), you can get a list of prereqs by calling:
$href = $mod->status->prereqs;
I hope this helps you along. Don't hesitate to ask if you need more
help.
Cheers,
--
Jos
Boumans
http://www.linkedin.com/in/josboumans
How do I prove I'm not crazy to people who are?
More information about the psoc-2008
mailing list