Juan RP
1d42986b75
libxbps: finish support for rindex 1.6.
2012-12-07 17:11:52 +01:00
Juan RP
305659644f
xbps_rindex_sync: check that downloaded repo index is a dictionary.
2012-12-07 08:34:45 +01:00
Juan RP
3e3073e44c
xbps_rpool_init: relax an assertion and skip invalid repos gracefully.
2012-12-07 08:31:47 +01:00
Juan RP
2c1e4e502d
XBPS can now be built on NetBSD (and probably any other BSD variant).
2012-12-06 12:58:17 +01:00
Juan RP
2e2da80cfc
find_repo_deps: find pkgd from pkgdb by name as it checks for version later.
2012-12-02 16:34:01 +01:00
Juan RP
0e40a2dbba
xbps_pkgdb_get_pkg_revdeps: make sure to not have dup entries.
2012-12-01 08:10:47 +01:00
Juan RP
8c84e22b94
xbps_transaction_sort: do not sort removed pkgs; just add them to head.
2012-12-01 08:10:15 +01:00
Juan RP
f45352dbf8
Added support for dynamic generation of revdeps for installed packages.
2012-11-30 17:40:52 +01:00
Juan RP
731c903026
libxbps: do not insert/delete while traversing a (double) locked iterator.
2012-11-30 10:04:36 +01:00
Juan RP
b9136c61c9
Use prop iterators when needed to retain the obj.
...
This could explain the strange issues seen in buildbot builds that
have been happening since 0.18; this should fix completely this.
2012-11-30 09:49:09 +01:00
Juan RP
9715d8a6a1
rindex_pkgdeps.c: simplify and reduce (a bit).
2012-11-30 08:21:20 +01:00
Juan RP
8345070884
Bump libxbps soname major version.
2012-11-30 07:18:46 +01:00
Juan RP
63c1883201
Major API/ABI cleanup bringing performance improvements and fixes.
...
These are the core interfaces in the new API:
rpool - Interface to interact with the repository pool.
rindex - Interface to interact with repository indexes.
pkgdb - Interface to interact with local packages.
transaction - Interface to interact with a transaction.
This also brings new repository index format, making the index file
per architecture and being incompatible with previous versions.
The transaction frequency flush option has been removed, and due to
the nature of package states it was causing more harm than good.
More changes coming soon, but the API shall remain stable from now on.
2012-11-30 07:11:51 +01:00
Juan RP
16e18313da
xbps_transaction: return proper errors if pkg is missing from repos.
2012-11-28 17:35:03 +01:00
Juan RP
85c0641cc8
xbps_{configure,remove}_pkg: do not use meta cache when executing scripts.
...
This fixes executing INSTALL/REMOVE scripts with the right version currently
installed, i.e kernel post-install failed to execute correctly its kernel
hooks due to passing a wrong version.
2012-11-26 23:25:41 +01:00
Juan RP
7f577e005c
metadir: replace uthash simply with a dictionary.
2012-11-21 23:07:38 +01:00
Juan RP
bdd93b7aa7
Introduce xbps_pkgdb_get_virtualpkgd() and use in xbps_metadir_get_pkgd().
2012-11-19 21:46:54 +01:00
Juan RP
5de4fb1f0a
xbps-install: -f will also overwrite pkg files.
2012-11-19 20:50:58 +01:00
Juan RP
d92c87dbf3
xbps_fetch_file: don't error out if restart and tempfile doesn't exist.
2012-11-19 16:40:27 +01:00
Juan RP
a311294f0a
libxbps: added support to "inject" vpkg config files at initialization time.
2012-11-19 15:42:24 +01:00
Juan RP
4f9ff2746e
xbps_pkg_exec_buffer: chdir to rootdir before creating fd.
2012-11-19 14:59:42 +01:00
Juan RP
0edba07106
xbps_remove_pkg: fix dbg printf args.
2012-11-19 14:45:09 +01:00
Juan RP
34ae90f1c3
xbps_remove_pkg: force pkgdb flush after unregister.
2012-11-19 14:40:41 +01:00
Juan RP
e861cb5331
xbps_transaction_commit: add a dbg printf.
2012-11-19 14:38:06 +01:00
Juan RP
5397dd4937
xbps_remove_pkg: handle all cases where pkg meta plist is unavail.
2012-11-19 14:08:01 +01:00
Juan RP
1147e7ce3c
xbps_find_pkg_orphans: there's no need to check pkg state, any state is ok.
2012-11-19 14:07:05 +01:00
Juan RP
556bbd495e
xbps_remove_pkg: recover from an assertion if pkg meta plist doesn't exist.
2012-11-19 13:29:09 +01:00
Juan RP
bf2d97a067
xbps_init: simplify previous and use xbps_xasprintf().
2012-11-19 12:15:32 +01:00
Juan RP
b894a5eca3
Accept relative rootdir via xbps_handle::rootdir (found by pancake).
2012-11-19 12:12:38 +01:00
Juan RP
37b7cccc83
pkg_metadir: this must use HASH_ADD_STR instead!
2012-11-18 17:08:45 +01:00
Juan RP
6094bbc6ea
pkg_metadir: fix some issues I've found while finding obsolete files.
2012-11-18 12:07:43 +01:00
Juan RP
e08c258967
xbps_remove_pkg: no need to release pkgd from metadir.
2012-11-18 12:06:46 +01:00
Juan RP
235416b48f
pkg_metadir: redo previous without memleaks.
2012-11-18 04:06:13 +01:00
Juan RP
8d9f5b65e3
pkg_metadir: make sure to return a valid pkgd from the hash table.
2012-11-18 03:49:29 +01:00
Juan RP
46f7a808b4
xbps_metadir: use an hash table (via uthash): 15s vs 1m10s.
2012-11-18 02:38:24 +01:00
Juan RP
fcdb6b0930
unpack: use pkg dictionary from metadir to find obsoletes!
2012-11-17 15:14:11 +01:00
Juan RP
cc99e887a2
xbps_pkg_exec_buffer: if rootdir != / create tmp files on rootdir.
2012-11-17 12:08:25 +01:00
Juan RP
0a082a82c3
xbps_file_exec: don't fail if chroot(2) fails (due to EPERM).
2012-11-17 11:44:14 +01:00
Juan RP
bc894aae1d
xbps_metadir_release: don't release obj already released.
2012-11-17 10:53:06 +01:00
Juan RP
b0fab7a3ee
Implemented a cache to get pkg dicts from metadir.
...
This improves xbps-pkgdb -a marginally, but still seems to be a bit slow.
2012-11-16 21:50:52 +01:00
Juan RP
34bd49f85a
New pkg metadata structure for 0.18. See the NEWS file for info.
2012-11-16 16:55:35 +01:00
Juan RP
db4b542d40
unpack: typo in previous.
2012-11-15 09:27:41 +01:00
Juan RP
1b217d1906
transaction_ops: shortest static function name.
2012-11-15 09:25:59 +01:00
Juan RP
ce2f45a3df
unpack: don't extract pkg props.plist, we use pkg data from repo index.
2012-11-15 09:25:31 +01:00
Juan RP
5c0abc9754
libxbps: remove old code and return early if pkg has no rundeps.
2012-11-15 01:37:09 +01:00
Juan RP
ce3d4f1764
unpack: externalize pkg props dictionary from index.
2012-11-13 14:41:04 +01:00
Juan RP
4945755d53
unpack: don't assert if target file of a symlink doesn't exist, it may happen.
2012-11-12 17:10:02 +01:00
Juan RP
2703b55f99
xbps_dictionary_from_archive_entry: faster when plist is already uncompressed.
2012-11-11 16:57:23 +01:00
Juan RP
58333419a0
Shell wildcard patterns can now be used in the PackagesOnHold option.
2012-11-11 16:11:40 +01:00
Juan RP
a77727887d
Improvements for xbps_fetch_file and xbps_repository_sync_index.
...
xbps_fetch_file:
- A temp file is created with .part extension to improve resuming.
- Files are downloaded in cwd.
- Switch to futimens(2) and fsync(2).
xbps_repository_sync_index:
- Do not create local repodir in metadir if it already exists.
- Simplify the code thanks to new xbps_fetch_file().
2012-11-11 11:29:49 +01:00
Juan RP
f81d8ac1f0
xbps_pkgdb_update: if pkgdb cannot be internalized, create it to simplify code.
2012-11-11 10:03:14 +01:00
Juan RP
df0d5d7330
Get rid of pkg state half-unpacked; not-installed state is good enough.
2012-11-11 09:42:30 +01:00
Juan RP
d6735d5685
xbps_xasprintf: do not return NULL anymore; remove checks for this.
2012-11-11 09:37:27 +01:00
Juan RP
0ab60b24c5
xbps_fetch_file: enable fetchRestartCalls.
2012-11-08 09:49:03 +01:00
Juan RP
05984a31b1
xbps_rpool_sync: new arg to specify the file; bump XBPS_API_VERSION.
2012-11-07 10:37:58 +01:00
Juan RP
4e15230c93
repository_sync_index: fix swapped args passed to XBPS_STATE_REPOSYNC.
2012-11-07 10:18:58 +01:00
Juan RP
45b872f75e
repository_sync_index: use arg[0-1] in XBPS_STATE_REPOSYNC.
2012-11-07 10:13:54 +01:00
Juan RP
ca095df52f
libxbps: some tweaks for struct xbps_state_cb_data.
...
- Renamed args pkgname/version to arg0/arg1 to make them generic.
- Update bins with this and make some tweaks in state_cb.
Bumped API version.
2012-11-07 10:11:06 +01:00
Juan RP
310e619ea3
Remove unnecessary variable assignments reported by cppcheck.
2012-11-06 09:28:34 +01:00
Juan RP
03567ecb70
unpack: correctly take into account rootdir while checking symlinks.
2012-10-27 10:36:39 +02:00
Juan RP
978013bfbf
unpack: match correctly symlinks with absolute path.
2012-10-27 09:42:26 +02:00
Juan RP
264c704529
unpack: do not use realpath(3) on uninstalled symlinks.
2012-10-27 09:36:28 +02:00
Juan RP
c28f882d5c
unpack: misc improvements for previous.
2012-10-26 14:32:04 +02:00
Juan RP
c58ca952a8
unpack: convert printf added in previous to xbps_dbg_printf.
2012-10-26 14:22:18 +02:00
Juan RP
7fdae2d6dc
unpack: handle another case of relative symlink.
2012-10-26 14:17:31 +02:00
Juan RP
d31a3d205a
unpack: use lstat() for symlinks, respect uid/gid if euid == 0, some fixes.
2012-10-26 11:25:17 +02:00
Juan RP
e3d876ade0
pkgdb: some fixes for e545429fa1
.
2012-10-26 11:05:17 +02:00
Juan RP
4023c8115b
unpack: improvements to handle more cases of modified files.
...
- Do not unpack unmodified symlinks.
- Do not unpack files that only differ in mode, just chmod(2) new perms.
- Do not create pkg's metadata dir if this already exists.
2012-10-26 10:27:24 +02:00
Juan RP
e545429fa1
pkgdb: if plist from storage and memory do not differ do not flush to storage.
2012-10-26 10:25:14 +02:00
Juan RP
3e7f35bed1
xbps_configure_pkg: do not flush pkgdb if state hasn't been changed.
2012-10-26 10:24:26 +02:00
Juan RP
89dadb0f20
While checking conf files and there were no changes, do not unpack file from binpkg.
2012-10-26 10:23:12 +02:00
Juan RP
d99c505811
requiredby: skip adding same entry if already exists.
2012-10-26 09:44:07 +02:00
Juan RP
9e11ea950a
Do not inherit unneeded objs from trans dictionary onto pkg's pkgdb dictionary.
2012-10-25 09:29:56 +02:00
Juan RP
863f12e349
Improved finding obsolete files while upgrading pkgs.
2012-10-24 07:45:00 +02:00
Juan RP
22a86d82f8
Added support for installing exact dependencies, i.e pkg X depends on 'Y-1.0_1'.
2012-10-09 07:35:59 +02:00
Juan RP
ebc0f27ae1
Do not add to the queue a pkgdep that has been already added via a vpkg.
...
The problem was after merging udev into systemd, udev is now a virtual pkg
and another dependency was requiring it and added systemd (real pkg) to
the list, but later in the sorting phase systemd was added again breaking
the dependency order.
2012-10-06 10:34:29 +02:00
Juan RP
c158acefac
Revert "transaction: keep last dep and remove dup matches while sorting deps."
...
This reverts commit b764f8e19a
.
2012-10-06 10:01:37 +02:00
Juan RP
b764f8e19a
transaction: keep last dep and remove dup matches while sorting deps.
...
This bug has been uncovered due to udev -> systemd merge.
2012-10-06 09:21:26 +02:00
Juan RP
d38dfdd19a
libxbps: unpack: before extracting re-set entry_pname.
2012-10-01 16:41:50 +02:00
Juan RP
bdeeaa46b8
libxbps: unpack: simplify file hash matching code.
2012-09-30 17:07:51 +02:00
Juan RP
7909f597cb
xbps_path_from_repository_uri: do not look for binpkgs in repo arch dirs anymore.
2012-09-30 10:13:06 +02:00
Juan RP
5228b3fbf3
remove_obsoletes: deal with unexistent arrays in both dictionaries.
2012-09-30 08:57:57 +02:00
Juan RP
f7a4718de9
xbps_rpool_dictionary_metadata_plist: do not release dictionary without refcounts!
2012-09-30 08:10:49 +02:00
Juan RP
9c15f103e1
lib/package_unpack: simplify and externalize pkg's plists uncompressed.
2012-09-29 20:49:51 +02:00
Juan RP
092be04783
pkgdb: flush uncompressed pkgdb for performance reasons.
2012-09-29 20:28:39 +02:00
Juan RP
2f13afe7a6
lib/package_unpack.c: fixed build error caused by cherry-pick conflict.
2012-09-29 19:18:32 +02:00
Juan RP
54b6cc7ec1
xbps-{bin,repo}: add -B flag to set default repo if xbps.conf not found.
...
(cherry picked from commit 75eac1a1426040a833e0b10e208f2e55fa359532)
2012-09-29 19:10:48 +02:00
Juan RP
15e43e550b
xbps_rpool_release: fix a memleak found by valgrind.
...
(cherry picked from commit 90e24f4b18fdde44958584cdc038ff8a88e919a0)
2012-09-29 19:10:28 +02:00
Juan RP
e370ff0625
libxbps: use a new bool in struct xbps_handle to track successful initialization.
...
(cherry picked from commit 03374950680f6a839b1ee2df8e3a4e1dfb110fa8)
2012-09-29 19:09:03 +02:00
Juan RP
9e5c7de33b
xbps_dictionary_from_archive_entry: fixed internalizing uncompressed dictionaries.
...
(cherry picked from commit 2debc5c5ee6db1a197fe3afebaa9463934707b10)
2012-09-29 19:05:33 +02:00
Juan RP
0f17197627
libxbps: use a struct allocated from stack for the unpack cb.
...
(cherry picked from commit a658586f27fd0a0c2c78ea96f89b54055e1e73be)
2012-09-29 19:00:04 +02:00
Juan RP
01915e3030
xbps_transaction_update_packages: make packages on hold work (duh!).
...
(cherry picked from commit aa154199a6d7d89bfe040755be289b1d827c5727)
2012-09-29 18:58:21 +02:00
Juan RP
f7a5c55bc7
libxbps: xbps_pkg_arch_match: fix conditional tests.
2012-07-21 21:49:37 +02:00
Juan RP
a756060d38
libxbps: [unpack] fixed passing dangling pointer to unpack cb.
2012-07-21 10:41:19 +02:00
Juan RP
3339d0cd25
libfetch: fix warnings.
2012-07-19 18:00:31 +02:00
Juan RP
9edd60c3a7
libxbps: extend the list of symlinks in rootdir to be ignored.
2012-07-14 12:11:55 +02:00
Juan RP
2f1e975607
Added "install-date" object to pkg's pkgdb dictionary, make xbps-bin(8) print it.
2012-07-11 12:19:39 +02:00
Juan RP
11ecf5438f
Import proplib-0.6.1.
2012-07-10 23:33:19 +02:00
Juan RP
34697e8022
libxbps: improve matching obsolete files, skip matches by hash and filename.
...
Don't remove top level symlinks (/bin, /sbin and /lib) if they were found
as obsoletes. This is a workaround for the system transition to /usr.
2012-07-10 23:22:25 +02:00
Juan RP
172435bd7e
xbps_check_is_installed_pkg_by_pattern: do not reset errno, leave it as is.
2012-07-04 12:59:40 +02:00
Juan RP
94238302f2
transaction_ops: in update, check if curpkg has been previously added.
2012-07-04 11:56:01 +02:00
Juan RP
e879c71a02
transaction_sortdeps: check if dep is installed by pattern.
2012-07-04 11:55:51 +02:00
Juan RP
dfb45f27ef
xbps_transaction_package_replace: misc cosmetic changes to dbg printfs.
2012-07-04 11:54:37 +02:00
Juan RP
abdf6e710d
xbps_remove_pkg: do not pass dangling pointers to state cb after removing pkgdict.
2012-07-04 09:52:51 +02:00
Juan RP
54bc92bd97
xbps_dictionary_from_archive_entry: simplify and sync zlib code with proplib.
2012-06-20 09:26:00 +02:00
Juan RP
8abd275bfb
libxbps: xbps_rpool_release: don't release repo_pool, it's already released.
2012-06-18 10:49:36 +02:00
Juan RP
c24ce8e4da
libxbps: use memcpy in critical paths for performance, fixed some memleaks.
2012-06-18 10:43:05 +02:00
Juan RP
0f3d4f4a19
libxbps: hide compat symbols.
2012-06-18 09:52:19 +02:00
Juan RP
974b2fe8ad
libxbps: simplify pkgdb_get_pkgd and find_pkg_dict_installed internals.
...
There's no need to prop_dictionary_copy the returned dictionary to
later have to free it again, just return directly the dictionary and
avoid the free(3)s.
2012-06-16 09:02:07 +02:00
Juan RP
068cab8d20
libxbps: performance improvements by caching the most accessed paths.
...
1- We can cache the result of the first xbps_pkgdb_init() when it fails
and avoid the malloc/free/access from it.
2- We cache the uname(2) result into a private var in xbps_handle and
use it in xbps_pkg_arch_match().
This improves performance by ~5% approx and it's close as it was before
introducing the repository index format 1.5.
2012-06-15 15:33:11 +02:00
Juan RP
506625a716
libxbps: also match vpkgs in previous commit.
2012-06-14 12:12:05 +02:00
Juan RP
302b216d8d
libxbps: do not add dups to transaction dictionary due to virtual pkgs.
2012-06-14 11:53:27 +02:00
Juan RP
3e9e87fc2a
libxbps: require a pointer to xbps_handle in functions that need it.
...
This removes 2 global vars from lib/initend.c and easier to know
what functions require access to xbps_handle.
2012-06-14 08:22:11 +02:00
Juan RP
a3adbcda95
libxbps: use prop_array_get_cstring_nocopy().
2012-06-13 09:23:48 +02:00
Juan RP
412d4b7280
libxbps: switch to archive_read_{close,free}.
2012-06-12 22:22:46 +02:00
Juan RP
c61ba8dfcc
Added support for package conflicts.
2012-06-11 16:14:03 +02:00
Juan RP
81610697df
xbps_transaction_install_pkg: proper pkg find order in rpool.
...
Previously it was preferring virtual packages from
configuration file before real packages.
2012-06-09 10:09:46 +02:00
Juan RP
20bb1af589
xbps_remove_pkg: return proper error if metadata files cannot be removed.
2012-06-09 10:05:29 +02:00
Juan RP
e75a524ee3
xbps_transaction_install_pkg: on exact match properly detect if it's installed.
2012-06-05 22:54:46 +02:00
Juan RP
efefa000b2
xbps_dictionary_metadata_plist_by_url: only accept exact matches.
2012-06-05 20:53:15 +02:00
Juan RP
a0f91f3342
xbps_file_hash_check_dictionary: fixed for rootdir != /.
2012-06-05 20:51:00 +02:00
Juan RP
a00a450fe0
unpack: make sure to use exact file when checking for hash matches.
2012-06-05 20:23:12 +02:00
Juan RP
84c6850c28
xbps_file_hash_dictionary: only process exact matches.
2012-06-05 20:22:47 +02:00
Juan RP
cc30039c60
xbps_unpack_binary_pkg: handle ARCHIVE_{EOF,FATAL,RETRY} and use archive_read_{close,free}.
2012-06-05 16:46:50 +02:00
Juan RP
c37026d4c6
libxbps: require an underscore in strings to detect correctly pkgname/version.
2012-06-05 10:58:39 +02:00
Juan RP
9441f9f14b
libxbps: multiple random changes for overall performance increase.
2012-06-04 23:22:33 +02:00
Juan RP
fa73de309f
libxbps: remove xbps_find_pkg_dict_from_plist_by_xxx (unused).
2012-06-04 21:34:21 +02:00
Juan RP
e9945dc345
Before unpacking pkg files always remove INSTALL/REMOVE scripts (if they exist).
2012-06-04 14:14:46 +02:00
Juan RP
7265ea0e4e
trans: do not increase download_size if binpkgs are in local repos.
2012-06-04 10:09:46 +02:00
Juan RP
34c1269504
Fixed installing exact pkg versions on pkgs with hyphens, we use equal sign as delimiter now.
2012-06-03 07:26:48 +02:00
Juan RP
f9c72e1d06
xbps_transaction_install_pkg: properly fix previous commit.
2012-06-02 17:39:36 +02:00
Juan RP
bd3a8982cc
xbps-bin: added support to install exact pkg version, i.e 'foo-1.0'.
2012-06-02 17:35:21 +02:00
Juan RP
40864bcdce
Improve xbps_transaction_update_pkg/packages and misc cosmetic changes.
2012-06-02 16:52:01 +02:00
Juan RP
c7e4630056
xbps_rpool_sync: ignore fetch errors, they will be reported by state_cb.
2012-06-01 16:04:47 +02:00
Juan RP
642e6fca3a
xbps_rpool_sync: also fetch repository files index, removed accidently in previous.
2012-06-01 15:45:49 +02:00
Juan RP
981b13bd5a
xbps-repo: 'sync' and 'pkg-list' target now accept a repository URI argument.
...
If set, only the matching repository will be used for the task.
2012-06-01 15:02:06 +02:00
Juan RP
652e9afcef
libxbps: fixed xbps_remove_pkg_from_array_by_{name,pattern,pkgver}.
...
The correct index wasn't being passed to prop_array_remove.
2012-06-01 10:53:28 +02:00
Juan RP
7289547432
Welcome "repository index format 1.5". See NEWS for information.
2012-05-31 16:29:56 +02:00
Juan RP
1bfb1ae028
libxbps: move xbps_pkgpattern_match to util.c and simplify.
2012-05-30 22:38:35 +02:00
Juan RP
27aacf97f4
xbps_file_exec: simplify and don't chroot when rootdir == /.
...
Before that change we were chroot(2)ing even when rootdir was set to /.
2012-05-30 17:44:39 +02:00
Juan RP
a94dd5dbfa
Revert "libxbps: implement xbps_file_exec() with posix_spawn()."
...
This reverts commit 5aa05f4c72
.
2012-05-30 17:26:25 +02:00
Juan RP
5aa05f4c72
libxbps: implement xbps_file_exec() with posix_spawn().
2012-05-30 14:45:47 +02:00
Juan RP
c93d1637ae
lib/package_unpack.c: remove dead assignments found by clang-analyzer.
2012-05-30 14:22:16 +02:00
Juan RP
f40759aabe
libxbps: use same order strategy when checking for deps queued in transaction.
2012-05-30 12:54:28 +02:00
Juan RP
922ee1f1b6
libxbps: rename xbps_repository_pool_xxx to xbps_rpool_xxx.
2012-05-30 10:56:32 +02:00
Juan RP
da4b8b7427
rpool: improve the order while resolving dependencies.
...
See the NEWS file for more information. After that change you don't have
to set a virtual pkg in conf file, if required virtual pkg is in rpool.
2012-05-30 10:22:53 +02:00
Juan RP
f7f4e0bec0
Extend 'soft replace' and also remove obsolete files.
2012-05-25 22:44:58 +02:00
Juan RP
da9b6774c3
Fix previous: propagate "softreplace" obj to pkg being replaced.
2012-05-25 17:58:36 +02:00
Juan RP
6a4de0127d
libxbps: introduce the concept of "soft replace"; see the NEWS file.
2012-05-25 17:24:36 +02:00
Juan RP
d075f7182a
When removing pkg files, remove only dangling symlinks after regular files.
...
This is required for the upcoming eglibc package.
2012-05-25 14:31:42 +02:00
Juan RP
9acec7883b
xbps_remove_pkg: do not error out if files.plist not found, just continue.
2012-05-21 23:03:29 +02:00
Juan RP
28767f2ea8
Added support to put packages "on hold".
2012-05-08 09:19:43 +02:00
Juan RP
5e0b06dc00
xbps-bin: improve def unpack cb to print more meaningful messages.
2012-05-06 16:48:47 +02:00
Juan RP
bbd0d893d0
xbps_repository_sync_index: print the plist file being downloaded in cb.
2012-05-06 09:10:25 +02:00
Juan RP
8a4b143bf3
Show a proper error message if download of a binpkg fails in a transaction.
2012-05-06 09:09:09 +02:00
Juan RP
934bc4869e
rpool: make xbps_handle::repo_pool array immutable after initialization.
2012-04-13 10:06:08 +02:00
Juan RP
8b2c4ed47e
xbps_dictionary_from_metadata_plist: if vpkg not found, look for a real pkg.
2012-04-13 09:23:35 +02:00
Juan RP
83bda174ab
libxbps: make xbps_find_virtualpkg_* only look for virtual pkgs.
...
Before this commit they also looked for non virtual packages, which
is not what it was meant when those functions were added.
2012-04-12 11:57:21 +02:00
Juan RP
53d28fcb35
rpool: miscellaneous improvements to _init() and _release().
...
xbps_repository_pool_init:
- Avoid unnecessary extra access(2) syscall when internalizing
repository index plist files.
xbps_repository_pool_release:
- Make sure to release internalized repository index arrays.
2012-04-12 11:54:11 +02:00
Juan RP
bfe7ab1c5a
xbps_configure_pkg: simplify and remove "version" arg (API change).
...
The "version" argument (being optional) clearly is not needed and it
can be fully removed. This simplifies the internal implementation as well
as the API.
2012-04-10 10:02:27 +02:00
Juan RP
ef6d1adf91
xbps_set_pkg_state_installed: simplify (API change).
...
The third optional argument "pkgver" clearly is useless because we can
create it internally with "pkgname" and "version" arguments instead.
Also make the "version" argument mandatory.
2012-04-10 09:43:59 +02:00
Juan RP
732ce45b86
libxbps: new function xbps_pkgdb_get_pkgd_by_pkgver().
...
Finds a pkg dictionary in pkgdb by matching its pkgver object.
2012-04-05 10:57:15 +02:00
Juan RP
feacc506de
When reinstalling existing pkgs, remove previous entry in pkgdb's requiredby.
2012-04-04 10:20:29 +02:00
Juan RP
4511e581b2
xbps_configure_pkg: improve error messages.
2012-03-31 10:08:52 +02:00
Juan RP
8e0612bb46
A bugfix while sorting dependencies in a transaction (thanks dave).
2012-03-30 01:39:13 +02:00
Juan RP
a5f4848d0b
Use best pkg available when resolving required dependencies.
2012-03-28 12:01:59 +02:00
Juan RP
af593500c3
Fix a couple of issues resolving deps with virtual packages.
2012-03-24 09:21:28 +01:00
Juan RP
e698acf440
Make xbps_find_virtualpkg_conf_xxx private again, unused in test suite now.
2012-03-13 11:37:50 +01:00
Juan RP
9bada162a1
New "metadir" member in xbps_handle to override default metadata dir.
2012-03-13 10:22:35 +01:00
Juan RP
749e03aa29
Make xbps_find_virtualpkg_conf_in_xxx_by_xxx part of the API and add kyua tests.
2012-03-12 17:51:50 +01:00
Juan RP
715990a1e5
Make xbps_find_virtualpkg_in_dict_by_xxx part of the API and add kyua tests.
2012-03-12 16:36:46 +01:00
Juan RP
48c36602a5
Simplify even more previous commit.
2012-03-11 17:26:41 +01:00
Juan RP
35b1932416
Apply correctly fix to match_any_virtualpkg_in_rundeps().
2012-03-11 17:18:33 +01:00
Juan RP
ca03127a82
Revert "xbps_match_any_virtualpkg_in_rundeps: break correctly from inner loop on match."
...
This reverts commit 31b1975b1e
.
Revert experimental changes to repository_finddeps.c.
2012-03-11 17:16:58 +01:00
Juan RP
31b1975b1e
xbps_match_any_virtualpkg_in_rundeps: break correctly from inner loop on match.
2012-03-11 17:15:49 +01:00
Juan RP
06745b70ae
Fixed issue 22: always set perms from binpkg to existing files while unpacking.
2012-03-07 12:00:08 +01:00
Juan RP
af9bd15af7
xbps_init: set xhp->conffile to NULL if conf file cannot be read.
2012-03-05 17:33:36 +01:00
Juan RP
4b02a75629
xbps_init: fix a typo when checking for the configuration file.
2012-03-05 17:29:02 +01:00
Juan RP
216673aa4a
Fixed 'xbps-bin reconfigure all' regression added in 0.13.
2012-02-28 21:16:41 +01:00
Juan RP
dc61fbed0e
libxbps: match required pkgdep by virtual pkg in a transaction.
2012-02-28 20:39:10 +01:00
Juan RP
001947d9bb
Only enable support for gzip, bzip2 and xz compression formats.
...
After looking at profiling output I saw that a not so small of time spent
was in libarchive trying to know if archive is zip compressed... so
I've enabled the three compression formats supported by xbps-src.
2012-02-22 04:16:36 +01:00
Juan RP
485a62e221
Simplify xbps_repository_pool_find_pkg internals for best match case.
2012-02-22 03:58:41 +01:00
Juan RP
c965c27dfb
Skip removing obsolete files in some cases.
2012-02-20 20:23:33 +01:00
Juan RP
6e50919d2b
xbps_repository_pool_dictionary_metadata_plist: make it accept a pkgpattern.
2012-02-16 08:55:07 +01:00
Juan RP
a5c0513686
portableproplib: fix gzFile to make it work with zlib-1.2.6.
2012-02-16 08:51:00 +01:00
Juan RP
cbf7417d1d
xbps_transaction_install_pkg: return EEXIST if pkg already installed.
2012-02-14 00:34:26 +01:00
Juan RP
d8e7ed0a23
xbps_repository_pool_foreach: simplify internals.
2012-02-01 02:30:23 +01:00
Juan RP
f48ab4a686
Fixed a bug in rpool to find best pkg available.
2012-01-29 12:12:00 +01:00
Juan RP
cfae783f64
xbps_init: avoid using a global var.
2012-01-26 11:43:35 +01:00
Juan RP
b7da3464dd
xbps_repository_sync_pkg_index: update for index 1.4 format.
2012-01-25 06:02:38 +01:00
Juan RP
7dfc01b7a6
Calculate required/freed size for updates in transactions too.
2012-01-25 05:10:24 +01:00
Juan RP
1a73b93d63
Calculate properly required/freed size in transactions.
2012-01-25 04:56:54 +01:00
Juan RP
ff0b9b9b59
transaction_find_pkg: warning due to uninitialized var.
2012-01-25 02:18:15 +01:00
Juan RP
abb0d260b9
xbps-bin: the install target gains suppor for installing best pkg available.
2012-01-25 02:14:04 +01:00
Juan RP
49baad48f4
Fixed module-init-tools->kmod update as reported by davehome.
...
The problem was that required package dependency was installed, but
the version didn't satisfy the requirement and the code unconditionally
assumed an updated existed in repository pool. Now the code checks
package state to set transaction reason.
2012-01-24 18:45:50 +01:00
Juan RP
ec764ffec8
xbps_transaction_package_replace: improved debug output.
2012-01-24 18:43:43 +01:00
Juan RP
791f1d40b2
xbps_handle: remove debug, install_*, syslog_enabled members.
...
Replaced by definitions that can be set to xbps_handle::flags.
2012-01-22 10:52:35 +01:00
Juan RP
a166d6a2a3
Simplify xbps_transaction_prepare()/commit() and related API changes.
...
- xbps_handle::transd -> new member with transaction dictionary.
- xbps_transaction_prepare: returns an int.
- xbps_transaction_commit: doesn't need any arg now.
- xbps_repository_pool_sync: doesn't need any arg now.
- xbps_pkgdb_update: removed xbps_handle * arg.
- xbps_transaction_missingdeps_get: removed, missing_deps array is in
xbps_handle::transd("missing_deps") array object.
2012-01-22 10:00:46 +01:00
Juan RP
38db570c19
pkgdb: foreach_xxx_pkg_cb -> foreach_xxx_cb.
2012-01-21 10:30:20 +01:00
Juan RP
4758635f15
xbps_find_pkg_orphans: make returned array immutable.
2012-01-21 10:21:01 +01:00
Juan RP
1781231454
xbps_repository_pool_init: make registered index arrays immutable.
2012-01-21 10:20:45 +01:00
Juan RP
8c8273d3ed
pkgdb: update copyright year, shorter conditional.
2012-01-20 18:37:08 +01:00
Juan RP
99f5549a29
xbps_pkgdb_replace_pkgd: fix bool vs int confusion in returned value.
2012-01-20 12:38:24 +01:00
Juan RP
3f9477417b
xbps_set_cb_xxx: simplify by using vars on the stack.
2012-01-20 12:29:14 +01:00
Juan RP
d075411049
Improve API documentation round 1.
2012-01-20 12:17:27 +01:00
Juan RP
6057bd83b3
Update pkgdb dot file with latest changes.
2012-01-20 11:16:07 +01:00
Juan RP
8d23ace0da
Rename lib/regpkgdb_dictionary.c to lib/pkgdb.c.
2012-01-20 11:12:53 +01:00
Juan RP
6940505de9
regpkgdb rototill: renamed to pkgdb, improve the public API.
2012-01-20 11:10:52 +01:00
Juan RP
9a088937b5
Repository index 1.4 -- see NEWS file for info.
2012-01-19 12:26:40 +01:00
Juan RP
dfc7ff4232
API break: simplify xbps_repository_pool_find_virtualpkg().
2012-01-18 08:25:28 +01:00
Juan RP
d0e1477eeb
Simplify xbps_end() and don't continue if xbps_init() did not succeed.
2012-01-17 16:56:17 +01:00
Juan RP
f2b05d6438
Improved pkg best matching in rpool, and support for exact pkgver matches.
...
- xbps_repository_pool_find_pkg in best match case, now returns the
newest package version available in rpool.
- Added xbps_repository_pool_find_pkg_exact that returns a package
by exact matching a pkgver.
- Removed xbps_handle_alloc(), the user is free to use memory
allocated from heap or stack.
- Improved API documentation in preparation for 0.12.
Bumped XBPS_API_VERSION again.
2012-01-17 16:17:03 +01:00
Juan RP
beb7284681
xbps-repo: faster 'genindex' target implementation for index-files.plist.
2012-01-17 10:50:35 +01:00
Juan RP
4164573b35
Added xbps_match_pkgdep_in_array() to match a pkgdep against pkgpatterns.
...
This fixes xbps_match_pkgpattern_in_array() which had the args swapped
in xbps_pkgpattern_match() resulting in inverted results while resolving
virtual packages in a transaction.
2012-01-16 15:50:06 +01:00
Juan RP
ffa48b2cf3
Fix xbps_configure_packages() by avoiding proplib iterators.
2012-01-16 14:41:16 +01:00
Juan RP
233d9f4803
Do not treat repositories with trailing '/' chars as invalid.
2012-01-15 17:23:50 +01:00
Juan RP
2186e16a5e
Fixed issue 21 "xbps-repo find-files
is awfully slow" reported by ojab.
2012-01-15 14:24:44 +01:00
Juan RP
0356afba6d
Bump copyright year for latest changes.
2012-01-05 16:17:37 +01:00
Juan RP
c83a77c1b5
Fixed issue 19 "xbps-src cannot fetch source with unknown Content-Length".
2012-01-05 12:26:57 +01:00
Juan RP
ab6d4a19f1
xbps_configure_packages: fix flush arg confusion.
2012-01-04 17:59:49 +01:00
Juan RP
a7ef059673
Bump copyright year for changed files.
2012-01-04 17:56:52 +01:00
Juan RP
a31c20e52a
Make xbps_configure_pkg/packages accept a flush bool arg for frontends.
2012-01-04 17:41:36 +01:00
Juan RP
812005a7d9
libxbps: use vpkg if found in reqby_pkg_add.
2012-01-04 17:41:22 +01:00
Juan RP
bae664c639
xbps_match_pkgpattern_in_array: fix swapped args resulting in non matches.
2011-12-29 16:35:56 +01:00
Juan RP
0d44ae267c
xbps_init: print xhp->conffile if set in a dbg printf.
2011-12-29 10:57:24 +01:00
Juan RP
f4f995574c
xbps_remove_pkg_from_dict_by_name: make this work correctly again.
2011-12-28 09:44:25 +01:00
Juan RP
caaba09295
xbps_register_pkg: fix by adding pkgd into regpkgdb array.
2011-12-28 09:21:01 +01:00
Juan RP
a7f3a56e19
Make xbps_(un)register_pkg() accept a boolean arg to flush regpkgdb on success.
2011-12-28 05:57:04 +01:00
Juan RP
b64fb39701
xbps_remove_pkg_from_dict_by_name: simplify.
2011-12-24 16:37:25 +01:00
Juan RP
5a1ab26972
Introduce xbps_regpkgdb_remove_pkgd, and use regpkgdb funcs to make xbps-uhelper work.
2011-12-24 16:09:30 +01:00
Juan RP
39d064aff8
xbps_unpack_binary_pkg: handle EPERM more efficiently.
2011-12-24 12:07:30 +01:00
Juan RP
9d767f19cb
xbps_remove_pkg: issue a XBPS_STATE_REMOVE_FAIL state cb if access(2) failed.
2011-12-24 01:30:57 +01:00
Juan RP
3b7491d29b
Merged purge code in remove, configurable transaction regpkgdb flushing.
...
See the NEWS file for info.
2011-12-24 01:05:26 +01:00
Juan RP
d7a32a7eca
Introduce regpkgdb_foreach_reverse_pkg_cb, switch to regpkgdb_foreach_xxx.
2011-12-23 08:16:25 +01:00
Juan RP
36c79fc167
xbps_handle_alloc: use calloc to avoid using unitilizated value.
2011-12-22 21:47:32 +01:00
Juan RP
ca0905925f
xbps_end: don't continue if we don't have a valid xbps_handle pointer.
2011-12-22 16:55:35 +01:00
Juan RP
3d81d497bd
Redo xbps_repository_pool internals, it's a bit faster now.
2011-12-22 16:38:05 +01:00
Juan RP
7bfcdee791
Introduce xbps_regpkgdb_foreach_pkg_cb() and use it in xbps-bin check.
2011-12-22 14:25:27 +01:00
Juan RP
b232ca1815
libxbps: cache regpkgdb just when it's needed not via xbps_init().
2011-12-22 12:56:56 +01:00
Juan RP
8fd5253e31
xbps_repository_pool_init: check repo arch before plist access(2), faster.
2011-12-22 12:56:49 +01:00
Juan RP
5a892023f4
Be a bit more paranoid by checking allocs and expected types.
2011-12-22 08:23:11 +01:00
Juan RP
866c395d12
Simplify xbps_repository_pool_find_xxx.
2011-12-19 14:22:19 +01:00
Juan RP
c40c40e08e
Always preserve current conffiles while installing new packages.
2011-12-19 11:20:27 +01:00
Juan RP
53fd5fa10b
xbps_transaction_update_packages: handle ENODEV case (package removed but not purged).
2011-12-16 11:03:40 +01:00
Juan RP
1a4c13e1bf
xbps_remove_pkg: fix path to REMOVE script.
2011-12-16 10:34:05 +01:00
Juan RP
450bf2713d
Also purge packages to replaced in transaction.
2011-12-16 10:21:51 +01:00
Juan RP
2bc9890eb6
xbps_purge_pkg: fix a memleak.
2011-12-16 09:28:37 +01:00
Juan RP
1698bde3a4
xbps_pkg_index_plist: fix path to repository's index.plist.
2011-12-15 15:34:51 +01:00
Juan RP
c60ab726a3
xbps_configure_pkg: fix path to INSTALL script.
2011-12-15 14:46:59 +01:00
Juan RP
32fdb35c56
libxbps: make xh->cachedir to always use a full path after xbps_init().
2011-12-15 14:24:10 +01:00
Juan RP
70e95786dc
libxbps: pass xhp->conffile as last argument when execing INSTALL/REMOVE scripts.
2011-12-15 12:24:59 +01:00
Juan RP
93e3603dcc
xbps_init: use __UNCONST to shut up gcc's -Wcast-qual warnings.
2011-12-15 11:30:17 +01:00
Juan RP
b0ceeaa58e
New configuration file via confuse: xbps.conf.
2011-12-15 11:19:20 +01:00
Juan RP
3f45f563be
xbps-bin: syslog support, enabled by default.
2011-12-06 13:02:49 +01:00
Juan RP
43d85c76b3
xbps-repo: implement new target 'pkg-list' to list pkgs from target repo.
2011-12-03 10:37:31 +01:00
Juan RP
8be527cbdf
xbps_fetch_file: set bytes downloaded correctly for the fetch client cb.
2011-12-01 12:21:13 +01:00
Juan RP
e7562fa72d
libxbps: make xbps_find_*pkg_dict_installed only accept {INSTALL,UNPACK}ED states as valid ones.
2011-11-30 11:11:15 +01:00
Juan RP
9d731ffe09
Introduce xbps_transaction_remove_pkg() and use it for xbps-bin(8).
2011-11-27 09:05:18 +01:00
Juan RP
dcac4ec153
xbps_remove_pkg: only issue XBPS_STATE_REMOVE in no update case.
2011-11-25 15:08:33 +01:00
Juan RP
0ff0aee226
libxbps: added xbps_transaction_autoremove_pkgs(bool purge).
...
This is to add package orphans into the transaction dictionary.
2011-11-25 11:20:03 +01:00
Juan RP
bbfd2813b2
libxbps: renamed xbps_repository_{install,update}_xxx to xbps_transaction_xxx.
2011-11-25 10:12:03 +01:00
Juan RP
f3099fa2c6
Added success states for state_cb, move some descriptions to the client cb.
2011-11-25 09:44:49 +01:00
Juan RP
196b26035a
Zero out cb structs completely.
2011-11-25 08:22:20 +01:00
Juan RP
ab17573692
Split XBPS_FLAG_FORCE into CONFIGURE and REMOVE_FILES, bump XBPS_API_VERSION.
2011-11-24 11:50:53 +01:00
Juan RP
3ccfec7054
Improved callback/states support to make libxbps std{err,out} printf free.
...
This is a major API/ABI change, documentation has been updated accordingly.
2011-11-24 11:23:08 +01:00
Juan RP
c0ecb93410
libxbps: always force pkgpattern match in virtualpkgs from conf.
2011-11-17 12:59:36 +01:00
Juan RP
19664f624a
libxbps: return success when requiredby entry already exists.
2011-11-17 12:57:43 +01:00
Juan RP
86f1f18571
libxbps: revamped trans states/cb to be more generic, not just for transactions.
2011-11-11 09:41:48 +01:00
Juan RP
a470e6a1af
libxbps: xbps_repository_pool_sync: show proper error on dbg printf.
2011-11-11 00:31:56 +01:00
Juan RP
bcaaf60966
libxbps: xbps_repository_sync_pkg_index: set correct error in err cb.
2011-11-11 00:31:09 +01:00
Juan RP
756234e9c3
libxbps: xbps_fetch_error_string: return NULL on libfetch success.
2011-11-11 00:30:01 +01:00
Juan RP
bbd83767c6
libxbps: missing arg in printf format for xbps_pkg_index_plist.
2011-11-11 00:10:35 +01:00
Juan RP
94b6458415
libxbps: skip unfetched repos in xbps_repository_pool_init and simplify.
2011-11-11 00:07:26 +01:00
Juan RP
45d55698d8
libxbps: strip redundant dir separators returned by xbps_pkg_index_plist().
2011-11-11 00:05:56 +01:00
Juan RP
c2eed68471
libxbps: add xbps_repository_pool_sync, to sync repoidx from all remotes.
2011-11-10 23:14:50 +01:00
Juan RP
de4504c248
Update refs to pkg-index, which aren't true anymore.
2011-11-10 09:21:17 +01:00
Juan RP
e46dd09127
Faster binary package unpacking, see the NEWS file for info.
2011-11-09 21:01:25 +01:00
Juan RP
bffff1a00d
libxbps: xbps_set_pkg_state_installed: create metadir with 0755 perms.
2011-11-09 16:36:11 +01:00
Juan RP
a426bad11d
libxbps: xbps_mkpath: create intermediate dirs with 0755 permissions.
2011-11-09 11:17:42 +01:00
Juan RP
662b5acc08
Implemented "New repository scheme and configuration file" from issue 16.
2011-11-07 20:28:35 +01:00
Juan RP
e472fc1334
xbps_repository_pool_find_pkg: return ENODEV in bestpkg case if pkg not installed.
2011-10-31 21:29:37 +01:00
Juan RP
5aca09b5f5
xbps_repository_update_pkg: return ENODEV if pkg is not installed.
2011-10-31 21:29:00 +01:00
Juan RP
cf1b893995
libxbps: there's no need to look for vpkgs in xbps_repository_update_*().
2011-10-31 21:01:53 +01:00
Juan RP
b8c804e891
Check for obj validity with prop_object_type(), use xbps_pkg_has_rundeps().
2011-10-31 09:48:46 +01:00
Juan RP
f35e1eff42
libxbps: improve debugging messages while looking for pkgs in repos.
2011-10-30 16:41:39 +01:00
Juan RP
c5d6ccde46
libxbps: make check_is_installed_pkg_* use only find_virtualpkg_dict_installed.
...
xbps_find_virtualpkg_dict_installed() also finds real packages, so there's no
need to use both in xbps_check_is_installed_pkg_by_{name,pattern}.
Bump XBPS_API_VERSION.
2011-10-30 16:24:56 +01:00
Juan RP
2a8b74484e
libxbps: improve xbps_purge_pkg() in case that metadata dir doesn't exist.
2011-10-30 11:12:03 +01:00
Juan RP
858e616f41
libxbps: preserve config file if they exist for replaced pkgs.
2011-10-30 10:32:56 +01:00
Juan RP
07d47ab09a
libxbps: xbps_dictionary_from_metadata_plist: respect pkgname arg.
2011-10-30 08:01:25 +01:00
Juan RP
70dd86e2df
libxbps: more dbg printf love.
2011-10-29 09:55:09 +02:00
Juan RP
85c58e77c2
libxbps: rpool printf tweaks.
2011-10-29 09:45:51 +02:00
Juan RP
dbd5e05280
Make sure that downloaded pkg-index.plist is really a plist file.
2011-10-28 09:29:37 +02:00
Juan RP
9034df9bc2
libxbps: added xbps_match_any_virtualpkg_in_rundeps(array rundeps, array provides).
...
Matches any pkgdep from provides array in the rundeps array with
pkgpatterns. True on match, false otherwise.
2011-10-27 18:48:59 +02:00
Juan RP
43ab2ec083
libxbps: fixed a bug with virtualpkgs as dependencies in a transaction.
2011-10-27 10:54:28 +02:00
Juan RP
94591775d5
libxbps: fixed multiple free(3) calls via closedir(3) in virtualpkg init in error paths.
2011-10-26 16:16:09 +02:00
Juan RP
c6636d1b79
libxbps: xbps_pkgpattern_xxx extend set of chars to be detected.
2011-10-24 10:03:45 +02:00
Juan RP
7716fa15de
libxbps: xbps_repository_find_pkg_xxx added a debug printf.
2011-10-24 10:01:27 +02:00
Juan RP
9281e9625f
libxbps: xbps_pkgpattern_{name,version}: match for dewey and glob patterns.
...
The match code used by libxbps now will only match for dewey patterns
and glob patterns (fnmatch).
Bumped XBPS_API_VERSION due to changed behaviour.
2011-10-24 09:28:43 +02:00
Juan RP
4afaac4179
libxbps: remove csh alternate match code.
...
This code won't be used in XBPS and only slowdowns
xbps_pkgpattern_match().
2011-10-24 09:27:15 +02:00
Juan RP
ca8e8accc4
Move external code used by libxbps into lib/external.
2011-10-24 09:05:16 +02:00
Juan RP
5ade2f37c7
libxbps: xbps_configure_pkg: ignore pkgs in config-files state.
2011-10-20 16:13:16 +02:00
Juan RP
51b45a0d08
libxbps: improve code to match replaced package patterns.
...
The replaces code now checks all package dictionaries in the
transaction dictionary, and the sorting algorithm will put packages
to be removed at the head of the tailq.
This should fix issue 11 in googlecode.
2011-10-20 14:39:58 +02:00
Juan RP
eae6bf8ab4
libxbps: when sorting deps, add removed pkgs to head.
2011-10-20 13:10:39 +02:00
Juan RP
9fb3c38aa2
Extend assertions by checking passed in proplib type.
2011-10-19 16:53:38 +02:00
Juan RP
a80df68b15
libxbps: simplify xbps_transaction_commit().
2011-10-19 16:25:49 +02:00
Juan RP
0a041cdd2e
libxbps: new func xbps_array_replace_dict_by_name(array, dict, pkgname)
...
This function replaces a dictionary in an array matched by pkgname,
with the dictionary passed in as 2nd argument.
2011-10-19 00:37:36 +02:00
Juan RP
931a03b806
New configuration schemas changes, round 3.
...
struct xbps_handle::conffile has been renamed to confdir, and it now
expects the path to a directory, where the configuration files are
stored.
Change xbps-bin(8) and xbps-repo(8) along with its manpages to mention
that -C expects a directory.
2011-10-17 15:11:54 +02:00
Juan RP
08f7169eff
New configuration scheme changes, round 2 (virtual pkgs).
...
- XBPS now expects to read individual virtual pkg settings from
.plist files in PREFIX/etc/xbps/virtualpkg.d.wants.
This really implements the missing part in issue #12 in
googlecode: http://code.google.com/p/xbps/issues/detail?id=12
2011-10-17 14:24:30 +02:00
Juan RP
5642ffa86e
New configuration scheme changes, round 1.
...
- Configuration file 'xbps-conf.plist' has been splitted off into
two files: conf.plist and repositories.plist. By default they
are stored in etc/xbps.
- Changed some members in xbps_handle struct, mostly to make it easy
to change its value in {cache,root}dir and conffile.
- Made xbps_init() release proplib objects as soon as we don't need
them, that way it uses 35% less of memory or in some cases even more.
There will be another commit that will implement to read new virtualpkg
settings by the user, as specified in:
http://code.google.com/p/xbps/issues/detail?id=12
2011-10-17 12:37:15 +02:00
Juan RP
b6da7393c1
libxbps: make the xbps_find_*pkg_dict_installed work as expected.
...
Bump XBPS_API_VERSION due to semantics change in virtual and non virtual
functions.
2011-10-16 17:21:43 +02:00
Juan RP
dfa8b8e8ba
libxbps: make xbps_*_find_virtualpkg_*_by_name funcs work as expected.
2011-10-16 16:52:58 +02:00
Juan RP
d551713c01
Move repository_pool_find code into its own file.
2011-10-16 14:31:53 +02:00
Juan RP
12af2370da
libxbps: separate virtualpkg conf stuff from repository_pool_find_pkg.
...
Now to find a virtualpkg set by the user in conf file, there is a new
function: xbps_repository_pool_find_virtualpkg(). Use it in some
places to make jpeg -> libjpeg-turbo (and other pkgs that can be
replaced with other virtual pkgs) work correctly even if installed
multiple times.
2011-10-16 12:22:46 +02:00
Juan RP
104bec27e5
libxbps: handle the case to replace a vpkg with a pkg with same name.
...
This for example fixes reinstalling jpeg and libjpeg-turbo multiple
times. Also if the "automatic-install" obj is in the pkg to be
replaced, copy it to the new pkg to be preserved.
Bumped XBPS_API_VERSION.
2011-10-16 10:28:03 +02:00
Juan RP
0f0c66fafb
xbps_dictionary_from_metadata_plist: if pkgname not found try from a
...
virtual pkg.
2011-10-16 10:27:02 +02:00
Juan RP
a59f48585f
repository_pool_find_pkg: added some dbg printf, calloc -> malloc.
...
There's no need to use calloc here because some members are being
initialized anyway, so fully initialize all members and skip the memset
syscall via calloc.
2011-10-16 10:03:27 +02:00
Juan RP
e37a9efb74
libxbps: check in virtual pkgs when matching replaced pkgs.
2011-10-15 20:01:55 +02:00
Juan RP
d3e1c0dcf2
libxbps: when sorting deps take into account transaction reason.
2011-10-15 20:00:41 +02:00
Juan RP
f2ede44c80
libxbps: make xbps_find_virtualpkg_user *only* look for virtual pkgs.
2011-10-15 19:59:54 +02:00
Juan RP
ead8d2460f
libxbps: respect reqdby obj when replacing a pkg with a virtual pkg.
...
Reverse dependencies weren't respected when replacing a pkg with
another pkg that is providing a virtual pkg for the former.
This resulted in reversedeps being completely lost when new pkg
is installed.
2011-10-15 16:43:27 +02:00
Juan RP
20b0b4ce12
libxbps: when replacing a pkg, also fully purge the pkg(s).
2011-10-12 09:28:11 +02:00
Juan RP
024bec0045
Fixed HTTP repositories in non standard HTTP port (80).
...
The code didn't take into account for different ports and simply ignored
them, now they work correctly. This fixes issue 10 in googlecode.
2011-10-06 19:05:16 +02:00
Juan RP
4b68af989e
libxbps: xbps_repository_sync_index: return proper return value in error path.
2011-08-18 10:43:30 +02:00
Juan RP
ba5913cbb9
libxbps: [unpack] only extract files if they have been modified.
2011-08-01 12:35:47 +02:00
Juan RP
890bdd368f
xbps_unpack_binary_pkg: remove redudant error printf, cosmetic changes.
2011-07-29 23:28:36 +02:00
Juan RP
2857214afa
libxbps: improve returned errnos for repository API functions.
...
- xbps_repository_update_packages: return ENOENT if regpkgdb is NULL
(no packages currently registered).
- xbps_repository_update_packages: return EEXIST if no updates are
available.
- xbps_repository_pool: return ENOTSUP if no repositories were
registered.
- make xbps-{bin,repo} handle ENOTSUP errors.
2011-07-29 11:17:34 +02:00
Juan RP
5e390b8839
Introduce new pkg state: half-unpacked.
...
Packages in this state shall be re-installed and re-unpacked because its
files weren't unpacked properly.
2011-07-28 16:25:01 +02:00
Juan RP
98a2508c2e
xbps_repository_sync_pkg_index: fix copy/paste in trans err_cb.
2011-07-28 09:34:29 +02:00
Juan RP
6f783389dd
Share transaction callbacks for xbps-{bin,repo}, reposync cb support.
2011-07-28 09:25:30 +02:00
Juan RP
508f119bc9
Moved install transaction code to libxbps, see NEWS file.
2011-07-27 17:13:54 +02:00
Juan RP
ce0b21a062
xbps_dictionary_from_metadata_plist: fix this with empty regpkgdb.plist.
...
If regpkgdb wasn't initialized it failed to properly internalize the
dictionary from the plist file.
2011-07-27 11:23:25 +02:00
Juan RP
e26b6e23e6
xbps-bin(8): make 'show{,-deps,-revdeps}' target work with virtual pkgs.
2011-07-25 16:40:34 +02:00
Juan RP
19f4cbd995
Generate transaction pkg count stats in the transaction dictionary.
...
This removes a chunk in frontends to compute number of installed,
updated, configured and removed pkgs in transaction.
2011-07-24 17:43:17 +02:00
Juan RP
32be850c9d
libxbps: make dewey code be aware of XBPS pkg revisions.
...
This makes the comparision "1.4.11.1" greater than "1.4.11_1", that
previously thought they were the same version.
2011-07-22 07:30:40 +02:00
Juan RP
a22a6c3be1
libxbps: move hash funcs from util.c into its own file.
2011-07-19 21:21:28 +02:00
Juan RP
468366b1b2
libxbps: move match funcs from plist_find.c into its own file.
2011-07-19 21:07:04 +02:00
Juan RP
5dfe493a88
xbps_check_is_installed_pkg_by_name: also check for virtual pkgs.
2011-07-17 01:43:56 +02:00
Juan RP
17829cd6b4
libxbps: add xbps_find_virtualpkg_in_array_by_{name,pattern} and use it.
2011-07-15 18:45:38 +02:00
Juan RP
33d6d2e166
libxbps: API/ABI break changes to fix issues with virtual packages.
...
Please see the NEWS file for info about this commit.
2011-07-15 18:22:58 +02:00
Juan RP
f6476e210c
libxbps: do not loop forever on errors while syncing a remote repo.
2011-07-14 00:13:25 +02:00
Juan RP
0a2abb3f3d
xbps-repo(8): 'search' target is now case insensitive.
...
Along with this change, compat code has been added (from NetBSD)
for systems that don't have it. The compat code has been reorganized
to be in a common place and its prototypes in compat.h.
The configure scripts checks if strcasestr() is available, and
uses compat code if not found.
This fixes issue #2 on github.com/vanilla/xbps.
2011-07-09 10:50:44 +02:00
Juan RP
5585b98ac6
libxbps: take into account virtual-pkg settings in conf file when updating.
2011-07-08 15:28:57 +02:00
Juan RP
900e35a15e
xbps_unpack_binary_pkg: printf existents entries iff XBPS_FLAG_VERBOSE is set.
2011-07-05 17:47:37 +02:00
Juan RP
979c585652
Preserve files on disk while installing a binary package.
...
While installing packages, if any file that is going to be unpacked
exists on disk don't remove it. Always preserve them to avoid missing
files on currently installed package if there are file conflicts.
2011-07-03 17:12:02 +02:00
Juan RP
f0745120f6
Fix sorting algorithm to add same pkgs with different transaction reasons.
2011-06-25 22:53:16 +02:00
Juan RP
fe2bbb675f
xbps_unpack_binary_pkg: fix previous and also handle ERANGE after unlink.
2011-06-25 18:19:56 +02:00
Juan RP
f29bbc7029
Backed out changeset 2d5467e382fd
...
This broke some dependency patterns, revert it for now.
2011-06-25 12:45:17 +02:00
Juan RP
a984c60437
xbps_cmpver: test for DEWEY_GT because it's most commonly used.
...
Also some code that handled "netbsd" pkg revisions have been removed,
we don't/won't use it.
2011-06-25 12:37:10 +02:00
Juan RP
e218e710f9
xbps_unpack_binary_pkg: in remove_file_wrong_hash() handle ENOENT errors.
2011-06-25 11:47:42 +02:00
Juan RP
532edaddda
libxbps: only initialize repository pool in repository_pool_foreach, fix a bug.
...
In xbps_repository_pool_init, xbps_fetch_file() returns 1 when a file is
successfully fetched and that var was used to check for successful initialization.
2011-06-24 21:20:06 +02:00
Juan RP
a1100fd00d
libxbps: when updating ignore pkgs in config-files state.
2011-06-23 11:40:11 +02:00
Juan RP
9468520e69
libxbps: fixed a bug in virtual pkg handling.
...
When resolving dependencies it didn't take into account virtual packages
in some cases.
2011-06-23 11:30:04 +02:00
Juan RP
5847a11570
xbps_fetch_file: remove local file if bigger than remote and refetch.
2011-06-23 00:06:50 +02:00
Juan RP
74ce033d45
Don't initialize repository pool via xbps_init, instead in repository_pool public funcs.
...
That way we can avoid having to sync all remote repositories for any code
using xbps_init()!
2011-06-22 11:55:02 +02:00
Juan RP
12d488ec47
xbps_repository_pool_init: return errno value if a repo sync fails.
2011-06-22 10:54:06 +02:00
Juan RP
6fe2c61c59
xbps_init: missing argument in a printf.
2011-06-22 10:53:20 +02:00
Juan RP
e9fa37bc2f
xbps_repository_sync_index: preserve errno in error path and add debug printfs.
2011-06-22 10:52:46 +02:00
Juan RP
fbfa9c5960
New option in conffile to set libfetch's limit (seconds) in timed out connections.
2011-06-22 09:53:44 +02:00
Juan RP
092c832e6c
mkpath: indent some comments.
2011-06-21 10:43:52 +02:00
Juan RP
0bc77f86fa
xbps_pkg_epoch is not supported anymore with NetBSD's dewey.
2011-06-14 11:26:00 +02:00
Juan RP
3bd48a8521
lib/dewey.c: minor cosmetic changes.
2011-06-14 11:25:28 +02:00
Juan RP
cb7b44bc13
Rename property in conf file for virtual packages to "virtual-packages".
2011-06-04 11:30:21 +02:00
Juan RP
ebae4fbfca
xbps_init: fix logic.
2011-06-04 17:12:26 +02:00
Juan RP
5a355ed6d9
It's now possible to set rootdir, cachedir, and fetch caches in the conf file.
2011-06-04 17:08:44 +02:00
Juan RP
b2840a3f16
plist_fetch: add some debugging printfs to know when network access is working.
2011-06-04 16:05:19 +02:00
Juan RP
20c36d73ef
xbps_init: don't panic if conf_dictionary cannot be internalized, just continue.
2011-06-04 15:51:32 +02:00
Juan RP
51bee11bfa
Switch xbps_cmpver() to use NetBSD's dewey code.
2011-06-04 15:42:50 +02:00
Juan RP
47e3a3f39b
xbps_init: add a debug printf if repository array in conf file is empty.
2011-06-04 15:08:50 +02:00
Juan RP
36346a7ca0
xbps_init: add a debug printf.
2011-06-04 14:17:11 +02:00
Juan RP
9673c4bd09
XBPS major changes in June 2011.
...
- A configuration file "xbps-conf.plist" replaces the (un)register target
in xbps-repo(8) and (un)set-prop in xbps-bin(8). For now, you can set
the repositories and prefered virtual packages.
- New package pattern matching code from NetBSD. Supports more ways of
matching patterns in packages.
- Multiple bugs fixed in virtual packages related matching code.
--HG--
rename : LICENSE => COPYING
2011-06-04 13:37:53 +02:00
Juan RP
2d6140f65b
Rename: xbps_read_dict_from_archive_entry() -> xbps_dictionary_from_archive_entry().
2011-06-02 09:54:59 +02:00
Juan RP
841c9e2d51
API/ABI break for June 2011.
...
Rename some functions to reflect its description a bit better.
--HG--
rename : lib/repository_plist.c => lib/plist_fetch.c
2011-06-01 09:37:32 +02:00
Juan RP
ef28101203
xbps_register_pkg: remove 'automatic' boolean argument.
...
It should be provided in the proplib dictionary with key 'automatic-install'.
This fixes a regression not respecting the 'automatic-install' value stored
in regpkgdb.
2011-04-11 14:42:06 +02:00
Juan RP
d9eb0341cd
Some dead stores and build fixes reported by LLVM 2.9.
2011-04-07 12:24:20 +02:00
Juan RP
6a91c2894e
xbps_unpack_binary_pkg: fix wrong path to metadata files!
2011-03-04 10:48:39 +01:00
Juan RP
0452c7c9dd
Fix a dup'ed word.
2011-03-03 17:56:18 +01:00
Juan RP
8191a1511c
Make it possible to overwrite the "automatic-install" pkg object via xbps_init().
...
Two new booleans were added to struct xbps_handle: install_reason_{auto,manual}.
The backend is able to force auto or manual installation for a package (and
dependencies that were installed/updated) by setting to true any of those
booleans. Bump XBPS_RELVER.
2011-02-26 11:11:45 +01:00
Juan RP
2c644c6587
Treat pkgs with NULL or empty requiredby arrays as orphans.
2011-02-26 11:08:58 +01:00
Juan RP
0435772097
Fix chdir(2) path in previous.
2011-02-25 11:21:12 +01:00
Juan RP
ce24ff488c
xbps_file_exec: if chroot(2) returns EPERM, don't error out and try chdir(2).
...
This makes possible to install a base system with fakeroot (of course
some things won't probably work fully).
2011-02-25 11:17:13 +01:00
Juan RP
9759a62e3f
Do not printf a warning if remove(3) returns EEXIST/ENOTEMPTY/EBUSY.
2011-02-25 10:51:43 +01:00
Juan RP
0a6299318e
Revert revision 581: "Inline some very common functions in the API."
...
Some compilers yet don't support fully the inline C99 keyword and
there's little benefit anyway.
2011-02-24 15:48:50 +01:00
Juan RP
17be7bab81
configure: misc compiler flags fixes.
...
- Don't use -Wp, some compilers don't understand it. Simply use -D__BLAH___.
- Check for -Wl,--export-dynamic and if that fails try -rdynamic.
2011-02-24 15:33:53 +01:00
Juan RP
a252df4a8b
xbps_humanize_number: increase by one the output digits.
2011-02-24 10:46:10 +01:00
Juan RP
e4c24e5fea
xbps_read_dict_from_archive_entry: handle all erros returned by zlib's inflate().
2011-02-24 10:00:21 +01:00
Juan RP
7c6119427c
While installing a pkg, remove files with wrong hash before unpacking.
2011-02-24 00:24:11 +01:00
Juan RP
7e4118a6e2
Added xbps_get_file_hash_from_dict(), returns the sha256 string obj in a dictionary.
2011-02-24 00:21:40 +01:00
Juan RP
d357dfed90
Inline some very common functions in the API.
2011-02-23 17:27:51 +01:00
Juan RP
8baad7b5da
Simplify setting pkg state in transaction's dictionary.
2011-02-23 17:14:33 +01:00
Juan RP
a306cebc96
xbps_set_pkg_state_installed: added two new optional arguments: version and pkgver.
...
This can be used to avoid some rare cases where the pkg dictionary is regpkgdb
is in a state where code can be faulty if those objects are not found.
2011-02-22 11:09:39 +01:00
Juan RP
15d164c70a
xbps_repository_{install,update}_pkg: respect pkg state in regpkgdb.
2011-02-22 10:31:16 +01:00
Juan RP
511dbffa9e
Simplify find_pkg_in_array().
2011-02-21 23:21:53 +01:00
Juan RP
bdfa81c29d
package_unpack.c: fix a comment.
2011-02-21 17:57:46 +01:00
Juan RP
870ad18d58
xbps_init() now sets rootdir, cachedir and flags.
...
That means that the following functions were removed:
- xbps_set_{cachedir,flags,rootdir}.
- xbps_get_{cachedir,flags,rootdir}.
With this change fixed an obvious typo that made -c argument to not work,
and now the cache directory is an absolute path not relative to rootdir.
2011-02-21 17:42:47 +01:00
Juan RP
afe0f3e2f0
Make the xbps_handle struct const internally.
2011-02-21 14:03:08 +01:00
Juan RP
22ae7aa2e8
Introduce struct xbps_handle and use it for xbps_init().
...
This structure sets up function callbacks for fetching files and
unpacking binary packages, as well as setting the debug boolean.
This way the affected functions (xbps_fetch_file() and
xbps_unpack_binary_pkg()) do not need to accept the fn cb pointers
and data as arguments.
Bump XBPS_RELVER.
2011-02-21 13:38:44 +01:00
Juan RP
078f9f1cda
Fixed finally another real case when updating and replacing pkgs.
2011-02-18 16:39:42 +01:00
Juan RP
8b58b88a5f
xbps_repository_{install,update}_pkg: fixed a stupid logic error.
2011-02-18 16:37:16 +01:00
Juan RP
032f993a53
xbps_repository_pool_init: do not fail to internalize all repos when the first one fails.
...
If the first registered repo couldn't be internalized, all other repositories
were also failing because it returned error, so simply skip them and return
error when all them cannot be internalized.
2011-02-17 09:24:57 +01:00
Juan RP
d5c2a3266f
Rename the transaction object key to "transaction" rater than "trans-action".
2011-02-05 12:21:04 +01:00
Juan RP
8803bfd7d8
Move plist find/remove functions into its own files.
2011-02-05 12:06:03 +01:00
Juan RP
f4cdbaf17d
Move xbps_read_dict_from_archive_entry() and friends into its own file.
2011-02-05 11:57:13 +01:00
Juan RP
de296d8192
Added the concept of package properties in the API.
...
See the NEWS file and xbps-bin(8) for more information.
2011-02-05 11:25:04 +01:00
Juan RP
ec7549fa04
xbps_sort_pkg_deps: change an assertion into a real check.
2011-02-04 16:17:47 +01:00
Juan RP
097b50b3c2
Fix all warnings found by clang analyzer as reported by ojab in issue 3.
2011-02-03 17:49:43 +01:00
Juan RP
0a26497b50
xbps_repository_update_allpkgs: return ENOENT if regpkgdb dict cannot be internalized.
2011-02-03 09:34:38 +01:00
Juan RP
692caea1cd
xbps_get_pkg_state_*: if state object is not available return EINVAL.
2011-02-02 09:53:56 +01:00
Juan RP
927d7e0c5d
xbps_repository_find_pkg_deps: improve a debug printf.
2011-02-01 17:32:25 +01:00
Juan RP
0e38b649ff
xbps_get_pkg_state_installed: if pkg dictionary is not found return ENOENT.
2011-02-01 17:30:59 +01:00
Juan RP
fdc496e8f1
Added xbps_repository_pkg_replaces() to handle pkg "replaces" in the transaction.
...
The frontend (in that case xbps-bin(8)) is only responsible to remove
those packages that have the "trans-action" string object set to "remove".
2011-02-01 01:21:54 +01:00
Juan RP
da607becf9
Make some xbps_warn_printf dependent of XBPS_FLAG_VERBOSE.
2011-01-30 18:38:16 +01:00
Juan RP
5c7eaf2f92
xbps_warn_printf: fix previous and remove unused var.
2011-01-30 18:32:15 +01:00
Juan RP
42eb834e8d
xbps_warn_printf: always print regardless of XBPS_FLAG_VERBOSE.
2011-01-30 18:31:36 +01:00
Juan RP
e04f167d09
xbps_repository_pool_foreach: use SIMPLEQ_FOREACH_SAFE.
2011-01-30 15:09:18 +01:00
Juan RP
bdd48de67d
xbps_sort_pkg_deps: use TAILQ_FOREACH_SAFE.
2011-01-30 14:42:17 +01:00
Juan RP
2492d98d13
xbps_purge_pkg: chdir to rootdir, check that REMOVE file exists and is executable.
2011-01-30 12:49:55 +01:00
Juan RP
b6b3bd799b
xbps_purge_pkg: execute the "purge" action in REMOVE script (if found).
...
This replaces code for removing all directories installed by the
package and instead let's the package do whatever is ok in the REMOVE
script by executing the "purge" action.
2011-01-30 11:32:46 +01:00
Juan RP
7da33469cc
xbps-bin(8): added -R option to recursively remove pkgs that were instaled automatically.
2011-01-30 08:08:34 +01:00
Juan RP
bb897da7b4
Fix an assertion.
2011-01-30 00:14:29 +01:00
Juan RP
de034c28f5
xbps_find_pkg_orphans: simplify even more.
2011-01-29 18:34:50 +01:00
Juan RP
5bbbb3c8fd
xbps_find_pkg_in_*: search for virtual pkg before the real one.
2011-01-29 17:57:01 +01:00
Juan RP
8d6eab5ac1
xbps_remove_obsoletes: make xbps_printf conditionalized with XBPS_FLAG_VERBOSE.
2011-01-29 16:26:17 +01:00
Juan RP
d7bafff252
xbps_requiredby_pkg_{add,remove}: simplify and make them aware of virtual pkgs.
2011-01-29 12:29:30 +01:00
Juan RP
241751f1b7
Added three new helper functions to the API.
...
xbps_find_pkg_in_array_by_name
xbps_find_pkg_in_array_by_pattern
xbps_remove_pkgname_from_array
2011-01-29 12:28:23 +01:00
Juan RP
298305c1d5
Make some xbps_printf()s conditioned on XBPS_FLAG_VERBOSE.
2011-01-29 01:55:52 +01:00
Juan RP
463d182c49
When sorting packages also look for virtual packages.
...
A new function xbps_find_virtual_pkg_in_dict() has been made public
to the API to make this find duplicate packages in the transaction
when updating packages.
2011-01-28 20:56:28 +01:00
Juan RP
6e26332a2e
A really faster dependency sorting algorithm, 60% faster approx!
...
Benchmarks before and after the code for installing
"xorg gnome xbmc vlc firefox epdfview":
OLD
-----------------
real 0m1.844s
user 0m1.841s
sys 0m0.003s
NEW
-----------------
real 0m0.873s
user 0m0.868s
sys 0m0.004s
2011-01-28 19:47:05 +01:00
Juan RP
af5d3a0653
xbps_repository_find_pkg_deps: do not recurse more than MAX_DEPTH times, return ELOOP.
2011-01-28 12:12:47 +01:00
Juan RP
f7f3cfcb9c
Performance improvements for xbps_find_pkg_in_dict_by_* and xbps_find_*_in_array().
2011-01-28 12:11:43 +01:00
Juan RP
4438fd1183
xbps_repository_find_pkg_deps: simplify even more and remove dead code.
2011-01-27 21:54:55 +01:00
Juan RP
bebad82316
repository_finddeps.c: remove useless code.
2011-01-27 21:12:42 +01:00
Juan RP
c58107bd27
xbps_repository_find_pkg_deps: fix stupid error by reusing a var.
2011-01-27 21:02:56 +01:00
Juan RP
176f5e3e40
xbps_sort_pkg_deps: use xbps_check_is_installed_pkg_by_name().
2011-01-27 20:54:23 +01:00
Juan RP
1cc45ee20f
Fix two asserts.
2011-01-27 20:47:34 +01:00
Juan RP
8a7bfe6cda
xbps_repository_find_pkg_deps: simplify and handle an error case.
2011-01-27 18:23:32 +01:00
Juan RP
faad0a6597
Make xbps_remove_pkg_from_* use shared code, and add another variant.
...
The functions have been renamed to really match what they do.
2011-01-27 18:22:57 +01:00
Juan RP
93e1a0a22c
Performance improvements for xbps_find_pkg_in_dict_by_{name,pattern} with virtual pkgs.
2011-01-27 15:50:50 +01:00
Juan RP
1c21a98545
Rename some symbols in repository_plist.c.
...
xbps_repository_get_pkg_plist_dict_from_url -> xbps_repository_plist_find_pkg_dict_from_url
xbps_repository_get_pkg_plist_dict -> xbps_repository_plist_find_pkg_dict
2011-01-27 13:53:33 +01:00
Juan RP
6e8e5b830e
repository_register.c: fix doxygen @file mark.
2011-01-27 12:44:32 +01:00
Juan RP
69512d4da7
Rename xbps_find_pkg_from_plist to xbps_find_pkg_dict_from_plist_by_name.
2011-01-27 12:41:49 +01:00
Juan RP
26701d3bf3
Rename a few symbols for clarity.
...
xbps_check_is_installed_pkg -> xbps_check_is_installed_pkg_by_pattern
xbps_check_is_installed_pkgname -> xbps_check_is_installed_pkg_by_name
xbps_check_is_repo_string_remote -> xbps_check_is_remote_uri_remote
2011-01-27 12:34:13 +01:00
Juan RP
628a6cebf7
Rename xbps_find_orphan_packages() to xbps_find_pkg_orphans().
2011-01-27 12:19:05 +01:00
Juan RP
41341af135
Shared code for xbps_find_{string,pkgname,pkgpattern}_in_array().
2011-01-27 03:05:22 +01:00
Juan RP
22d67bcfb9
Improve comments for dependency sorting.
2011-01-26 18:57:29 +01:00
Juan RP
9797030306
xbps_register_pkg: also copy the provides object for virtual packages.
2011-01-26 18:42:28 +01:00
Juan RP
4b3b50c6ef
xbps_check_is_installed_pkg: simplify.
2011-01-26 18:41:57 +01:00
Juan RP
f06a605854
Implemented support for virtual packages.
...
The patch adds 150 lines approximately. It is implemented by modifying
xbps_find_pkg_in_dict_by_name() and xbps_find_pkg_in_dict_by_pattern().
When no dictionary is returned if tries to find a virtual package by
looking at the "provides" array object, if found.
2011-01-26 18:05:43 +01:00
Juan RP
ac6fe51340
xbps_repository_find_pkg_deps: some performance optimizations.
2011-01-25 18:09:27 +01:00
Juan RP
563b6446f4
xbps_repository_pool_find_pkg: remove a debug printf that bothers me.
2011-01-25 17:52:59 +01:00
Juan RP
35aa4b9951
xbps_fetch_file: memset the stat(2) struct before using it.
2011-01-25 17:49:24 +01:00
Juan RP
a685c9ee41
xbps_sort_pkg_deps: exit from the loop immediately if all pkgs were sorted.
2011-01-25 16:04:37 +01:00
Juan RP
a47d030851
xbps_sort_pkg_deps: optimize one more time, it is 5% faster approx.
2011-01-25 14:56:37 +01:00
Juan RP
be5ff1d934
Don't build code with _GNU_SOURCE, use _XOPEN_SOURCE=500 instead.
...
_GNU_SOURCE is only now for xbps_xasprintf() if vasprintf is found,
and only for <stdio.h>, it's unset immediately once the header is included.
2011-01-25 13:00:23 +01:00
Juan RP
81fa8da4ce
Check for vasprintf() and add a replacement if it wasn't found.
2011-01-25 12:39:05 +01:00
Juan RP
4bba48a6a0
Rename repository.c to repository_register.c.
...
--HG--
rename : lib/repository.c => lib/repository_register.c
2011-01-25 11:25:38 +01:00
Juan RP
008573e1eb
Sprinkle a couple of assert(3)ions.
2011-01-25 04:14:33 +01:00
Juan RP
082efc3535
Added xbps_callback_array_iter() and use it in xbps-bin to list missing pkgdeps.
2011-01-25 02:55:34 +01:00
Juan RP
72d82a3a26
Simplify and share common code in xbps_repository_{update,install}_pkg().
2011-01-24 18:49:24 +01:00
Juan RP
0bb0838982
Start moving code from repository_find* to transaction_*.
...
--HG--
rename : lib/sortdeps.c => lib/transaction_sortdeps.c
2011-01-24 16:55:58 +01:00
Juan RP
f6ab3a28c3
libxbps: simplify package states code.
...
--HG--
branch : progress_callback
2011-01-22 18:00:31 +01:00
Juan RP
27c2ca3732
xbps_pkgpattern_match: remove a wrong memset(3) call.
...
--HG--
branch : progress_callback
2011-01-22 17:25:37 +01:00
Juan RP
ef25792f90
Simplify xbps_find_orphan_packages() by not using a temporary SIMPLEQUEU.
...
--HG--
branch : progress_callback
2011-01-22 17:08:49 +01:00
Juan RP
08d30043a3
lib/mkpath.c: don't document this file, it's included in the util group.
...
--HG--
branch : progress_callback
2011-01-22 16:38:52 +01:00
Juan RP
0cc4ba224e
Update API documentation for recent changes.
...
--HG--
branch : progress_callback
2011-01-22 14:24:51 +01:00
Juan RP
9611f3e412
xbps_unpack_binary_pkg: rename fn callback arg to be shorter.
...
--HG--
branch : progress_callback
2011-01-22 12:56:33 +01:00
Juan RP
984eae1578
Make xbps_fetch_file accept a callback to update its progress.
...
This also makes xbps_unpack_binary_pkg follow this convention by avoiding
static variables.
--HG--
branch : progress_callback
rename : bin/xbps-repo/util.c => bin/xbps-bin/util.c
2011-01-22 12:40:19 +01:00
Juan RP
8c2ccea435
WIP checkpoint for progress callbacks in the API.
...
At this moment I've only implemented the part for unpacking, other parts
will also use progress callbacks.
--HG--
branch : progress_callback
2011-01-21 17:16:58 +01:00
Juan RP
ab857595d7
Check that return value of snprintf(3) is not negative, rather than only -1.
2011-01-21 00:32:46 +01:00
Juan RP
84b578b0e4
libxbps: modify xbps_get_binpkg_repo_uri() to accept repository URL as 2nd arg.
2011-01-20 16:41:49 +01:00
Juan RP
6f8b2ca33a
libxbps: simplify how configuration files are handled, use cached values if possible.
2011-01-20 02:55:40 +01:00
Juan RP
274c8c432b
lib/Makefile: build libxbps with --export-dynamic.
2011-01-19 14:31:30 +01:00
Juan RP
efea94bec6
Fixed API documentation comments for doxygen.
2011-01-19 00:31:22 +01:00
Juan RP
2adaf610e7
libxbps: xbps_yesno/noyes() are only used in xbps-bin(8), remove from API.
2011-01-18 23:45:12 +01:00
Juan RP
992e8c6a14
libxbps::xbps_humanize_number(): use common values and hide implementation details from API.
...
So now its prototype is the following:
int xbps_humanize_number(char *buf, int64_t bytes)
It is a wrapper around NetBSD's humanize_number(3) which uses 6 digits for max
length, HN_AUTOSCALE and HN_NOSPACE|HN_DECIMAL. All users have been updated.
2011-01-18 23:10:07 +01:00
Juan RP
e2b55c90be
regpkgdb_dictionary.c: bump copyright year for previous changes.
2011-01-18 20:21:35 +01:00
Juan RP
9180bfce23
libxbps: regpkgdb: use a mutex for {inc,dec}rementing the refcnt.
2011-01-18 20:18:27 +01:00
Juan RP
fe15380e1b
libxbps: modify the API, new func xbps_get_binpkg_repo_uri().
...
This function replaces xbps_repository_get_path_from_pkg_dict() and
xbps_get_binpkg_local_path(). It takes a pkg dictionary as returned
by a repository pkg index or a transaction dictionary and returns
a string with the full path to the binary pkg, either in local
repos, cachedir or remote repos.
Update all code to use this function... sorry I broke ABI compatiblity.
2011-01-18 18:21:55 +01:00
Juan RP
6d7121c5bd
xbps_repository_get_pkg_plist_dict: use xbps_repository_pool_find_pkg().
2011-01-18 15:19:27 +01:00
Juan RP
503afdd48d
libxbps: extend the API, new func: xbps_repository_pool_find_pkg.
...
prop_dictionary_t xbps_repository_pool_find_pkg(const char *pkg, bool bypattern, bool best)
This function iterates over the repository pool and returns a pkg
dictionary matching its pkgname if "bypattern" is false, otherwise
if "pkg" matches the pkgdep pattern. If "best" is true, it will look
in all repos and will return the newer version, otherwise the first one
that matches the arguments specified.
With this addition supporting many small registered repos is cheap, because
it checks by-package rather than by-package-list. This also helped to removed
some duplicated code and fix some rare bugs.
Bump XBPS_RELVER to 20110118.
2011-01-18 14:44:39 +01:00
Juan RP
1125963da8
libxbps: simplify the algorithm for sorting deps in the transaction.
...
Rather than using a SIMPLEQ to copy the package dictionary and later on
adding all items into the sorted array, just add the pkg dictionary
into the sorted array directly and removing it from the unsorted array.
This reduces memory usage and greatly sorts all packages that aren't
installed automatically in the correct order in the transaction.
Also added a large comment explaining how the algorithm works and
what it is supposed to do and when.
2011-01-17 17:17:02 +01:00
Juan RP
3c4b375ecf
Fixed a test in config file handling that made all conf_files not properly detected.
2011-01-16 16:55:01 +01:00
Juan RP
de590b8457
lib/Makefile: build -Wno-error for included libfetch for now.
2011-01-15 13:37:16 +01:00
Juan RP
6051eb29ab
Added another bunch of compiler warnings and fix code.
2011-01-15 11:59:44 +01:00
Juan RP
d9001adbad
configure: added --silent option to hide compilation details.
2011-01-15 10:49:35 +01:00
Juan RP
33c1a33912
Make configure detect required libraries to link.
2011-01-14 00:30:49 +01:00
Juan RP
57af8f9ee0
xbps_repository_get_pkg_plist_dict: avoid uninitialized var.
2011-01-12 17:15:23 +01:00
Juan RP
2206b27037
Added "--with-external-libfetch" to build against external libfetch.
2011-01-12 17:06:53 +01:00
Juan RP
d307226ee7
xbps_unpack_binary_pkg: fix a memleak and make all error paths go to a single point.
2010-12-25 02:38:30 +01:00
Juan RP
71878669da
libxbps: fix a memleak when removing obsolete files in pkg upgrades.
2010-12-25 02:37:25 +01:00
Juan RP
f9d0a639f2
xbps_repository_pool_init: don't loop forever if repo pkg-index.plist files cannot be internalized.
2010-12-19 17:46:32 +01:00
Juan RP
bc28aa77d8
xbps_fetch_file: set a 30seconds timeout.
2010-12-18 10:19:09 +01:00
Juan RP
d2f5535162
lib/plist: no need to check against NULL if prop_object_type() is used.
2010-12-03 06:36:05 +01:00
Juan RP
d2be842ce5
Fix and improve when there are missing deps in the transaction dictionary.
2010-11-23 23:17:04 +01:00
Juan RP
99f3d846de
xbps_purge_pkg: if state is not XBPS_PKG_STATE_CONFIG_FILES, just return 0.
2010-11-21 14:34:49 +01:00
Juan RP
fdec663855
API clean up (part 2), plus misc changes and improvements.
...
- Rename regpkgs_dictionary to regpkgdb_dictionary to better describe what is is.
- Change some funcs in plist.c to return a boolean rather than int.
- Hide more internal funcs off the API.
- Simplify xbps_repository_update_pkg() and remove its second arg.
- Hide implementation details in xbps_repository_pool, now to iterate over the
pool you have to use xbps_repository_pool_foreach and its struct
repository_pool_index.
- Introduce xbps_{init,end}, to initialize/destroy some stuff in the library.
- Introduce xbps_dbg_printf to printf stuff for debugging purposes.
- xbps-{bin,repo}: added -d arg to enable debugging output.
- Before checking if a config file needs to be installed or such, check that
package contains the "conf_files" array.
- Remove obsolete dirs as well while updating packages.
- If transaction dictionary is ready remove the "missing_deps" array.
Bump XBPS_RELVER to 20101118.
--HG--
rename : lib/regpkgs_dictionary.c => lib/regpkgdb_dictionary.c
2010-11-19 13:40:13 +01:00
Juan RP
ffc255b715
Starting to clean up the public API, move private stuff into xbps_api_impl.h.
2010-11-13 03:18:58 +01:00
Juan RP
3b931475c0
Make xbps_read_dict_from_archive_entry() private to libxbps, as it's only used internally.
2010-11-10 15:08:21 +01:00
Juan RP
175b1abf8f
xbps_purge_all_pkgs: no need to check for pkg state because xbps_purge_pkg() does it too.
2010-11-08 12:20:44 +01:00
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