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

Hard upgrader



If you all recall when I wrote the 'gental upgrader' we talked about
creating a more powerfull version that could easially handly a bo->hamm
upgrade. I wrote that more powerfull version today (I wanted something
more complex to run through the ordering code that I wrote the day
before). I have run it through 3 bo package files so far and it seems to
work wonderfully ie:

Wakko{jgg}~/work/deity/build/clients/cmdline#dpkg-get dist-upgrade
Updating package status cache... Done
Checking system integrity... Ok
Holding Back e2compr In favor of e2fsprogs
Killing xlib6-dev In favor of xlib6g
Suiciding ncurses3.0-dev In favor of libc5-dev
Suiciding libgdbm1-dev In favor of libc5-dev
Suiciding tcl76-dev In favor of libc5-dev
Suiciding xarchie In favor of elf-x11r6lib
The following packages will be REMOVED:
  xpm4.7-dev xlib6-dev libjpeg-dev getty ncurses3.0-dev xarchie tcl76-dev
  libnet libc5-dev libgdbm1-dev
The following NEW packages will installed:
  xpm4g svgalibg1 e2fslibsg libdb2 tk4.2 libnet-perl lesstifg
  whiptail zlib1g xlib6g dpkg-perl perl-base libgdbmg1 tcl7.6
  ss2g libg++272 libpng0g libtiff3g newt0.21 data-dumper comerr2g
  libc6 ncurses3.4 libjpegg6a libreadlineg2 slang0.99.38
Kept 0
144 packages upgraded, 26 newly installed packages, 10 packages to remove.
65949322 bytes to download, 13788000 bytes needed after install.

[In favor of simple means it would rather get rid of the package than fix
the other one - it would rather remove xarchie than make elf-x11r6lib
availble.]

Neat Eh? It magically deduced that 26 new packages could be installed and
that 10 should be removed. I think to make it truely usefull it will need
a command line indicating packages that you would really like to have. I
found that if you have libc5-dev and friends it will not install libc6-dev
but instead hold back your old version of gcc and install the newest libc5
stuff from hamm :>

The algorithm used by this upgrader is more complex than the simple
upgrader. The first thing it does is to auto-upgrade (this means
install all dependants and so on) all installed packages. Then it will try
auto-upgrade all Essential packages, then it will force install all
Essential packages (to advoid an essential conflicts loop).

After that it generates a list of scores for each package. It starts by
assigning a score based on the packages priority and essential flag then
adds +1 for each installed depending package. Then it propogates the
scores down one level (ie libc6 has a high score and depends on ldso, so
ldso has libc6's score added). Then it propgates provides scores to all
the providing packages (ie smail gets mail-transport-agent's score added).

This ordered list of scored packages allows the algorithm to take any two
packages and decide which is more important. So, it goes through each
broken package and asks, 'Should I fix this package or remove it?' which
is the same as 'Is this package more important than it's dependants?'. It
then either removes or keeps the package or removes or keeps it's
dependants until everything is working. A report is generated and the
Dependancy cache is loaded with the new state to be passed to the
installer+downloader or displayer.

There are a few troubles because I cannot know about obsoleted packages,
one such is that it will refuse to install util-linux because it conflicts
with getty and they end up with the same score. Getty should have a
reduced score because it is obsolete. e2cmpr and e2fsprogs have a problem
because they are both essential but mutually conflicting, right now it
turns out that e2fsprogs manages to get a higher score so it wins out in
ALL cases.

Tomorrow I will run the ordering code with these complex senerios through
the simulator and work out any bugs, then write the break code and finally
the dpkg invokation code - and presto :>

Jason

--- Top few items from a score table:
2804 libc6
578 ncurses3.4
245 ldso
212 sysvinit
208 debianutils
206 shellutils
131 libc5
130 perl-base
116 libg++272
113 comerr2g
113 libreadlineg2
109 slang0.99.38
108 libgdbmg1
107 ncurses3.0
106 login
106 bsdutils
106 dpkg
105 e2fslibsg
105 ss2g
102 gzip 

-- A typical essential, required package with nothing depending on it gets
a score of 102. (100 for essential, 2 for required)



Reply to: