Commit Graph

102 Commits

Author SHA1 Message Date
Juan RP
c3afb4f4fb New function: xbps_get_pkg_dict_from_metadata_plist.
This function returns and internalized dictionary from a package's metadata
plist file as specified by its arguments.

Update all code to use it where appropiate.
2010-11-08 03:14:41 +01:00
Juan RP
679833156a Always release the object dictionary returned by xbps_find_pkg_dict_installed().
Document this in the public API header and update all code accordingly.
2010-11-08 02:02:35 +01:00
Juan RP
ec7cdde1e0 Misc cleanups and performance improvements.
- There's no need to check rval for prop_dictionary_get_*, we are sure the
  objects are there at prop_dictionary_set_* time.
- Avoid two chdir(2) calls per INSTALL/REMOVE run.
- Avoid using access(2) to check for existence of INSTALL/REMOVE scripts,
  just try to run the executable directly and check for ENOENT.
2010-11-06 06:44:00 +01:00
Juan RP
8ef8d86c12 Some changes for the XBPS libfetch's frontend code.
1) Raise the cache connection settings to more sane defaults (8->6, 16->2).
2) Introduce xbps_fetch_unset_cache_connection() to drop the caches.
2010-11-03 12:23:57 +01:00
Juan RP
8d998948ef xbps-bin.8: fixed two formatting errors. 2010-10-31 01:59:48 +02:00
Juan RP
210f2799fc xbps-bin(8): modify the 'list' target to accept an optional argument to
list packages in the specified state, so that you can list packages that
 need to be purged, configured and broken (will be used in the future).
2010-10-27 13:10:03 +02:00
Juan RP
ef7da88db1 xbps-bin(8): added a new target "find-files".
This new target 'find-files' can be used to find which installed
package(s) own a file. Exact matches like "/bin/mount" or patterns
like "/usr/lib/libb[ao]b\*" can be specified.
2010-10-27 00:25:02 +02:00
Juan RP
8534b79ffc Prepare for going-to-be-released 0.6.1.
Includes the following change:

* When replacing a package that is going to be updated in the transaction
   do not remove it, just overwrite its files and continue. The updated
   package will find that old files didn't match the SHA256 hash and will
   skip them. This solves the issue of new package updates requiring new
   dependencies with files that were previously stored in the old version.
   For example gtk+-2.20 containing gdk-pixbuf, and gtk+-2.22 requiring
   gdk-pixbuf externally.
2010-10-23 18:09:35 +02:00
Juan RP
f888b582f9 Added a configure script to emulate GNU autoconf and related changes.
Changes included in this set:

 * Added strlcat() and strlcpy() from OpenBSD, always use them if the
   system does not have them built in.
 * Changed an array of PATH_MAX size allocated in the stack, to a dynamically
   allocated buffer from heap. This should reduce memory usage a bit.
 * Simplify code that implemented a homegrown realpath(3) implementation,
   simply use realpath(3).
 * If compiler supports -fstack-protector, build all code with
   -D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all
   buffers are protected.
2010-05-19 22:38:27 +02:00
Juan RP
1fbc19959f xbps-bin: when replacing a pkg do not purge the old one, just remove it. 2010-05-12 07:47:40 +02:00
Juan RP
b8c9577df6 xbps-bin(8): added a new target 'show-orphans' that list all package
orphans currently installed.
2010-05-04 17:04:36 +02:00
Juan RP
1b44e18b35 Remove asciidoc build dependency, use troff manpages directly. 2010-05-03 21:50:34 +02:00
Juan RP
59693bf505 Update manpages for new XBPS project locations. 2010-05-02 11:36:17 +02:00
Juan RP
b04a0230cd xbps-bin/check.c: remove dead code, fix warnings found by clang.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428211107-nvoflpkfkz37y3us
2010-04-28 23:11:07 +02:00
Juan RP
db685f280d xbps-bin/install.c: remove unused vars, found by clang.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428193336-61glbrl5rnjpby4p
2010-04-28 21:33:36 +02:00
Juan RP
8ec438e168 xbps-bin/main.c: remove unused var found by clang analyzer.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428163341-3b947nuva6l5pv85
2010-04-28 18:33:41 +02:00
Juan RP
11de88d122 xbps-bin/install.c: fix a NULL pointer dereference in error path, found by
the clang analyzer.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428163137-hs9ac0rm47sz9k14
2010-04-28 18:31:37 +02:00
Juan RP
e274585c3c xbps-bin(8): added -p flag to also purge packages for the 'remove'
and 'autoremove' targets, after successful removal.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428012613-e2wpzknmrxkjntsd
2010-04-28 03:26:13 +02:00
Juan RP
6256b34ccc Some changes that will appear in 0.5.0:
* Add proplib-0.4.1 source and use it in XBPS. This is to avoid
   an external dependency, so that we depend on the features of the
   internal library. This also means that proplib is not required anymore.

 * Added support to read/write gzip compressed plists by default, thanks
   to proplib-0.4 that gained new functionality.

