c. wrote: > > On 26 Mar 2012, at 19:56, Philip Nienhuis wrote: > >> I already made the pkg_info function I mentioned in an earlier post >> (attached); came in handy for my own purposes too. It doesn't accept cell >> args yet (to query multiple packages) but that might be added later. >> >> Using that, you can get the installation path to the arch-dependent folder >> (where the .oct files should live) using (for e.g., miscellaneous): >> >> p1 = pkg_info ("miscellaneous", "archprefix"); >> p2 = octave_config_info ("canonical_host_type"); >> p2 = octave_config_info ("api_version"); >> arch_dep_fldr = [p1 filesep "-" p3]; >> >> Philip > > If I undersmuch of what is done by this function can already be done by > pkg ("describe", ...)
That gives the user info, not the stuff in octave_packages. > which also works for mutiple packages. > > pkg ("list") > > returns the same info as your function > does but for all installed packages. > so pkg_info reduces essentially to the following three lines: > > pkg_names = {"secs1d", "ocs"}; > a = pkg ("list"); > b = a (cellfun(@(x) ismember (x.name, pkg_names), a, "unif", true)); ...which has many variations. One probably could even make this into a two-liner. But how does this help to get the full path to the arch-dependent .oct installation dir? At least that's what Juan asked for (AIUI). What's still lacking is easily getting the contents of specific fields. Something like: ## don't work: c = b.version ## works OK: c = b{1}.archprefix AFAICS getfield() etc doesn't work on cell arrays of structs. P. ------------------------------------------------------------------------------ This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu/sfd2d-msazure _______________________________________________ Octave-dev mailing list Octave-dev@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/octave-dev