This is the mail archive of the
cygwin-apps
mailing list for the Cygwin project.
Re: [PATCH] inform user if any postinstall script failed to run
On 30/07/2010 21:46, Christopher Faylor wrote:
> Actually, I barely care but would it be better to just use a goto the if
> statement at the end of that function and exit from the bottom?
>
> If you don't think it's a good idea then nevermind. Whatever it takes to
> finally fix this is fine with me.
Well, what I decided was: looking at the end of that function,
> }
>
> if (lst)
> delete lst;
> delete tarstream;
>
> total_bytes_sofar += package_bytes;
> progress (0);
>
> int df = diskfull (get_root_dir ().c_str ());
> Progress.SetBar3 (df);
>
> if (ver.Type () == package_binary && !error_in_this_package)
> pkgm.installed = ver;
> }
... if I'm going to make it all into a single-exit kind of thing, then that
single exit point should be at the start of all the shutdown stuff that's
going on there; but that would have involved moving a bunch of variable
definitions further up to the top of the function to avoid skipping over their
initialisation. At the very least I'd have to relocate the declaration of
error_in_this_package.
I reckon it's not terribly likely we'll ever have other reasons to come back
and take care to mark other kinds of non-installed-yet-installed packages
installed at any of the other early-exit points, so overall I rated minimal
disturbance ahead of future-what-if-flexibility and checked it in as posted.
cheers,
DaveK