Commit Graph

29 Commits

Author SHA1 Message Date
Juan RP ceca72fca9 Add a printf for previous to know when that happens.
--HG--
extra : convert_revision : 9d716b7906f2ef7226afb608361e1286f45ce355
2009-08-09 03:26:56 +02:00
Juan RP a9479ad75a When removing a package, continue if there are missing files.
--HG--
extra : convert_revision : 2324cdb902b7aeeabe745e70341da3951efb749e
2009-08-09 02:45:35 +02:00
Juan RP 17404bdb42 Mega-commit with improvements and changes done in the past days.
- Introduce package states: unpacked, broken, installed, etc.
  Not yet finished, only unpacked and installed are used for now.

- Move package metadata files in binary packages directly to
  the top directory, this speeds up some ops and makes easier to
  continue working in future changes.

- xbps-bin: -C flag to check the hash of package files has been
  superseded by the 'check' target, which verifies the integrity
  of an installed package.

- Use the 'essential' object when upgrading packages, overwritting
  current files. This is needed for critical packages like sh, libc
  and others.

- Miscellaneous tweaks and improvements thorough the code.

--HG--
extra : convert_revision : 2073fcc123efc24b3e9327b5e22aa91752f20df6
2009-08-08 22:29:48 +02:00
Juan RP d8353810b6 Reorganize pkg metadata files.plist scheme to improve future changes.
This fixes an item from the TODO about 'xbps-bin -C files' not checking
configuration files.

--HG--
extra : convert_revision : bb661554a6b34a25066749844709b8cbaf5a4d6c
2009-08-01 11:23:41 +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 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 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 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 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 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 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 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 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 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 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 7e677c32d9 remove: also remove package metadata stuff.
--HG--
extra : convert_revision : 0a286d1fb33b81a90b0bfb5b41f25c1874d72093
2009-02-03 22:37:20 +01:00
Juan RP 6c252d43d4 Split installation/removal parts in prepost-action scripts.
There are two scripts that can be used now:
	- prepost-inst: for pre/post actions at installation.
	- prepost-rm: for pre/post actions at removal.

--HG--
extra : convert_revision : 5e054758f549f5c81693b825795fbb36e2d5513a
2009-02-03 17:32:51 +01:00
Juan RP 388dd30b45 check_installed_pkgname: returns a bool, so EINVAL is wrong.
--HG--
extra : convert_revision : 6f3d615a27a1bf76962b6daf88929efa8d5cde8e
2009-02-03 17:02:19 +01:00
Juan RP fe8ea8c21c Check that pkg is installed before removing.
--HG--
extra : convert_revision : 4ea85e367ecbc0d39dcba1c8ee63392f0e1177f7
2009-02-03 16:51:42 +01:00
Juan RP edfeec4622 Added support to run pre/post remove actions with binpkgs.
--HG--
extra : convert_revision : ecc70358e9009a0b2f71aaccc5b8b1282417e3bf
2009-02-03 16:07:08 +01:00
Juan RP 4a9125364a xbps-bin: added WIP remove target.
--HG--
extra : convert_revision : 71314f7183384094223cf10bf16ff704ca084883
2009-02-03 03:18:00 +01:00