Commit Graph

77 Commits

Author SHA1 Message Date
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
Juan RP
10f2bef7cb Bah, fix these stupid make targets.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030163209-td7vxbq5vkxva5zc
2009-10-30 17:32:09 +01:00
Juan RP
5b6724b550 Fix up some issues for building shared/static bins.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030162345-2so2ejfvvqr29s7v
2009-10-30 17:23:45 +01:00
Juan RP
4e83deb0cc libxbps: avoid fetchStat() and use only fetchXGet().
Some HTTP servers (observerd with googlecode.com), issue a 404
if the headers are checked before issuing a GET transfer.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030162044-ng8o944bajwdudg8
2009-10-30 17:20:44 +01:00
Juan RP
4aeea194e3 lib/Makefile: don't forget to install the static lib.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030112231-h1onlwabxst3am0h
2009-10-30 12:22:31 +01:00
Juan RP
3905c2106c Properly build shared/static libxbps and utils.
xbps-fetch: added -v flag to see verbose messages in libfetch.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030111726-axf9paz2k01ntqzz
2009-10-30 12:17:26 +01:00
Juan RP
79f9f34775 libxbps: added xbps_fetch_error_string(), that returns libfetch
fetchLastErrString.

Hook xbps-fetch to the tree and use the new function to print errors.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030021303-6wu9sri5o8kgvfwl
2009-10-30 03:13:03 +01:00
Juan RP
0024221279 lib/depends.c: minor performance change.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091028021652-ns74gpr86ohfok9a
2009-10-28 03:16:52 +01:00
Juan RP
dc258f4e20 Use xbps_get_root() directly where appropiate.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027111547-tb38qz51ejakn3jc
2009-10-27 12:15:47 +01:00
Juan RP
ac897c8383 libxbps: move remote repo pkg-index sync code into its own file.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027034000-rsg33sjonqsu0d5t
2009-10-27 04:40:00 +01:00
Juan RP
7aebea684b Implemented support for working with remote repositories.
libfetch from NetBSD's pkgsrc has been imported into lib/fetch, but
the objects are embedded into libxbps. Only a public function to fetch
files has been implemented: xbps_fetch_file().

The library now is built with -fvisibility=hidden by default, and
exported symbols are the ones that use the SYMEXPORT macro.

The code works well enough, but will need many more cleanups.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027004600-0lq9aao67lisbzxv
2009-10-27 01:46:00 +01:00
Juan RP
6a855c0272 xbps_find_orphan_packages: report return value as errno in an error path.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091023120316-om71k2rnmk4ruzh1
2009-10-23 14:03:16 +02:00