That means that from now, XBPS will be able to write compressed gzip
plist files for all metadata related work. This will vastly reduce
bandwidth required for fetching remote repo's pkg index file and
binary packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100420122238-zcb85rudt9p34e10
2010-04-20 14:22:38 +02:00
Juan RP
9bceb2adb7 xbps-bin: fixed the install target to work with pkgnames containing
multiple '-' characters, which resulted in incomplete pkgname.

The fix is to always append '>=0' if a pkgname is specified, and passing
a pkgpattern to xbps_repository_install_pkg().

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100226051333-od2siux4rmsa88m7
2010-02-26 06:13:33 +01:00
Juan RP
9f4b36292d xbps-bin: unset some bool vars while processing the transaction to avoid
wrong messages for preserve pkgs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100217041941-wrvm86m0tc7ynlvu
2010-02-17 05:19:41 +01:00
Juan RP
83ab3fe977 xbps-bin/remove.c: set some pointers to NULL before checking them.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100128164423-i00yg3xp3nlsoh6j
2010-01-28 17:44:23 +01:00
Juan RP
61dde1ac02 Always overwrite files while unpacking, this makes the "essential" obj obsolete.
This helps to catch upgrade problems and simplifies some parts of the code.
Bumped XBPS_RELVER because xbps_remove_pkg() has been changed.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100128150850-gcs93su38t6moydn
2010-01-28 16:08:50 +01:00
Juan RP
375330a956 xbps-bin: print different msgs for pkgs marked as preserve and essential.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125151648-s3d0zxaro5v5bh95
2010-01-25 16:16:48 +01:00
Juan RP
dae134cd48 xbps-bin/remove.c: simplify error paths.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125151604-jwhoavlbdhr645df
2010-01-25 16:16:04 +01:00
Juan RP
bf6b96c651 xbps-bin/check.c: simplify exit paths.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125151533-z7ub7xlqbhg97ij2
2010-01-25 16:15:33 +01:00
Juan RP
1c4d43306a xbps-bin(8): if -f is set, remove files and configuration files even
if its hash doesn't match for the remove and purge targets respectively.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125070948-841kw2r4knz2793e
2010-01-25 08:09:48 +01:00
Juan RP
17d87b3559 Repair upgrades of preserve packages, i.e kernel.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125052754-6xri8lfmykhof5dz
2010-01-25 06:27:54 +01:00
Juan RP
7f343b8dbe xbps-bin: fixed some stdout vs stderr printf issues.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125021454-n1bh7qjy27azr9du
2010-01-25 03:14:54 +01:00
Juan RP
088baa7699 Add defs for default fetch cache connection limits and use them in
xbps_fetch_cache_connection() if 0 is passed as argument.

xbps-bin: enable fetch cached connection when downloading binpkgs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124153156-4updprik11nwi7c1
2010-01-24 16:31:56 +01:00
Juan RP
489f6baaa6 xbps-bin: remove an extra newline in transaction ops.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124130757-mf0p5d6kajwd6t2k
2010-01-24 14:07:57 +01:00
Juan RP
c0b280c118 Mega-commit to document the API with doxygen.
Some changes were made to the API when making the documentation:

- A few exported functions are now hidden, because they were only used
  internally in the library.
- A few exported symbols were renamed to document them better than
  previously.
- Cosmetic changes all along the way, as well as some fixes here and there.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100121021019-onbsivlrhdb7t3ou
2010-01-21 03:10:19 +01:00
Juan RP
a165d20193 Error and warning messages should go to stderr, make it so.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100115141916-tpg2rga1i4pm42kj
2010-01-15 15:19:16 +01:00
Juan RP
6c27794c5b xbps-bin: simplify pkgname_from_pkgmatch() and fix a bug.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114123917-3tvrb3tp097nnq8r
2010-01-14 13:39:17 +01:00
Juan RP
7230203be4 xbps-bin: really fix previous, by using a hack for now.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114052501-e8xak6rhwf8tonf6
2010-01-14 06:25:01 +01:00
Juan RP
37008d3c75 xbps-bin: don't make false positives detecting pkgmatches vs pkgnames
while installing packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114030001-0m1cb3m1cf7oc7un
2010-01-14 04:00:01 +01:00
Juan RP
023841b060 Implemented blueprint 'install-pkg-by-pkgmatch' as specified in
https://blueprints.launchpad.net/xbps/+spec/install-pkg-by-pkgmatch

