Commit graph

105 commits

Author SHA1 Message Date
Juan RP
6b66d33d2c lib/unpack.c: don't use ARCHIVE_EXTRACT_SPARSE for now.
It seems that it was failing in the VM where I'm running only
all xbps packages for unknown reasons.

--HG--
extra : convert_revision : d7403820e238688af67265aed921ad7a007d27a4
2009-03-08 16:59:48 +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
4c70b24941 remove.c: check that required objs are in files.plist.
--HG--
extra : convert_revision : a4e15ac3f48bf496d8671997b8e875c750b42730
2009-03-02 02:47:12 +01:00
Juan RP
0d8f08e8ea Added support to list and remove orphaned packages.
A new target has been added to xbps-bin: autoremove. It works in
the same way than 'apt-get', but there's no stdin input. By default
it will list you all orphaned packages, and -f flag must be set
to really remove them.

The following is a real example for the git package, which requires
directly perl and curl-libs, and indirectly libidn and openssl.

$ xbps-bin -r ~/testing-xbps remove git
Removing package git-1.6.1.3 ... done.
$

$ xbps-bin -r ~/testing-xbps autoremove
The following packages were installed automatically
(as dependencies) and aren't needed anymore:

	perl-5.10.0 curl-libs-7.19.0 libidn-1.10 openssl-0.9.8j

If you are really sure you don't need them, use -f to confirm.
$

--HG--
extra : convert_revision : 70eebaa3d99be27753b94f580c8ec86330c7c2d3
2009-03-02 02:26:20 +01:00
Juan RP
ef6b5290af sortdeps.c: use a high priority for packages that don't have run_depends.
--HG--
extra : convert_revision : b7f546d5222537401854bc80bb61cfb652c442dd
2009-03-01 17:33:19 +01:00
Juan RP
01a12891ef plist.c: fix a leak in xbps_find_pkg_installed_from_plist().
--HG--
extra : convert_revision : 50b23bcd6f0821a9ed8b8598f5d4b05fd8197919
2009-03-01 17:32:52 +01:00
Juan RP
be170f0cb7 Fix some problems with dangling links while removing a binpkg.
First remove all links, next files and last dirs.
Only check the SHA256 hash for files, skip links and dirs.

--HG--
extra : convert_revision : b1762d5e795959591c732f625d25adfd1840f592
2009-02-28 17:32:38 +01:00
Juan RP
905a6a38ad install.c: avoid using extra pointers when you only need one.
--HG--
extra : convert_revision : 0b8bfe3403b9753be7cc3e0603aeb8f353418f93
2009-02-28 17:22:05 +01:00
Juan RP
750f467fe6 Take into account $conf_files and $keep_dirs when removing a pkg.
* If a dir is listed in $keep_dirs it won't be removed (anyway any
  directory that is not empty won't either).
* If a config file hasn't been modified (SHA256 hash matches) the
  file will be removed, otherwise it won't be removed.

There's still missing support to handle new configuration files when
there's an existing file, but will do later.

--HG--
extra : convert_revision : 448af95876fc7a47da07a9a910d6111047f72271
2009-02-27 17:41:31 +01:00
Juan RP
d9cc1d6b8f Implement support to update required_by objs when removing a pkg.
--HG--
extra : convert_revision : 405986d806ff23ce6348b22a2d7c48e0820ab1b9
2009-02-27 16:03:25 +01:00
Juan RP
a00ae944b5 Rename prepost-{inst,rm} to just INSTALL/REMOVE.
Some other changes related for this:
 - Modify binpkg.sh to always insert the INSTALL script at head of
   the archive, and appending files after it.
 - Modify binpkg.sh to compress binpkgs with bzip2 -9 to save some bytes.

--HG--
extra : convert_revision : b651b944f11c48dede1bbcea658182bf0984e8f3
2009-02-26 18:01:18 +01:00
Juan RP
46a42f7500 unpack.c: add missing \n in error msg.
--HG--
extra : convert_revision : ba47dd04be5b7a8d4d5a1e97b28573e67f89a79e
2009-02-26 14:37:01 +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
eb2e824a33 xbps-bin: while installing binpkgs, detect properly in some cases its return value.
--HG--
extra : convert_revision : 89cb21eed183c1d9702613690fb7f48f8cceb5e2
2009-02-22 06:00:08 +01:00
Juan RP
d6e2d02e9f requiredby: don't add dups.
--HG--
extra : convert_revision : a883cf0a080e99120b3e17a8836b132ff94079f0
2009-02-18 05:33:19 +01:00
Juan RP
8fa094ff02 unpack: check rv and also errno, not rv twice!
--HG--
extra : convert_revision : f30a7c3135c05f55e6b6d6acd50f17d79e623c85
2009-02-18 03:15:37 +01:00
Juan RP
2f287003e0 xbps_install_binary_pkg: chdir to / if destdir not set.
Fixes installation of binpkgs in the chroot.

--HG--
extra : convert_revision : fb68c94d81b1803fe77fb025929ffd727b04cbbb
2009-02-18 03:14:27 +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
6f8647f5c8 xbps_get_pkg_{name,version}: check for strrchr() returning NULL.
--HG--
extra : convert_revision : 4d63c1834f7b3c3b1a0395a7434095e9fc341885
2009-02-17 23:28:40 +01:00
Juan RP
297d7c6941 unpack: some printf related changes.
--HG--
extra : convert_revision : 6feb3492c0d59e80fa02fef527f2b9c8821cc56c
2009-02-17 19:41:21 +01:00
Juan RP
fda3da1543 Use string version comparator code from FreeBSD.
This fixes all cases that previous code has with no changes...
sorry pancake.

