Commit Graph

196 Commits

Author SHA1 Message Date
Juan RP 3f31d9163b lib/unpack.c: change some comments for consistency.
--HG--
extra : convert_revision : 7a016105f8616e09885b46205af883efd1f92dfa
2009-08-16 18:59:53 +02:00
Juan RP 74a7c643d6 xbps_find_orphan_packages: change some comments.
--HG--
extra : convert_revision : 7e807567b387d683ba487cb4ae7b897e840ab730
2009-08-14 07:33:01 +02:00
Juan RP 2843dcf4ff Use the same approach than RPM and pacman to handle config files.
It's explained in the pacman manpage.

--HG--
extra : convert_revision : 96f780d9f50f99162dcd40f5ae6eae70c0b89cd9
2009-08-14 07:12:05 +02:00
Juan RP e20bc0a239 xbps_configure_pkg: use a bool to know if pkg is installed or not.
--HG--
extra : convert_revision : 799b0e741c8660d84c68ec63c99dea8b52c093d7
2009-08-14 07:11:09 +02:00
Juan RP 99384e1f5e xbps_configure_pkg: add a safety check.
--HG--
extra : convert_revision : 4e3c7b7a52603baf0e447d1e32f9598df3b5b979
2009-08-13 17:30:39 +02:00
Juan RP ed711fe8b9 xbps_find_pkg_installed_from_plist: use xbps_prepare_regpkgdb_dict().
--HG--
extra : convert_revision : 0f6f5764049f176abaa94585b14e9bdfc9f99b78
2009-08-13 17:11:23 +02:00
Juan RP 0d04547576 Add the concept of purging a package, such as with dpkg.
By default a package when is removed, its configuration files
and metadata files won't be removed unless the package is purged.

While here add two targets for xbps-bin:

 * purge [<pkgname>|<all>], passing the "all" string (case insensitive)
   will purge all packages that are in this state (XBPS_PKG_STATE_CONFIG_FILES).

 * reconfigure [<pkgname>|<all>], reconfigures a package or "all"
   if package hasn't been configured. Passing -f reconfigures it again
   even if it's state is ok.

--HG--
extra : convert_revision : bd2d3913ca087a0565b05fa9ee3f9b6d5e3cb934
2009-08-13 16:46:20 +02:00
Juan RP 68c12ce4bb Use the correct variable for previous.
--HG--
extra : convert_revision : d769d977d5e252ce017a4445186cc6a8f84f99e5
2009-08-13 08:16:43 +02:00
Juan RP d0c2a3f51c Implemented item to handle config files.
Modified config files are preserved this way:

- Removing a package doesn't remove the file.
- Installing or updating a package doesn't overwrite modified
  file and file that comes with package is installed as "file.new".

--HG--
extra : convert_revision : 7bfc5b7e661f88d101d340baf541387590ac707d
2009-08-13 07:58:22 +02:00
Juan RP f4f050a2af Fix installation of packages with all reqdeps satisfied.
--HG--
extra : convert_revision : a9c39ff8170e62dfb169d94753eb43ad3f6817aa
2009-08-13 07:51:29 +02:00
Juan RP 697aecf693 lib/findpkg.c: share some code.
--HG--
extra : convert_revision : c466c6c986821623cebaed2a0eade9cc8658d6f0
2009-08-12 07:57:46 +02:00
Juan RP 5ace634ade Remove unused headers.
--HG--
extra : convert_revision : f845161efa23a3c8c9f18f4febc7087347b0cff2
2009-08-12 07:48:03 +02:00
Juan RP d89b19393b xbps_find_new_packages: iterator_reset -> iterator_release.
--HG--
extra : convert_revision : 2e5a55a859d40cf58fe70c3b7e17373fe3c05810
2009-08-12 07:17:11 +02:00
Juan RP 8cc7f6871d Added xbps_find_new_packages(): checks if there are new versions.
--HG--
extra : convert_revision : dcd764c96c013f8d299849791110af4f9a4a9401
2009-08-12 07:15:09 +02:00
Juan RP db53f42345 xbps_prepare_pkg: don't forget to set 'trans-action' obj.
--HG--
extra : convert_revision : 41c7ec70808ede09d87801ebd8e1b94fe5bd6205
2009-08-11 20:22:01 +02:00
Juan RP 45a58485eb xbps-bin: show which pkgs are updated and installed before proceeding.
--HG--
extra : convert_revision : 2c2fcd7f3c5909d14d1519ffc7e8ac0cad124b34
2009-08-11 18:53:24 +02:00
Juan RP 3e42bc6410 Flags are named XBPS_FLAG_XXX, add XBPS_FLAG_FORCE.
--HG--
extra : convert_revision : 4f7ad37910303a87788b2daac9b4ba11bf39becd
2009-08-11 14:01:28 +02:00
Juan RP 47185e0296 xbps_find_deps_pkg: check if "run_depends" obj is NULL.
--HG--
extra : convert_revision : 1040c5d31199bc110a8ad33c85790c3fc71bbbfb
2009-08-11 12:31:40 +02:00
Juan RP 1986dc93f3 xbps_remove_pkg: another missing rootdir check.
--HG--
extra : convert_revision : 1c2699c4d11073d49a01936c79a95968b0fb4b93
2009-08-10 10:29:17 +02:00
Juan RP 90b9325fbd xbps_remove_pkg: don't unregister pkg while updating.
--HG--
extra : convert_revision : 94b1a99f3799838f676a496028032347b40210d3
2009-08-10 00:33:11 +02:00
Juan RP a5829d5467 Fix xbps-bin install without using a rootdir.
--HG--
extra : convert_revision : 7d9b697caa3f6d5c8b3d07462093c33c7fbfea29
2009-08-10 00:08:58 +02:00
Juan RP 350566818c xbps_find_new_pkg: always set pkg state.
--HG--
extra : convert_revision : e259f424344c9aa618e9ba515a4d39a8b9a11655
2009-08-09 23:34:07 +02:00
Juan RP 9b7a658e44 xbps_remove_pkg: unregister and remove metadata in updates for now.
--HG--
extra : convert_revision : c5c8dc4c32199b1f0e4e26883cadea379a6e4239
2009-08-09 23:33:13 +02:00
Juan RP 6e9e92bd35 lib/unpack.c: remove redundant check against rootdir.
--HG--
extra : convert_revision : f20606fd343dd04d965d2fe2069d4e07c6dfab0c
2009-08-09 04:35:09 +02:00
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 f8819462b0 lib/Makefile: fix indentation.
--HG--
extra : convert_revision : 22a071ea6d01aa3eae03d3dcd825f6ac80d9fe9c
2009-08-08 22:56:08 +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 75cac4a637 xbps_find_orphan_packages: simplify and make it report the correct order.
--HG--
extra : convert_revision : f3b09a258e4cd0bdd310935b51742a09e8db4409
2009-08-08 22:16:45 +02:00
Juan RP 8b2fe3efe3 Introduce xbps_callback_array_iter_reverse_in_dict().
This function works by iterating an array in a dictionary
in reverse order, i.e from down to top.

--HG--
extra : convert_revision : 5e655c2edf3d42453f16830e2e944c7f6e2cd974
2009-08-08 22:14:42 +02:00
Juan RP 9affd1491a xbps_find_orphan_packages: use xbps_prepare_regpkgdb_dict().
--HG--
extra : convert_revision : 5c7b61ade09df674256ef9fb8f3b6d3e8d962ab3
2009-08-08 15:19:47 +02:00
Juan RP bca1fd8b47 xbps_file_chdir_exec: only chroot(3) if uid == 0 and /bin/sh exists.
--HG--
extra : convert_revision : f07bf2f511d896fc6f6c731b5ef04f3eebcd2eaa
2009-08-02 11:04:46 +02:00
Juan RP 67be65f444 xbps_prepare_regpkgdb_dict: fix a memleak.
--HG--
extra : convert_revision : be040d6ac96f45aed82f5aae538cae6965e288f8
2009-08-02 01:17:47 +02:00
Juan RP 7b22faf19d xbps_find_orphan_packages: fix a memleak.
--HG--
extra : convert_revision : 67547efacd9a711ae6f92889a41d2e93665a020d
2009-08-02 01:17:08 +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 816baf0d8a Sync the SHA256 code with NetBSD HEAD.
This fixes a buffer overflow and avoids unnecessary casts and
other cleanup thorough the code.