The implementation works as expected, it was easier that I thought.
Bump XBPS_RELVER because the API was changed slightly.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114011431-xv5q6bgahm6v9dbq
2010-01-14 02:14:31 +01:00
Juan RP
343600261c xbps-bin(8):
- Add -y flag to assume "yes" for all questions.
 - Print a proper error string when the transaction dictionary is empty.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091222134338-u9h0iybexedunm0h
2009-12-22 14:43:38 +01:00
Juan RP
7eea0f8e8e xbps-bin(8): implemented Launchpad blueprint "arbitrary-pkgname-args".
See https://blueprints.launchpad.net/xbps/+spec/arbitrary-pkgname-args.

The install, update and remove targets now accept a list of package
names that will be processed.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091222113736-0dawl4whvtdi5dj3
2009-12-22 12:37:36 +01:00
Juan RP
02c0c569a3 xbps-{bin,repo}.8.txt: s/SYNOPSYS/SYNOPSIS/
--HG--
extra : convert_revision : juan%40juan-desktop-20091218121933-hgss4vyhyaoj3pbn
2009-12-18 13:19:33 +01:00
Juan RP
eb885bbcc2 When executing the INSTALL/REMOVE scripts, always pass the UPDATE
value to them.

Bump XBPS_RELVER to 20091209.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091209151435-1yy9f7k2880tswz7
2009-12-09 16:14:35 +01:00
Juan RP
2d68cec780 xbps-bin: make the 'autoremove' target respect -f flag to bypass question.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091207055227-8kiks1f3k2tuoe2z
2009-12-07 06:52:27 +01:00
Juan RP
2faef604bd xbps-bin.8.txt: fix typo.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091205000558-cktvvd1ka6445g62
2009-12-05 01:05:58 +01:00
Juan RP
20ec9c3b6d Fixed typos in xbps-{bin,repo} manpages.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091202061945-kpgqqrc9pgriosb3
2009-12-02 07:19:45 +01:00
Juan RP
b03a18ff84 xbps_unpack_binary_pkg: removed 2nd bool argument, look for a preserve object
to not remove files in removal or upgrades.

Bump XBPS_RELVER to 20091202.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091202053103-uby6hwu313pieafa
2009-12-02 06:31:03 +01:00
Juan RP
94bb169c88 Rename lib/repository_plist.c exported functions.
xbps_get_path_from_pkg_dict_repo -> xbps_repository_get_path_from_pkg_dict
xbps_get_pkg_plist_dict_from_repo -> xbps_repository_get_pkg_plist_dict
xbps_get_pkg_plist_dict_from_url -> xbps_repository_get_pkg_plist_dict_from_url

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091130113538-bji65cydf3bkwxkw
2009-11-30 12:35:38 +01:00
Juan RP
91aeac4dad Rename some function from lib/repository* with more meaningful names.
xbps_unregister_repository() -> xbps_repository_register()
xbps_register_repository() -> xbps_repository_unregister()
xbps_find_deps_in_pkg() -> xbps_repository_find_pkg_deps()
xbps_prepare_pkg() -> xbps_repository_install_pkg()
xbps_find_new_pkg() -> xbps_repository_update_pkg()
xbps_find_new_packages() -> xbps_repository_update_allpkgs()
xbps_get_pkg_props() -> xbps_repository_get_transaction_dict()

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091130110846-5uaqxdhfo0kl0cqd
2009-11-30 12:08:46 +01:00
Juan RP
4e38be11f4 xbps-bin: fix assertion with pkgs containing the "replaces" obj.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129045149-l8zvcbo1w1jzglai
2009-11-29 05:51:49 +01:00
Juan RP
1a5d19dca2 Fix and improve how missing pkg dependencies are handled from repos.
- Use an array of strings to store the pkgdeps.
- While adding a missing pkgdep, check if it's already in the queue and
  new required version is greater, in that case replace with new one.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129021735-5dqfucofny8slks2
2009-11-29 03:17:35 +01:00
Juan RP
eb0567bfab xbps-bin(8): mention /var/db/xbps/metadata/pkgname/*.plist.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128081809-2wk7hvlwtr6m9y8b
2009-11-28 09:18:09 +01:00