Commit graph

43 commits

Author SHA1 Message Date
Juan RP
f0bbfad2ae lib/depends.c: remove some extra unneeded checks.
--HG--
extra : convert_revision : f7acb4754894690941a2087bc09b011c50ea3add
2009-04-10 01:46:05 +02:00
Juan RP
f80e1753a8 Remove knowledge from the library to install packages.
The library is only responsible now to find all binary packages
from repositories, sort them and create a dictionary with all
details. The frontend (xbps-bin) provides support for this,
and this allows for more flexibility and removes some stuff
that didn't belong in the library.

While here implemented support to show total download/installed
size for all packages that are going to be installed.

Next step will be to implement user interactivity before
installing/removing/updating packages.

--HG--
extra : convert_revision : 858e9a89bc6a60b348435f2416a8af3ebb6ea5c9
2009-04-09 02:29:15 +02:00
Juan RP
625a77883c Make xbps_remove_pkg_from_* return int rather than bool.
--HG--
extra : convert_revision : 9f413873669b552a4d7a6e25e667fe5ff43f6a78
2009-04-06 16:39:14 +02:00
Juan RP
ebf400f728 lib/depends.c: simplify store_dependency().
--HG--
extra : convert_revision : 83d806e199b0cc593a82a7f0d575994ea04277fd
2009-04-06 11:40:55 +02:00
Juan RP
44926cd53c Performance improvements while installing deps of a binpkg.
--HG--
extra : convert_revision : 2ad3b29cfd22489f76739287176f40dd9535dfee
2009-04-04 05:24:58 +02:00
Juan RP
856f1554bc Add some printfs when finding/sorting required deps.
--HG--
extra : convert_revision : f113844179d22f00390c218486cd34fdd23be6a4
2009-04-03 18:08:16 +02:00
Juan RP
54b6d87809 Added basic support to update a single package via "xbps-bin update foo".
--HG--
extra : convert_revision : 7214ab270ccb57a327afeed94f6a2efc4738442d
2009-04-02 02:46:36 +02:00
Juan RP
a4ee56a799 depends.c: remove unneeded code.
--HG--
extra : convert_revision : 1a8ee48e7fc60db7d9e40bf7d99535acbc1ec11c
2009-03-26 09:54:20 +01:00
Juan RP
da1cfa2cf2 New dependency sorting code that doesn't use priorities.
This new code correctly sorts all dependencies without needing
to look at required_by or priority objects.

--HG--
extra : convert_revision : 3aa07372ae07e6938b9120d560a49efdaeac0a4e
2009-03-26 09:26:07 +01:00
Juan RP
40b62ee70d Return appropiate value in xbps_check_is_installed_pkg().
Return -1 if package is not installed or dependency not satisfied.
Return 0 if same version required is already installed.
Return 1 if installed version is greater than required.

--HG--
extra : convert_revision : 359b79cbe809e1818fe999dc1d55da7e635dbe44
2009-03-17 04:32:03 +01:00
Juan RP
a67374bd66 Simplify all code that used rootdir and flags passed via xbps-bin.
Add util funcs to get/set global values for them:
 * xbps_[gs]et_rootdir()
 * xbps_[gs]et_flags()

--HG--
extra : convert_revision : 2584b098e68a684e7b0eeac57c2b1df4aba6589d
2009-03-17 00:32:26 +01:00
Juan RP
37e4be86f9 Added support to check the SHA256 hash for any binpkg before installation happens.
--HG--
extra : convert_revision : 4f812eb0cfb614461527e360db1692bd5f9c34aa
2009-03-02 23:38:24 +01:00
Juan RP
255c48b198 Added support to check SHA256 integrity for binary pkgs.
This currently checks:
 - While removing, any file is checked and if hash doesn't match the
   file is ignored and not removed.
 - While installing, if a binary pkg file doesn't match with the one
   reported by the repository's pkg index file, the process will be
   stopped.