--HG--
extra : convert_revision : 4b389251cfb76b28028967cd60c409fe94f6c85e
2009-07-29 16:30:37 +02:00
Juan RP e1e3e254ab Remove dup xbps_cmpver_* func, use just the real one.
--HG--
extra : convert_revision : cde78bdcccc68bb865d5bd76a84c00055f451e96
2009-06-07 05:02:58 +02:00
Juan RP 39c24fdd2c xbps_unpack_binary_pkg(): merge a func on it.
--HG--
extra : convert_revision : 1cf498bf353a23062178b4be826b52bb48a3e906
2009-05-19 03:33:50 +02:00
Juan RP 3062c40e63 xbps_prepare_pkg(): fix <origin> obj location.
--HG--
extra : convert_revision : 0502559180e0aa2105fcde3e06ca73714725c31e
2009-05-19 03:33:15 +02:00
Juan RP 38e6679ff5 Implemented plist caching, that gives >30% performance.
--HG--
extra : convert_revision : 6302893f967be96f99a86d499ca62a8c005e56f7
2009-05-19 01:42:48 +02:00
Juan RP f55617312f xbps_get_regpkgdb_dict(): fix previous.
--HG--
extra : convert_revision : bf88602fe6a8c87901fc8e2ffa7f94464961fcbb
2009-05-17 19:46:46 +02:00
Juan RP 1ff41ddbd7 xbps_get_regpkgdb_dict(): fix two memleaks.
--HG--
extra : convert_revision : d66be453f2472e5fdb81b2810f1777166d9a04d3
2009-05-17 07:18:19 +02:00
Juan RP 9f108b4cd2 xbps-bin: implemented (WIP) "autoupdate" target.
Some parts in the library related to findings pkgs in repositories
has been improved vastly by caching the dictionary once.

Duplicated code has been added in xbps-bin/install.c, but will
be fixed soon.

--HG--
extra : convert_revision : 2924012a8589a2a6ecaa3863b5091049006c0ef3
2009-05-17 04:09:26 +02:00
Juan RP 99290baf5e Redo previous and use archive_read_format_tar() rather than _all.
--HG--
extra : convert_revision : 3c80ec13642737551b7bf38c25ee5494593aed4d
2009-04-18 23:58:49 +02:00
Juan RP fd8d47684a Revert "Only add support for bzip2/lzma compression and tar format in"
This reverts commit d8153785d25241d8e22ef664d484cf37a50c8ef2.

--HG--
extra : convert_revision : 62e08401d6a94e78d149ff5ce4ba455d087b39df
2009-04-18 23:55:38 +02:00
Juan RP e4c31936b2 Only add support for bzip2/lzma compression and tar format in
libarchive.

--HG--
extra : convert_revision : d8153785d25241d8e22ef664d484cf37a50c8ef2
2009-04-18 17:25:04 +02:00
Juan RP 046dbee415 Add xbps_get_pkg_revision() to get the revision string.
--HG--
extra : convert_revision : 5c58a44db6b3f1ff2c7f75173aff7d6509dfd4c9
2009-04-18 15:49:08 +02:00
Juan RP 504e123044 Build code with -Wconversion.
--HG--
extra : convert_revision : ac2ea951cae1e739335e428e0fc4d0f90045b77d
2009-04-11 16:15:06 +02:00
Juan RP bd3484fa6b Build code with -Wcast-qual, -Wcast-align and -Wsign-compare.
--HG--
extra : convert_revision : d489ad995bb69850cba5a352f3ac85b74a54b5cf
2009-04-11 15:52:32 +02:00
Juan RP ae1fb7b50c lib/Makefile: run ranlib(1) against the static lib.
--HG--
extra : convert_revision : 269ad3844ef145e0a962f7424258135aa2f74cd1
2009-04-10 19:09:13 +02:00