|
From: H. <so...@ha...> - 2006-08-21 18:02:23
|
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 fo=
r
> 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 =3D [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.
> + fid =3D fopen(pkgadd, "wt");
> + if (fid >=3D 0)
> + ## Search all dot-m files for PKG_ADD commands
> + lst =3D dir ([packdir "inst"]);
> + for i=3D1:length(lst)
> + nm =3D 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 =3D dir ([packdir "/inst/*.m"]);
for i =3D 1:length(list)
nm =3D list(i).name;
fwrite (fid, extract_pkgadd (nm, '^[#%][#%]* *PKG_ADD: *(.*)$'));
endfor
and similar for the C++ files.
=20
> + ## Search all C++ source files for PKG_ADD commands
> + lst =3D dir ([packdir "src"]);
> + for i=3D1:length(lst)
> + nm =3D 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.?
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?
S=C3=B8ren
|