[wpkg-users] [Bug 77] Zombie package handling

bugzilla-daemon at bugzilla.wpkg.org bugzilla-daemon at bugzilla.wpkg.org
Tue Oct 30 13:05:36 CET 2007


http://bugzilla.wpkg.org/show_bug.cgi?id=77





--- Comment #11 from Rainer Meier <skybeam at users.sourceforge.net>  2007-10-30 13:04:24 ---
Well my point of view about syntax errors in production XML files is that WPKG
should immediately exit with an error in such condition. I will investigate if
it does not do this currently.

However I started thinking/implementing about my proposed enhancement of not
marking packages for removal if they are missing in packages.xml but referenced
in the profile.
Unfortunately I struggled about a logical error here: Package dependencies.
The dependencies between packages (NOT profiles) are listed within packages.xml
only. So let's assume that I (accidentially) removed a package from
packages.xml (or packages.xml is empty...). Then WPKG would check all installed
packages (from wpkg.xml) for their matching name within profiles.xml. This is
entirely fine for all installed packages - except for dependencies. Dependent
packages are NOT listed within profiles.xml and just reveal after a dependency
analysis of packages.xml.
Therefore all packages which are installed just because of a dependency are
"lost". This is even more important since it would lead to removal of a
dependency package. You would usually end up keeping the referenced package
from profiles.xml but removing the dependency package if not listed otherwise.

Well one could claim that this does not happen very often and dependencies are
not used that much usually. However the scenario could happen. So I don't like
to implement it like this.

As a matter of fact the dependencies can only be retrieved from packages.xml.
If the entry of a package is missing then the dependencies will be missing as
well (if not referenced in another place or through another an available
package entry).

The only location where the dependency information might still be available is
the local database (wpkg.xml).

So I propose the following algorithm:
- Get a list of all "supposed to be installed" packages from the profile
(package IDs)

Do the following for each package of this list (including its dependencies):

- Check for each ID if a corresponding package entry is available within
packages.xml and add it to the list of packages to be installed/verified.

- If no package entry is available look for such an entry within the local
database and add it (including dependencies). Additionally print warning about
missing package node within packages.xml.

- In case no package node is available (neither within packages.xml nor within
wpkg.xml) then the package is neither installed nor available for install =>
print error about inconsistent profiles.xml. Continue with next package.

---

After that algorithm you end up with an array of package nodes which have to be
installed and are available fro installation.

By the way: I found that the install-order is determined by priority only.
Dependency packages are added but it is not assured that dependencies get
installed first (I could be wrong of course). This should be fixed as well -
but may be later...

Another thing I noticed is the fact that packages are added uniquely by using
the searchArray() method. It compares the array elements by using the "=="
operator. According to my knowledge (mainly Java, not JavaScript) it compares
the object references, not its contents. So it might happen that two packages
with the same ID (but different packages.xml nodes) are added to the list. I
propose to fix that as well to make sure that a package with a certain ID is
added only once (even if multiple nodes with the same ID exist).

I just added these comments here in order not to forget. I will probably open
another bug report for that right after the zombie handling has been sorted
out.


-- 
Configure bugmail: http://bugzilla.wpkg.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


wpkg-users mailing list
wpkg-users at lists.wpkg.org
http://lists.wpkg.org/mailman/listinfo/wpkg-users



More information about the wpkg-users mailing list