Commit Graph

88 Commits

Author SHA1 Message Date
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
d90a248244 Rename struct repository_data to repository_pool.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091130112404-mlrt6x08thdvmrsn
2009-11-30 12:24:04 +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
e4cda0e9cc Rename lib/sync_remote_pkgidx.c to repository_sync_index.c.
xbps_sync_repository_pkg_index() renamed to xbps_repository_sync_pkg_index().

--HG--
rename : lib/sync_remote_pkgidx.c => lib/repository_sync_index.c
extra : convert_revision : xtraeme%40gmail.com-20091130105325-75rr2xm1zpi8bjwh
2009-11-30 11:53:25 +01:00
Juan RP
7996aeba3f Rename lib/depends.c to repository_finddeps.c and lib/findpkg.c to
repository_findpkg.c.

--HG--
rename : lib/depends.c => lib/repository_finddeps.c
rename : lib/findpkg.c => lib/repository_findpkg.c
extra : convert_revision : xtraeme%40gmail.com-20091130103814-25tr08vkc73cqutu
2009-11-30 11:38:14 +01:00
Juan RP
45f1d7b70a xbps_sort_pkg_deps: add debugging, use xbps_pkgdep_match().
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129045327-x2y95weqecbon4l4
2009-11-29 05:53:27 +01:00
Juan RP
bd9b545fc9 xbps_find_pkg_repo_deps: check if current pkg version in repo is
enough to satisfy the required rundep for a pkg!

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129045232-ext4zxqrtsmbbqku
2009-11-29 05:52:32 +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
a85073f6e8 xbps-repo: also print binpkg compression type in the show target.
Now it looks like:

$ xbps-repo show xbps-devel
Fetching info from: /storage/xbps/packages
Filename: xbps-devel-20091128.i686.xbps (size: 69K)
SHA256: 2c54a61fbd128097692edc19a7c17bfb10d93b3f055b04171cd1e4d97cde79df
Compression type: xz
Package: xbps-devel
Installed size: 216K
Maintainer: Juan RP [xtraeme@gmail.com]
Architecture: i686
Version: 20091128
Description: The XBPS package system (development branch)
 The XBPS package system. A new, fast, from scratch and simple
 binary package manager. This packages includes code from a development
 branch available from https://launchpad.net/xbps
$

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128051134-qzqqnwd76tcxgxb0
2009-11-28 06:11:34 +01:00
Juan RP
88ba635780 Split unpack.c config files and remove obsoletes code into its own files.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128044321-6kmhrrxggv2h681w
2009-11-28 05:43:21 +01:00
Juan RP
f3d2481c31 xbps-repo: if fetching info from remote repo for the 'show' and 'show-files'
targets and the binary package exists in cachedir, use it.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128022129-y6y2tr0vtvy2w745
2009-11-28 03:21:29 +01:00
Juan RP
21bea723f4 xbps_sync_repository_pkg_index: update comments.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128015352-2rdqhdod9r5fe1t1
2009-11-28 02:53:52 +01:00
Juan RP
e652de8d5a libxbps: remove unused xbps_check_pkg_file_hash().
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128015121-wxiy8y0ift5ykrdm
2009-11-28 02:51:21 +01:00
Juan RP
bf7ca100f6 xbps_unpack_binary_pkg: cosmetic changes.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128014936-0k9pmxox7igtlfmn
2009-11-28 02:49:36 +01:00
Juan RP
494504dbec Added support for a cachedir to store downloaded binpkgs.
libxbps:
 * Added xbps_set_cachedir() and xbps_get_cachedir(). By default it's
   set to /var/cache/xbps if not specified and it's always relative
   to the root directory.
 * Move mkpath() code from sync_remote_pkgidc.c into its own file mkpath.c
   to use it in another parts of the code.
 * Added xbps_get_binpkg_local_path(), that returns the local path to
   a binary package file, stored in cachedir or local repo.
 * Remote pkg index files are now stored directly in metadir/repodir,
   skipping the arch directory because binpkgs are now in cachedir.

xbps-bin:
 * Added -c flag to set the cachedir.
 * Check sha256 hashes in the download stage so that it can check
   a downloaded binpkg immediately once is stored.
 * If a binpkg doesn't match the hash it will be refetched.