--HG--
extra : convert_revision : 993d0aa060daf36d1b5ffa63725002dda122c091
2009-02-17 03:49:02 +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
8d5e1ab017 More cosmetics printfs for previous.
--HG--
extra : convert_revision : 6104b54261f97758aff715a1e2ccabf606cbb13e
2009-02-16 23:00:50 +01:00
Juan RP
91291d5aec Improve informative messages when installing binpkgs.
This now looks like:

$ xbps-bin -r /raid/random/xbps/test install initramfs-tools
Installing dependency xbps-base-dirs: found xbps-base-dirs-0.2 ... done.
Installing dependency glibc: found glibc-2.9 ... done.
Installing dependency e2fsprogs: found e2fsprogs-1.41.3 ... done.
Installing dependency zlib: found zlib-1.2.3 ... done.
Installing dependency gawk: found gawk-3.1.6 ... done.
Installing dependency findutils: found findutils-4.4.0 ... done.
Installing dependency sed: found sed-4.1.5 ... done.
Installing dependency grep: found grep-2.5.3 ... done.
Installing dependency gzip: found gzip-1.3.12 ... done.
Installing dependency cpio: found cpio-2.9 ... done.
...
...
Installing initramfs-tools-0.92o ... done.
Package initramfs-tools installed successfully.
$

--HG--
extra : convert_revision : 79df585206c9ddc7f1267bc89bfd431ab572e527
2009-02-16 22:48:18 +01:00
Juan RP
524551eee8 unpack: ignore entry if already exists.
--HG--
extra : convert_revision : 7f570822db932d4ae45896e2981a9d8ff41824da
2009-02-16 22:18:40 +01:00
Juan RP
ee73775ed5 unpack: don't overwrite files by default.
--HG--
extra : convert_revision : 874850b5d5adbb570c93e963c6c0a4504cbd8c80
2009-02-16 21:42:03 +01:00
Juan RP
2fe1842d5c lib/Makefile: install the symlinks as well.
--HG--
extra : convert_revision : 07ec7de799468a2303fda8d3a311f22b4dce5d3a
2009-02-16 02:26:27 +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
4f6364a2bd lib/Makefile: install the so major lib, as suggested by pancake.
--HG--
extra : convert_revision : c22435714ec6712a38d4de9bf2c44c4e72c9a061
2009-02-16 00:38:35 +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
37725c0e97 xbps_sort_pkg_deps: there's no need to sort direct/indirect in two passes.
--HG--
extra : convert_revision : a6666b0605f34ac2440c61d09f25831dee9e67fa
2009-02-14 06:06:01 +01:00
Juan RP
5a894ad5e5 sortdeps: use a SIMPLEQ rather than a TAILQ, it's enough and faster.
--HG--
extra : convert_revision : b42935d05f31a74838140ef46293b65f9f0cb07d
2009-02-14 05:45:04 +01:00
Juan RP
3084354cec Fix previous.
--HG--
extra : convert_revision : a8073bfa4782f6c6a3e2afe760b184598f268807
2009-02-14 03:57:29 +01:00
Juan RP
b55346ae64 Show an informative error if binpkg cannot be found in repos.
--HG--
extra : convert_revision : 0c1e639cb598b19d258c1e1413dd1cb5930c4c61
2009-02-14 03:25:55 +01:00
Juan RP
afa0eeae72 plist.c: bah, forgot to update copyright's year.
--HG--
extra : convert_revision : 0ff12fa85651c077528e2ad147b845e63dd6ef76
2009-02-14 02:26:57 +01:00
Juan RP
83ed100fcf Use xbps_callback_array_iter_in_repolist() and removed dup code.
--HG--
extra : convert_revision : 7eb9c1b3df3fc7fde2ff61ac0cce1d635c3fef18
2009-02-14 02:26:11 +01:00
Juan RP
90fd3828e6 repository.c: update copyright's year.
--HG--
extra : convert_revision : 61a62966cd090b32a63254341b10e5f33ee85c4f
2009-02-14 01:58:26 +01:00
Juan RP
cfd928d563 Fix xbps_unregister_repository() func cb.
While here, change a var type to ssize_t... int64_t is overkill.

--HG--
extra : convert_revision : d5128f9d0c7da549fa2894d42b4a012c68478473
2009-02-14 01:50:18 +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
d420d00081 xbps_unregister_repository: return ENOENT if not found, not ENODEV.
--HG--
extra : convert_revision : c1be34bc1840ac351e8e2d301e2c71d247f0ea9c
2009-02-13 00:18:28 +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
03c899b33c xbps_sort_pkg_deps: fix a leak if all deps are satisfied.
--HG--
extra : convert_revision : 04f0a2ced6d83f57d7ea08650c1ed48ea860f6b0
2009-02-12 19:00:03 +01:00
Juan RP
97ceef46a8 xbps_register_pkg: check for NULL pointer.
--HG--
extra : convert_revision : ccc656dc49c75e371d4de10bdcd0c07bf01090f2
2009-02-12 18:59:14 +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
3b419a365e xbps_update_pkg_requiredby: fix a double free.
--HG--
extra : convert_revision : f821d215c3b97ca253ab1c170262d6bd9ae4f3fc
2009-02-10 12:04:10 +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
bb6355fe12 Allow installing/removing binpkgs as non-root.
--HG--
extra : convert_revision : 3781ef0a422530623cf64f45f87948e00d7e50e8
2009-02-07 18:05:40 +01:00