On 7/19/06, Lucas C. Villa Real <[EMAIL PROTECTED]> wrote:
> Changes to Scripts: Dependencies was trying to be smart and run the
> given program a second time without the additional argument, so that
> it would try "Compile Foo 1.2" and then "Compile Foo" if the former
> fails. Problem is, if the compilation of Foo 1.2 fails halfway through
> and it is the latest version, it would try to compile the same thing
> again! I added a check to have it retry only if the first compilation
> fails with a new "not found" error code.
What about checking whether the current $appversion is the latest
version, too? That will still make it possible to run "Compile Foo" as
a workaround.
Possible, but I was/am reluctant on making the Dependencies too smart
about making these decisions at that point of the script. Our
decision-making logic is currently spread all over, with many scripts
contributing little parts to it (Compile, InstallPackage, FindPackage,
GuessProgramCase, Dependencies, what else). It would be beneficial to
take aside some time and rethink the whole scheme.
> There's another problem I noticed, but I didn't fix this one: because
> Dependencies now asks all questions for a given recipe beforehand
> _without recursing_ the collection of questions but _recursing_ on the
> execution of comments, turns out that it ends up running Compile on
> the same program/version twice if it shows up as a dependency of a
> dependency and then later again in the main dependencies file. One can
> avoid this fixing the order by hand of the Dependencies files, but the
> right thing would be to rework the Dependencies script majorly. I
> added an Ask to Compile in those cases as a stop-gap solution.
I think André was working on this, but I'm not sure. Detsch?
I believe so. I started a rough prototype but he handled it from there
on. Both of us stopped working on it as we started focusing on getting
013 done, though.
> diff -u -r1.88 Compile
> --- bin/Compile 14 Jul 2006 16:56:43 -0000 1.88
> +++ bin/Compile 19 Jul 2006 16:15:50 -0000
> @@ -219,6 +220,18 @@
> cleanup
> }
>
> +function wrap_fail() {
> + # Rollback left-over stuff when compilation fails.
> + if [ -e "$target" ]
> + then
> + PrepareProgram --tree-cleanup $batch "$appname" "$versionnumber"
> + rmdir -p "$target"
> + rmdir -p "$settings_target"
> + rmdir -p "$variable_target"
> + fi
> + Die "$1"
> +}
> +
Apart from redirecting errors to /dev/null on 'rmdir -p', the patch
seems fine. I'm ok with it, though I haven't tested in yet.
Nice catch. Fixed it here.
Thanks,
-- Hisham
_______________________________________________
gobolinux-devel mailing list
gobolinux-devel@lists.gobolinux.org
http://lists.gobolinux.org/mailman/listinfo/gobolinux-devel