Bump XBPS_RELVER to 20091128.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128013841-kkcvk07lsqdr26w8
2009-11-28 02:38:41 +01:00
Juan RP
0d0e6d06b1 xbps_repository_pool_init: if unexistent repos are registered,
ignore them but do not report any error.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091127005130-ut5dslafwnrg2pye
2009-11-27 01:51:30 +01:00
Juan RP
0173a28aa2 xbps_repository_pool_init: ignore invalid repositories if always there
is one that is working, otherwise report an error.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091126204146-ikfwi8zvag1s3446
2009-11-26 21:41:46 +01:00
Juan RP
30fc7b050a xbps_find_pkg_installed_from_plist: if pkg is in 'config-files'
state, treat this as not installed and set errno to ENOENT.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091126040107-zj0stff23hlta1d2
2009-11-26 05:01:07 +01:00
Juan RP
572068d3df xbps_get_path_from_pkg_dict_repo: adding rootdir wasn't correct for
a local repository, remove it.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091126034026-gufqt4x1uwme5675
2009-11-26 04:40:26 +01:00
Juan RP
87a216fd11 Major changes in libxbps to implement caching in some cases.
libxbps:
 - Moved repolist code to lib/repository_pool.c.
 - Renamed xbps_{prepare,release}_repolist_data() to
   xbps_repository_pool_{init,release} respectively.
 - Moved regpkgdb dict code to lib/regpkgs_dictionary.c.
 - Renamed xbps_{prepare,release}_regpkgdb_dict() to
   xbps_regpkgs_dictionary_{init,release} respectively.
 - Use a global reference count for repository_pool and regpkgs_dictionary,
   this gives a substantial performance gain while looking for dependencies
   in repository pool, among other things.
 - Make xbps_find_pkg_* functions return errno and use it to detect
   for spurious errors in code using them.
 - Add code to detect when a dependency is already unpacked.

xbps-bin:
 - Do not set pkg state to unpacked in the transaction, it's set already
   while a package is unpacked.
 - While installing or updating packages, it now knows when a dependency
   is already unpacked and shows it as "unconfigured".

Bump XBPS_RELVER to 20091126.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091126022250-uu8x0fa86l4scb5x
2009-11-26 02:22:50 +00:00
Juan RP
04d9ab2322 xbps_get_path_from_pkg_dict_repo: new function that returns a malloc'ed
string with the full path to a binary package file.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125042953-x2nhwi8kxg75ukyq
2009-11-25 04:29:53 +00:00
Juan RP
787416a0cd xbps_get_pkg_plist_dict_from_repo: split reading the pkg plist dict
from an url into a new function, xbps_get_pkg_plist_dict_from_url.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125025258-dnq0lstx67xj6w8t
2009-11-25 02:52:58 +00:00
Juan RP
c11094d5dd Added xbps_get_pkg_plist_dict_from_repo().
This function will fetch a requested plist file in a binary
package matching its 'pkgname' object by searching in repository pool.

This works in any kind of repository, local and remote. Some code
was Taken from NetBSD's pkg_install HEAD. Oh, and it's on-the-fly!
doesn't need to download the binpkg first!

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125020936-7uf2ncrf1692c5hz
2009-11-25 02:09:36 +00:00
Juan RP
164c661bcf xbps-repo: added 'show-deps' target to mimic xbps-bin(8).
As consequence of this, remove xbps_callback_array_iter_in_repolist().
Nowadays to iter over the repository pool we have a SIMPLEQ, this
allowed to simplify the code and remove some now unneeed stuff.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124104704-oyvrmb3tmd59w4e7
2009-11-24 10:47:04 +00:00
Juan RP
c676622869 Some changes to know if a file was downloaded successfully or not.
Improved xbps-repo sync/add and xbps-fetch to print informative
messages when a transfer was not necessary because local/remote size
and/or mtime matched.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124050326-owez7140fdxwepuk
2009-11-24 05:03:26 +00:00
Juan RP
83f71f3d2b xbps_fetch_file: in refetch case, do nothing if local/remote size match.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124035440-qhbft4gqlgbgc554
2009-11-24 03:54:40 +00:00
Juan RP
1c2fc20964 xbps_find_pkg_in_dict: return NULL if pkgname obj is not there.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091124030132-m2wgi7p38voah0ol
2009-11-24 03:01:32 +00:00
Juan RP
bf82b6512d Extensively verified that all functions have its return value
checked for any spurious error, this should make the core more safer :-)

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123094651-5prw0bkqmt3y8h23
2009-11-23 09:46:51 +00:00
Juan RP
ea468f850f xbps_get_pkg_index_plist: use xbps_check_is_repo_string_remote().
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123070214-gu6soxr8uflkomam
2009-11-23 07:02:14 +00:00
Juan RP
13706cf0a5 xbps-repo: changed the 'sync' target to update from all registered
remote repositories, so remove its argument.

