dir listing not starting with . and ..
Søren Hauberg
soren at hauberg.org
Wed Feb 4 11:10:33 CST 2009
ons, 04 02 2009 kl. 11:20 -0500, skrev John W. Eaton:
> Shouldn't a package named foo-1.0.0.tar.gz unpack into a directory
> called foo-1.0.0? If that's not already part of the definition of a
> package, then maybe it should be? If we have this requirement, then
> I think it simplifies things a bit.
I think (not sure) that the packages in octave-forge unpacks in a
directory called 'foo' and not 'foo-1.0.0', and I think both of these
makes sense. The current code essentially does
tmp_dir = create_tmp_dir ();
untar (package_file, tmp_dir);
source_dir = readdir (tmp_dir) {3}; # the first two are "." and ".."
The main reason for creating a temporary directory in the first place is
to make it easy to delete the files that was unpacked. And once we know
that all files/directories in 'tmp_dir' belongs to the package, I think
it's quite simple to just pick the first one that is listed.
Søren
More information about the Bug-octave
mailing list