On 03/11/2010 12:29 PM, Andrei Alexandrescu wrote:
For the more specific case

dmdz [global flags] foo.zip [local flags]

it expects all the relevant content in foo.zip to be located inside
directory foo, and doesn't extract anything else unless you explicitly
tell it to.

I don't understand this. Does the program foo.zip have to contain an
actual directory called "foo"? That's a bit restrictive. My initial plan
revolved around expanding foo.zip somewhere in a unique subdir of the
temp directory and considering that a full-blown project resides inside
that subdir.

It is. I suppose the name isn't so important, but I really hate zip files whose contents aren't contained inside a single directory. Also, there would be a bit of a dichotomy if

dmdz foo.zip

resulted in a directory 'foo' wherever, but

unzip foo.zip

resulted in what would be the contents of 'foo' above.

Another thing: do you envision this just being a build-this-completed-project, or do you see this as an actual development tool? Because I've been approaching it more from the latter perspective. Zip file is a roadmap: look, all the files you need for to compile are here, here, here, and here. So use them. Compile.

But if the zip file is a complete project, then you would expect to see source code, test code, test data, licenses, documentation, etc, which would likely require filtering anyways and possibly multiple compiles for different pieces. And you'd expect the result of the compile to end up somewhere in the directory you just created.

Alright, I think I'm seeing less and less value in foo.zip/foo as a req.


Also, there can be a file 'cmd' (name?) inside foo.zip which contains
additional flags for the compile, with local flags overriding global
flags overriding flags found in cmd. At least for dmdz flags.

How about dmd.conf?

Sounds good.


dmd flags get filtered out and forwarded to dmd.

The current strategy for compiling just involves giving every compilable
thing extracted to dmd. There's also an option to compile each source
file separately (which I put in after hitting an odd Out of Memory
Error).

Comments?

That sounds about right. One thing I want is to stay reasonably KISS
(e.g. like rdmd is), i.e. not invent a lot of arcana. rdmd has many
heuristics and limitations but has the virtue that it gets a specific
job done without requiring its user to learn most anything. I hope dmdz
turns out similarly simple.

Also, are there any plans for std.zip, e.g. with regard to ranges,
input/output streams, etc? The current api seems a smidge spartan.

I've hoped to rewrite std.zip forever, but found no time to do so.

Well, heck. Maybe I'll see what I can do with it. Do you want it to conform to any interface in particular?

Also: test whether a file [path?] is contained within a specific directory [path?]. does such functionality exist somewhere in phobos?


Andrei

Reply via email to