New dependency sorting algorithm made in 2 days.

This algorithm works for all packages currently usable on xbps.
Previous code didn't take into account the correct order between
indirect and direct deps.

--HG--
extra : convert_revision : c49a20ce300e6e9dfa565325b40745b5a78b78ed
This commit is contained in:
Juan RP
2009-02-12 17:30:38 +01:00
parent 3b419a365e
commit 28cfeea6d1
6 changed files with 403 additions and 231 deletions

View File

@@ -32,7 +32,3 @@ xbps-repo:
create the file from scratch, for performance.
* Some problems when installing binpkgs with repos:
- If first repo is valid but second is not, will fail.
lib:
* Dependency code has a problem yet: fix the order of dependencies with
the same priority, as seen by xbps-base-{chroot,system}.

View File

@@ -1,84 +0,0 @@
<dict>
-- Dependency chain for a package --
The order to which dependencies are installed is:
1- Indirect deps with high->low priority.
2- Direct deps with high->low priority.
Priority is increased by one any time a packages depends on, so a
package that is needed by 30 packages will be installed before
one that is needed by 10 packages.
<!-- Required deps that weren't found on any repository -->
<key>missing_deps</key>
<array>
<dict>
<key>pkgname</key>
<string>blurb</string>
<key>version</key>
<string>2.1</string>
</dict>
</array>
<!-- Required deps that are satisfied/installed -->
<key>installed_deps</key>
<array>
<dict>
<key>pkgname</key>
<string>blah</string>
<key>version</key>
<string>1.2</string>
<key>requiredby</key>
<string>foo-2.0</string>
</dict>
...
</array>
<!--
An array of dicctionaries for direct required deps,
sorted by descending order of priority.
-->
<key>direct_deps</key>
<array>
<dict>
<key>pkgname</key>
<string>blob</string>
<key>version</key>
<string>2.0</string>
<key>repository</key>
<string>/blah/foo</string>
<key>requiredby</key>
<string>foo-2.0</string>
<key>priority</key>
<integer>100</integer>
<key>filename</key>
<string>blob-2.0.i686.xbps</string>
</dict>
...
</array>
<!- An array of diccionaries for indirect required deps -->
<key>indirect_deps</key>
<array>
<dict>
<key>pkgname</key>
<string>X</string>
<key>version</key>
<string>1.0</string>
<key>repository</key>
<string>/blah/foo</string>
<key>requiredby</key>
<string>blob-2.0</string>
<key>priority</key>
<integer>90</integer>
<key>filename</key>
<string>X-1.0.i686.xbps</string>
</dict>
...
</array>
</dict>