Commit Graph

146 Commits

Author SHA1 Message Date
Juan RP
db6b1526d4 lib/sortdeps.c: remove useless check.
--HG--
extra : convert_revision : f1fd20ffc9f77187173422e44aee1a3c369f96cb
2009-04-10 18:38:09 +02:00
Juan RP
c1bc7a6a3c lib/Makefile: fix install target.
--HG--
extra : convert_revision : 4ab223f606cac1d5d8b1baea93f87909c607829c
2009-04-10 18:37:41 +02:00
Juan RP
d0d45c2ea9 Install the static libxbps library.
--HG--
extra : convert_revision : ff19e2c3f10ac330c4364d40b036ea0bd50b87a8
2009-04-10 17:09:12 +02:00
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
01be3b5920 Fix xbps_prepare_pkg() in pkgs without deps.
--HG--
extra : convert_revision : 9be76ef482e54bfbd7e6a038a504f8225aa89cfe
2009-04-10 01:36:22 +02:00
Juan RP
41d9b9acb8 lib/unpack.c: use fsync(), there's not much difference with fdatasync().
--HG--
extra : convert_revision : 9632271e53f4d44890d711943642afddedf69e72
2009-04-09 18:43:00 +02:00
Juan RP
58c6a31297 Define ARCHIVE_READ_BLOCKSIZE and use it rather than using magic numbers.
--HG--
extra : convert_revision : b8e6755400eb6f2bef0ea1eb25a258f9ed1714c2
2009-04-09 18:38:05 +02:00
Juan RP
053abca5ef Use glibc's sys/queue.h and remove the NetBSD local copy.
--HG--
extra : convert_revision : 2e6967a2666bcb7cd826293c03863890649f4c6d
2009-04-09 16:33:42 +02:00
Juan RP
aaf5f8fb40 Add some funcs from pacman: question(), yesno(), noyes() and strtrim().
--HG--
extra : convert_revision : 82fbbd28253b02968826bebe4252523c47903a49
2009-04-09 04:52:46 +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
32e81e7555 For INSTALL/REMOVE scripts use xbps_file_chdir_exec().
This will chroot() to rootdir and removes many chroot() commands
from those scripts.

--HG--
extra : convert_revision : 4845df1949996da1bcd2776fcc50c3d0a00b451b
2009-04-08 03:20:13 +02:00
Juan RP
3e9e342f74 Make xbps_file_chdir_exec() change root directory if /bin/sh exists.
If /bin/sh is not there, fall back to chdir(destdir) as before.