xbps_sync_repository_pkg_index:
 - create the local repo dir in XBPS_META_PATH.
 - also add the uri scheme (http://, https://, ftp://) in the created
   local directory and subst ':' also with an underscore.
 - do not create local repo directories unless the download pkg-index
   plist file is verified to be fetched correctly.

xbps_check_is_repo_string_remote:
  New function to check if a repo string is a remote repository, use
  it in all places where it was used before.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123042316-rmu4w3ehoxwh3iz8
2009-11-23 04:23:16 +00:00
Juan RP
3de4aca129 xbps_register_pkg: check that required objs are there!
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091123002823-o49jdxxwbgvo31us
2009-11-23 00:28:23 +00:00
Juan RP
3bb3858cfb xbps_find_pkg_repo_deps: don't propagate rv to next calls using it,
add some more debugging for future problems.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122234348-g8x4r7kqgnex30w6
2009-11-23 00:43:48 +01:00
Juan RP
3fcba399af xbps_find_pkg_repo_deps: if finding a dep failed for whatever reason,
stop immediately and return the appropiate error.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122205257-m1wta4fk85k1hv1w
2009-11-22 21:52:57 +01:00
Juan RP
4e89a28dda xbps_find_new_pkg: do not report incorrect debug printf.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122205215-gxrymbh0wzpujhoj
2009-11-22 21:52:15 +01:00
Juan RP
7af7ef40c9 xbps_get_pkgver_from_dict: return NULL if the object is not there.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122205119-ezkdj0sdju2ezoum
2009-11-22 21:51:19 +01:00
Juan RP
4f80bddbb2 xbps-repo: print error if pkg-index file cannot be fetched.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122060446-sc4na9qa2k2bk5f6
2009-11-22 07:04:46 +01:00
Juan RP
3d24672e58 Improve dependency matching via repos and use the "pkgver" object
in pkg dictionary to improve performance in some cases.

Bumped XBPS_RELVER to 20091121.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091122041547-oywx4db75j8uttl3
2009-11-22 05:15:47 +01:00
Juan RP
71ea9d2d1f xbps_find_pkg_deps: simplify, fix multi-repo bug, add debugging.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091121061242-22ow43an9ksa8y0b
2009-11-21 07:12:42 +01:00
Juan RP
308a25f302 xbps_unpack_binary_pkg: initialize a local var.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091119051042-0kyp37uo6puex4jt
2009-11-19 06:10:42 +01:00
Juan RP
db9ae90dd4 Improve make output similar to what recent GNU configure scripts do.
Also always build the static bins so that it's done in one pass,
that means that objects are PIC and built with SSP.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091119050337-hkdksjqxy9n7vy7m
2009-11-19 06:03:37 +01:00
Juan RP
e8d947e15b Reorganize the Makefiles so that parallel build is possible.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118090545-wpvgwmnqyh77sgz8
2009-11-18 10:05:45 +01:00
Juan RP
bc14a026a5 Improve download code, as well as fixing refetching when syncing to a
remote package index. Bump XBPS_RELVER to 20091118.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118062814-3pqbs9n1797einhm
2009-11-18 07:28:14 +01:00
Juan RP
d379d1d44c Implemented blueprint "essential-upgrades".
See https://blueprints.launchpad.net/xbps/+spec/essential-upgrades
for complete information.

Implementation used almost the same code than the pseudo-code explained
in the blueprint. Works really fine, tested with glibc-2.10.1 -> 2.11
upgrade.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091109013004-szdc9ngb3i70bc4p
2009-11-09 02:30:04 +01:00
Juan RP
795c2a58f5 Fix some issues while matching for required pkgdeps.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091107154159-riikhswt1h3mm9xn
2009-11-07 16:41:59 +01:00
Juan RP
79d3f446fe xbps_fetch_file: return proper error if connection failed,
fix SSP problem with fetchflags!

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091107052101-ao6nqq8xrzb06tvr
2009-11-07 06:21:01 +01:00
Juan RP
adbd3d727c Added support for shell (and csh as well) patterns for required
dependencies, as specified in blueprint "improved-version-matching".

It's possible now to require greater, greater or equal than,
less, less or equal than, and equal pkg versions, as well as using
'{}' and '[^!]' csh patterns in dependencies.

Code lifted from FreeBSD, thanks! :-)

Change XBPS_RELVER to 20091107 to match latest additions.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091107035620-3051wcwrirqn2g14
2009-11-07 04:56:20 +01:00
Juan RP
748cc9c6b1 Improve xbps_fetch_file() and friends, one more time by Daft Punk.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091031140925-rjlkhq0v6fvmtawo
2009-10-31 15:09:25 +01:00
Juan RP
10e76c6420 xbps_fetch_file: erm fix previous, FETH_UNCHANGED is the correct one.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091031105541-8v2qt83jxazsxean
2009-10-31 11:55:41 +01:00
Juan RP
a9b7ffa94a xbps_fetch_file(): check for local/remote mtime, add some more
checks for errors, add some printfs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091031104055-fy64xd6g6m938dxh
2009-10-31 11:40:55 +01:00