--HG--
extra : convert_revision : 42bb64e89a092f0ff3e7d951e5b26e45d63a60fe
2009-02-26 05:41:49 +01:00
Juan RP
3b18195a6a Change code to compile with -Wall -Wextra.
--HG--
extra : convert_revision : 992e1515458c6ee36cd481d1ba0ff8febf892d12
2009-02-18 01:07:51 +01:00
Juan RP
fb998feacf xbps-bin: add -v flag, used when installing/removing currently.
--HG--
extra : convert_revision : d543b52213bf3d35b17ef29ff74a879bc4342cef
2009-02-17 00:08:03 +01:00
Juan RP
6b6162bb44 Added support for using noarch packages.
--HG--
extra : convert_revision : a96166ddecb6efe65d35283f25e06a944cc4a038
2009-02-16 00:39:41 +01:00
Juan RP
746d59a9dd Some improvements for installation of binary packages.
* If any dep of a package cannot be found in the repository pool,
  show it on xbps-bin.

* Add the automatic-install boolean obj into pkg's dictionary
  on regpkgdb.plist, this will be used to implemented something
  like "apt-get autoremove".

--HG--
extra : convert_revision : 666e2fa666ac94140159896e28b445e88e8afb7a
2009-02-15 20:23:23 +01:00
Juan RP
3c7b8186e6 Fix binpkg installation with multiple repositories.
New changes include a modified algorithm of the previous one, which
finally does not fail even with multiple repos, YAY!

Fixed some leaks as well, thanks to valgrind.

--HG--
extra : convert_revision : 3cffe1e9e9e9f7abf225ca3c6643377fc12a94bd
2009-02-14 01:37:12 +01:00
Juan RP
f3f5192d5b Use xbps_check_is_installed_pkg(), which performs version checking too.
--HG--
extra : convert_revision : 510a9bceec5e54791be76cc28f36f0e5b6d513eb
2009-02-12 22:51:46 +01:00
Juan RP
774d14ac93 xbps_install_pkg_deps: fix a leak if installing a required dep fails.
--HG--
extra : convert_revision : e29096f8929dfcf41f6a0c75f758f9d8f4b67596
2009-02-12 21:17:35 +01:00
Juan RP
28cfeea6d1 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
2009-02-12 17:30:38 +01:00
Juan RP
939a63036e Added support to keep track of reverse depends on installed packages.
--HG--
extra : convert_revision : 9e3e46f726ef28843dc52b95ce818637c2a18de5
2009-02-10 02:52:12 +01:00
Juan RP
1eb9ea591a Fix binpkg dependency installation with new code.
--HG--
extra : convert_revision : fc6c3fd108caf4cedec0edd3b813edbdfb6bd8be
2009-02-09 16:39:55 +01:00
Juan RP
126928ca8d Merge branch 'master' of ssh://xtraeme@repo.or.cz/srv/git/xbps
Conflicts:
	lib/depends.c

--HG--
extra : convert_revision : 568341c7637aa537838880da03bd4dda819902ea
2009-02-09 16:09:39 +01:00
Juan RP
c0c746b67d Fix some trailing whitespace and indentation bits.
--HG--
extra : convert_revision : f1dd75ffa567945c74ded99e2ea9355eed56df97
2009-02-07 13:33:20 +01:00
Juan RP
61f0b09698 New dependency/install/unpack WIP code.
This implementation will be faster and resolv the dependency chain
correctly taking into account indirect/direct deps and priority.

