octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [OctDev] main ported to the package system


From: John W. Eaton
Subject: Re: [OctDev] main ported to the package system
Date: Tue, 22 Aug 2006 14:37:34 -0400

On 22-Aug-2006, David Bateman wrote:

| Soren,
| 
| As this should be applied to the octave core pkg.m function I've cc'ed
| the maintainers list. John can you look at this?
| 
| Søren Hauberg wrote:
| 
| >man, 21 08 2006 kl. 18:43 +0200, skrev David Bateman:
| >  
| >
| >>Ok, this makes sense, and I'd propose something like the attached patch
| >>to address this. Though this needs further testing, it seems to work for
| >>the test case I've used based on the comms toolbox. Basically, this
| >>means that symbolic links should be handled by the developer either
| >>embedded in the code or as a seperate PKG_ADD file that is appended to
| >>the end of the PKG_ADD commands found in the source.
| >>    
| >>
| >Looks good, but there are a few details I don't understand:
| >
| >  
| >
| >>+ function create_pkgadd (desc, packdir)
| >>+   pkgadd = [desc.dir "/PKG_ADD"];
| >>+   rm_rf(pkgadd);
| >>    
| >>
| >Why do you need to delete 'pkgadd'? 'desc.dir' should always be a newly
| >created directory, so 'pkgadd' should never exist.
| >  
| >
| Ok, I'm not that familar with the package system yet.
| 
| >  
| >
| >>+   fid = fopen(pkgadd, "wt");
| >>+   if (fid >= 0)
| >>+     ## Search all dot-m files for PKG_ADD commands
| >>+     lst = dir ([packdir "inst"]);
| >>+     for i=1:length(lst)
| >>+       nm = lst(i).name;
| >>+       if (length(nm) > 3 && strcmp (nm((end-1):end), ".m"))
| >>+         fwrite (fid, extract_pkgadd (nm, '^[#%][#%]* *PKG_ADD: *(.*)$'));
| >>+       endif
| >>+     endfor
| >>    
| >>
| >Can't you simply write:
| >    lst = dir ([packdir "/inst/*.m"]);
| >    for i = 1:length(list)
| >      nm = list(i).name;
| >      fwrite (fid, extract_pkgadd (nm, '^[#%][#%]* *PKG_ADD: *(.*)$'));
| >    endfor
| >and similar for the C++ files.
| >  
| >
| Hey, it was a first pass. Ok, I've adapted the changes you suggested.
| 
| > 
| >  
| >
| >>+     ## Search all C++ source files for PKG_ADD commands
| >>+     lst = dir ([packdir "src"]);
| >>+     for i=1:length(lst)
| >>+       nm = lst(i).name;
| >>+       if (length(nm) > 4 && strcmp (nm((end-2):end), ".cc"))
| >>    
| >>
| >Should we only handle *.cc files, or should we also handle *.cpp and *.C
| >(are there others?) ? Which reminds me: is MS Windows case sensitive, or
| >do we also need to handle *.M, *.CPP, etc.?
| >  
| >
| The existing mkpkgadd funcion only search *.m and *.cc files. Its easy
| to make it search other files, but do we want it to?
| 
| >Besides these details it looks good, and I think this should be applied
| >to CVS. Assuming this gets accepted into CVS, what else is needed to aid
| >package developers?
| >  
| >
| Some way of treating additional directories in the package other than
| src/ and inst/, though I'll address that in a seperate mail..
| 
| I attach the PKG_ADD patch for pkg.m that I'd like to see applied

OK, I checked in this change.

Thanks,

jwe



reply via email to

[Prev in Thread] Current Thread [Next in Thread]