gnulib-tool-py
[Top][All Lists]
Advanced

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

Re: [gnulib-tool-py] func_modules_transitive_closure


From: address@hidden
Subject: Re: [gnulib-tool-py] func_modules_transitive_closure
Date: Wed, 04 Jul 2012 16:43:28 +0000

Hi Bruno,

I've finally got Internet here, so I've done a commit. pygnulib now gets 
dependencies using recursive function, so you may test it if you want. However, 
I can't complete conditional dependencies, because bash doesn't understand if I 
try to type an expression like this:

[test $HAVE_ATAN2F = 0]

it says 'unary operator expected'. I guess that it must be something like this

[test "$HAVE_ATAN2F" = 0]

In old gnulib I see that conditional dependencies are processed after they were 
separated, but I can't decipher what sed_extract_condition# expressions do. I'd 
suggest a variant like this: get words which start with "$" and then add quotes 
to them. What do you think about it?st':
>               if self.checkTestFlag(TESTS['unportable-test']):
>                 dependencies += module.getDependencies()

No no, this is not the algorithm that I explained. You start with the
assumption that the dependency is to be omitted, and in some cases you
add it. Instead, you need to start with the assumption that the
dependency is to be included, and in some cases you then find that
it has not to be included.

Likewise, above, for the determination of the transitive closure: I explained
that the standard algorithm proceeds via multiple rounds, and you show
me a code with a single round. This one cannot produce the expected
results.

Please try to have the same algorithmic logic from the old gnulib-tool
to the new one. I don't want to have an algorithm that looks superficially
similar but produces vastly different results. I want the same algorithm
with the same results. The only difference is that it operates on Python
objects (GLModule instead of string).

Maybe it helps if you make an intermediate write-up of the algorithm,
like what you could read in a computer science text book. I tried to do it in
<http://lists.gnu.org/archive/html/gnulib-tool-py/2012-06/msg00045.html>.
Probably you need to use more symbolic writing, such as

   For every module A:
     For every module B in A.getDependencies():
       If B is not in avoids
         ...
         ...

in those places where I gave only an informal sketch.

Bruno





reply via email to

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