--HG--
extra : convert_revision : 7506a8db97346dbf45292e4c46b9d8ecc384162a
2009-04-07 22:54:34 +02:00
Juan RP
06e6244f40 lib/install.c: return rv not 0 in xbps_install_binary_pkg_fini().
--HG--
extra : convert_revision : bd6a815ab8a17add0200a8693221c5def18642a1
2009-04-07 15:50:29 +02:00
Juan RP
bb3240e4ac Do not reuse requiredby objects while updating pkgs.
--HG--
extra : convert_revision : 1bc0a25601b6ff1c4cd83de4dcd775ffdee1e9a1
2009-04-06 17:00:52 +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
147a8af559 lib/sortdeps.c: wrap long line.
--HG--
extra : convert_revision : 8484a1a0eed376e1cd4e9af9917d42dab91d5ef1
2009-04-06 14:44:35 +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
986a54a56f xbps_removed_binary_pkg(): chdir after checking if pkg is installed not before.
--HG--
extra : convert_revision : c06555f92939f37740b1677d842619eeb1f5d5ac
2009-04-05 14:48:24 +02:00
Juan RP
4f8d329867 xbps_remove_binary_pkg_meta(): fix a memleak if opendir(2) fails.
--HG--
extra : convert_revision : e5a107219e809abf4a8f5fac8e066016b1d46455
2009-04-05 12:47:02 +02:00
Juan RP
500cfe4b4f Simplify previous.
--HG--
extra : convert_revision : c93b6612845c64f9b9b929150014a76d6584ec1c
2009-04-05 12:46:15 +02:00
Juan RP
161f97ce97 Fix chdir() when rootdir it's an empty string.
--HG--
extra : convert_revision : bb7847fc538401d8c585bcb75114956f879077d3
2009-04-05 12:41:40 +02:00
Juan RP
4bf5c5f750 Introduce xbps_xasprintf() and use it where required.
--HG--
extra : convert_revision : 324a92a4824476059e0993d00c2b925c732a79f8
2009-04-04 19:32:39 +02:00
Juan RP
f5dd58df5d Simplify xbps_{un,}register_repository().
--HG--
extra : convert_revision : 95ac1ddedbc96fe3bf2a9dfe282c20385c8740ff
2009-04-04 18:05:18 +02:00
Juan RP
ba56172222 Add a func to remove a string obj from an array.
--HG--
extra : convert_revision : 2de9ea16361286a17e93e9fb65a93bd28e7688db
2009-04-04 18:04:37 +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
46f712b4e1 Add a func to remove a pkg from a dictionary.
--HG--
extra : convert_revision : 371d97cf7b6d28555b2b194a83254c29a12c44b4
2009-04-03 15:24:08 +02:00
Juan RP
c72bbb0a5b Add func that returns a malloc'ed buffer with the hash string of a file.
--HG--
extra : convert_revision : 66d886c413e0a909ccd678fe1ebdda44ab6fef8a
2009-04-03 12:10:28 +02:00
Juan RP
bf01da5dcf There's no need to overwrite files while unpacking.
--HG--
extra : convert_revision : 0af6a384b869b752a47e33e95cacb0c33521ee53
2009-04-02 04:52:29 +02:00
Juan RP
797b3dad46 Remove currrent installed pkg first while updating a package.
--HG--
extra : convert_revision : 8d93d1a59f47edf468781c66116bba45a3ecd70b
2009-04-02 03:08:20 +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
6a9d6518c9 cmpver.c: change syntax to <pkgname>-<version>_<revision>-<epoch>.
--HG--
extra : convert_revision : 89f8d1825437117f37a891f388d1d9a33c39c7d9
2009-03-19 00:25:41 +01:00
Juan RP
0ed055c4eb Don't continue installing a binpkg if newest version in repos is already installed.
--HG--
extra : convert_revision : b73376d091fd95f4cfd92cbdba21f4bc93781504
2009-03-17 05:10:21 +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
96cda65443 Simplify install_binpkg_repo_cb().
--HG--
extra : convert_revision : cffcd0098292f26170589d5a5db2261a204dc2be
2009-03-16 07:03:25 +01:00
Juan RP
e53bb1c885 sha256.c: remove unneeded macro.
--HG--
extra : convert_revision : d00be17201375e7562fb43b28e1c7b9da3b049b2
2009-03-13 00:31:17 +01:00
Juan RP
aee08a7f8f Make the code build with another bunch of warning flags.
--HG--
extra : convert_revision : 1c5b66b58e4c66ff61e9cef2cb3760ac675c1626
2009-03-13 00:21:55 +01:00
Juan RP
4eb9af23b6 remove.c: don't forget to chdir to destdir and add missing newline.
Now with some uncommitted changes removing a pkg with info files,
looks like this:

[juan@fedora-vm xbps]$ xbps-bin -r ~/blah remove make
Removing package make-3.81 ...
Unregistering info file: /usr/share/info/make.info-2.gz... done.
Unregistering info file: /usr/share/info/make.info.gz... done.
Unregistering info file: /usr/share/info/make.info-1.gz... done.
done.
[juan@fedora-vm xbps]$

--HG--
extra : convert_revision : b06a96125aa957c3d21e998596530372086b94da
2009-03-12 09:23:40 +01:00
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