--HG--
extra : convert_revision : cc4ec186f06f944fa8825b176344c4d612658f85
2009-02-07 13:27:24 +01:00
Juan RP
d58debb35c find_deps_in_pkg: no need to call xbps_pkg_has_rundeps() in the loop.
--HG--
extra : convert_revision : d9a1f3cc1e598a3d00cd7f26cc862bd7945523ee
2009-02-06 00:47:31 +01:00
Juan RP
3a52668aed Reorganize headers and move two funcs into util.c, where they belong.
--HG--
extra : convert_revision : 63d54dddfeb732da2204244fd9f00cff434e5540
2009-02-05 16:53:49 +01:00
Juan RP
b1c26d1dba depends: remove a cosmetic printf.
--HG--
extra : convert_revision : f15309b3e59c4c8d85f8b013b9c50a737bd78eba
2009-02-04 03:39:45 +01:00
Juan RP
aafefa6c23 Simplify xbps_add_pkg_dependency().
--HG--
extra : convert_revision : d4702da2278e65eabf998f2cbe7b3cd10eb34852
2009-01-03 14:59:55 +01:00
Juan RP
5d3e701b3a Simplify xbps_get_dependency().
--HG--
extra : convert_revision : 2174be8c7c6386f403a3d2d96c8443629fa6db21
2008-12-29 07:01:01 +01:00
Juan RP
b445b83fd3 Implement a stupid sorting dependency algorithm.
Dependencies are sorted with highest to lowest priority by the
following rules:

	- package has highest required count and priority.
	- package has highest priority.
	- package has highest reqcount.
	- everything else.

--HG--
extra : convert_revision : e661b90c38f6b6ca4d9559c0f88d1e4ea9df6c1e
2008-12-29 06:46:08 +01:00
Juan RP
a00a9a52b2 Use fdatasync() once the package has been unpacked.
At least there will be more chances that important data has been
written to disk.

--HG--
extra : convert_revision : 251af5da3f587cad976a9f5b903e5c3bdf5a229a
2008-12-28 09:48:18 +01:00
Juan RP
926b1dfa4a Improve binpkg priorities, dynamically allocate mem, etc.
--HG--
extra : convert_revision : 479011aba6e9da4e5662137381e04042e762d428
2008-12-27 22:19:04 +01:00
Juan RP
86cdb7dae6 Install packages in order from highest to lowest priority.
--HG--
extra : convert_revision : 33be12f1d249bfd8f76d4f1cb8374dfc3f71df21
2008-12-27 17:26:47 +01:00
Juan RP
456c6a2763 depends: fix a leak while destroying the simple queue.
--HG--
extra : convert_revision : aabc102f55fd81bce8b007d209596d40576eb8a5
2008-12-27 16:37:43 +01:00
Juan RP
b2abe59c52 Added support to specify a root directory for xbps.
All xbps metadata files will go into <rootdir>/var/cache/xbps
and package data will go into <rootdir>/<data>.

--HG--
extra : convert_revision : 37007ac4f9b99b31465612a58749713b3164139b
2008-12-27 12:56:51 +01:00
Juan RP
ccd4556853 depends: use a simple queue rather than a doubly linked list.
--HG--
extra : convert_revision : efd410c0f507b2d45fea9e38af34e89465c912c4
2008-12-27 02:14:09 +01:00
Juan RP
d309f54ff1 Register binary package if unpacking was successful.
--HG--
extra : convert_revision : ac984d640acb340e3a8db2ac07e41d15b1eea89e
2008-12-26 10:13:03 +01:00
Juan RP
91f7df59cd Support for installing pkgs from multiple repositories.
--HG--
extra : convert_revision : fc8a430e71d202aa9e7560b921669f62f1947ae1
2008-12-26 04:36:51 +01:00
Juan RP
4101025318 Working dependency handling for binary packages.
--HG--
extra : convert_revision : d0ff56b524efba53b11b7635972b03feaaeb889a
2008-12-24 10:58:19 +01:00
Juan RP
fa3b59b246 Another checkpoint for installing binary packages.
At least now dependencies are tracked, not sure it will be
enough for real life :-)

--HG--
extra : convert_revision : 962de22d515efa5599c148f918c14d32b5d9496d
2008-12-24 07:20:19 +01:00
Juan RP
26c054d773 Checkpoint for installation of binary packages.
--HG--
extra : convert_revision : 0bc55ebae04b2e1e5ab20feca786b649fc2e0335
2008-12-23 12:28:21 +01:00