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

Re: dpkg minw32



Luke Kenneth Casson Leighton wrote:

>  ok.  so that still leaves a sticky situation with using the tar
> binary instead of libtar, and the fact that mingw32 doesn't have
> fork(), and even _remotely_ considering attempting to use win32's
> popen would result in a dog's dinner beyond all reasonable acceptable
> coding standards.

Have you tried it?  I am not sure that running tar would really be
that horrible.  It is usually easiest to first get something working,
then optimize.

dpkg needs to be able to spawn processes still, to run package
maintainer scripts.

> you only have to look at the hoops that python's
> win32 implementation of "popen" to understand that (dup of HANDLEs,
> system calls to associate with a filedescriptor, pass those across
> process boundaries... nightmare).

Um, dpkg doesn’t use popen.  So the fork() + exec() examples, complete
with appropriate dup et al, should give enough of an example to write
some spawnve()-based code.

See compat/mingw.c in the source to git for some examples users of
the relevant Windows APIs.

> was there any particular reason why dpkg farms out to tar, rather than
> statically linking with libtar?

Probably because it is fairly easy, and tar is likely to be available
everywhere while libarchive et al are not.

Please, try to look at the code and try some things instead of just
being daunted by the task!

Regards,
Jonathan


Reply to: