Commit Graph

31 Commits

Author SHA1 Message Date
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
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
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
44926cd53c Performance improvements while installing deps of a binpkg.
--HG--
extra : convert_revision : 2ad3b29cfd22489f76739287176f40dd9535dfee
2009-04-04 05:24:58 +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
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
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
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
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
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
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
297d7c6941 unpack: some printf related changes.
--HG--
extra : convert_revision : 6feb3492c0d59e80fa02fef527f2b9c8821cc56c
2009-02-17 19:41:21 +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
6b6162bb44 Added support for using noarch packages.
--HG--
extra : convert_revision : a96166ddecb6efe65d35283f25e06a944cc4a038
2009-02-16 00:39:41 +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
bb6355fe12 Allow installing/removing binpkgs as non-root.
--HG--
extra : convert_revision : 3781ef0a422530623cf64f45f87948e00d7e50e8
2009-02-07 18:05:40 +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