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

Re: On links and things (LONG)

Charlie Brady writes:
> > 
> > > [...]  I think that we should be accounting file space
> > > used/free/available for every package selected/deselected, which would
> > > be difficult in shell, but not too hard in perl.  But since you and Ian
> > > have made your minds up, there's no point in discussing that, eh?
> > 


> It's not so much the arithmetic that's missing as the difficulty of the 
> parsing. In order to do package size accounting, you need a database of 
> directory and size pairs, which need to be matched against the partition 
> mount points. For example, elm.tgz from debian 0.81:


> That should be enough to see what I mean. The matching, logic and 
> arithmetic would be much easier to do in perl, especially, I think if a 
> dbm file was used for the data, although I haven't used dbm files myself. 
> Before anyone throws out the idea, think how much benefit could be 
> obtained from knowing how much space you have *before* doing any package 
> installation, when you can still easily add or subtract a few packages, 
> change the mount points or re-arrange the partition sizes. The package 
> usage information is easy to generate, and easy (I'm guessing) to convert 
> to a dbm file if that was useful.
> I'm not suggesting that we do this overnight, but I think it is useful 
> and worth striving for, so that we can have the *best* installation 
> procedure.

This is something that has definitely not been thrown out.  I've been
thinking since October of adding this, but as yet I haven't really done
anything about it.  I have not yet found a way to do it simply.
Charlie is quite right about the difficulties.  It would be easy enough
to do if we could assume only certain mount points would be used, but
we can't do that.  Some sort of database would need to be used (for
performance reasons we can't determine this information at runtime),
and dpkg would need to be smart enough to match the database entries
with the partition setup chosen by the user.

Incidentally, this is what I have envisioned:

[user selects package foo, and some point of the screen is redrawn...]

/: 3148/8193 (38.4%), /usr: 47839/70619 (67.7%)

[user selects package bar, and some point of the screen is redrawn...]

/: 3148/8193 (38.4%), /usr: 49812/70619 (70.5%)

and so on.  dpkg would produce a warning when the user is getting close
to filling the filesystem, tries to quit or process in such a state,

I certainly agree that this would be a phenomenal addition to the
installation process.  If anyone would like to play around with
implementing this, then I will be very happy to hear of your
experiences or take a look at patches (try to keep as much as possible
in seperate functions, as my copy of dpkg is constantly evolving and
it's much easier to drop in entire functions that to patch parts here
and there).


Reply to: