Juan RP
8ad8bca958
xbps_rpool_foreach: take into account xbps_repo_open returning NULL.
2014-09-07 09:35:38 +02:00
Juan RP
5863ec17fe
libxbps: two new functions to get the pkgver and arch components in a filename.
...
- xbps_binpkg_pkgver() returns a heap allocated string with the pkgver component.
- xbps_binpkg_arch() returns a heap allocated string with the architecture component.
A basename, full path or relative path is supported, i.e:
/path/to/foo-1.0_1.x86_64.xbps
../../foo/blah-0.1_1.x86_64.xbps
baz-0.1_1.x86_64.xbps
2014-09-05 20:59:00 +02:00
Juan RP
e2470f8697
xbps_entry_install_conf_file: add more assertions.
2014-09-05 20:58:20 +02:00
Juan RP
685a85a466
xbps_find_pkg_orphans: also take into account virtual pkgs.
2014-09-05 13:10:50 +02:00
Juan RP
bf92d1f5a3
xbps_repo_open: open archive read-only if lock is not set.
2014-09-05 12:39:53 +02:00
Juan RP
013731c502
Acquire/release a POSIX file lock on repository archives.
...
- xbps_repo_open() accepts a third argument (bool) to acquire a POSIX file
lock on the repository archive.
- xbps_repo_close() accepts a second argument (bool) to release a POSIX file
lock on the repository archive.
This avoids the issue of multiple xbps-rindex(8) processes being blocked
even for different repositories on the same architecture, resulting in
unnecessary contention.
2014-09-05 12:26:42 +02:00
Juan RP
472f622f6f
Finally fixed vpkg02 test (vpkg provider in transaction).
...
Rather than collecting dependencies for a pkg that has been added to the
transaction dictionary, do this for all pkgs in transaction once all
packages are already there.
2014-09-04 10:13:02 +02:00
Juan RP
25e8002737
fetch: hardcode HTTPS port and fallback to /etc/services for other unknown ports.
2014-08-25 16:07:47 +02:00
Juan RP
5a1919e520
xbps_pkg_is_installed(): a pkg in "unpacked" state is now accepted as installed too.
...
The reason is that even if the pkg was not configured, it should still be accepted
as installed. If installing packages via XBPS_TARGET_ARCH, pkgs are never configured,
so this must be taken into account.
Will be cherry-picked to 0.37 meanwhile.
2014-08-23 15:54:24 +02:00
Juan RP
7cef93ce07
Added support to replace vpkgs when the real pkgname matches any installed vpkg.
2014-08-22 12:44:18 +02:00
Juan RP
3cc8929ce1
xbps_get_pkg_plist_from_binpkg: fix a double free, found by Gottox.
...
xbps-query -Rf foo without network was enough to trigger it.
2014-08-19 10:45:46 +02:00
Juan RP
fbf4ed4d2a
lib/download.c: unconstify to fix a warning.
2014-08-13 22:11:25 +02:00
Juan RP
431674d733
lib/download.c: style twerks.
2014-08-13 21:49:44 +02:00
Enno Boland
8a992372ed
lib/repo_sync.c: use xbps_fetch_delta instead of xbps_fetch_file
2014-08-11 20:01:24 +02:00
Enno Boland
b0c090c39e
lib/download.c: delete vcdiffs after applying; cleanups.
2014-08-11 20:00:20 +02:00
Enno Boland
6a8f5d6235
lib/download.c: debug output for binary diffs
2014-08-11 19:24:02 +02:00
Enno Boland
f0f8534273
lib/download.c: use tempfile while decoding new file from binary diff.
...
this prevents corrupted files when filename == basefile.
2014-08-11 19:05:23 +02:00
Enno Boland
040e114ad4
lib/download.c: add basic support for vcdiffs
2014-08-11 18:40:44 +02:00
Juan RP
df93e790a6
xbps_init: performance: do not chdir() unnecessarily for each conf file.
2014-08-01 15:30:43 +02:00
Juan RP
f8d8f91a08
Implement support to "preserve" existent on-disk files.
...
See NEWS for more information. Fix #51
2014-08-01 15:09:51 +02:00
Juan RP
fa960c2425
xbps_init: print XBPS_RELVER in debug output.
2014-08-01 10:16:33 +02:00
Juan RP
04c7647492
lib/package_unpack.c: fix a typo that made modified files to not be unpacked.
2014-07-30 18:50:43 +02:00
Juan RP
cc6f9901f1
Fix #50 (Existent files on disk might be overwritten by packages with conf_files).
2014-07-30 16:18:57 +02:00
Juan RP
e92e86c2db
Share code to show pre-remove/post-install msgs.
2014-07-27 17:39:24 +02:00
Juan RP
a28046332f
Implemented support for pre-remove and post-install messages.
...
Close #44
2014-07-27 11:24:49 +02:00
Juan RP
0a7ea3250a
lib/transaction_dictionary.c: fix rootdir free size on 32bit systems.
2014-07-18 12:44:32 +02:00
Juan RP
607f01b2f5
If statvfs() fails don't consider this a critical error; compute free space correctly.
2014-07-14 10:09:34 +02:00
Juan RP
26fca48da2
xbps-install(8): added support to list pkgs that will be downloaded from remote repos.
2014-07-14 09:30:28 +02:00
Juan RP
4356b6fd65
Abort transaction if there's not enough free space on disk.
...
Close #7 .
2014-07-13 11:45:04 +02:00
Juan RP
79fe312302
Gather proper transaction stats (take into account binpkgs in cachedir, and "preserved" pkgs).
2014-07-13 09:56:06 +02:00
Juan RP
20e5b07b8b
lib/package_conflicts.c: do not add dups unnecessarily.
2014-07-13 09:34:19 +02:00
Juan RP
d4f82b24f9
lib/repo_pkgdeps.c: conflicts are checked via xbps_transaction_prepare() already.
2014-07-12 16:27:21 +02:00
Juan RP
e35d2e9415
Revert "lib/transaction_ops.c: also check conflicts for pkgs without rdeps."
...
This reverts commit e308097af5
.
package conflicts are checked in xbps_transaction_prepare() already.
2014-07-12 16:25:12 +02:00
Juan RP
e308097af5
lib/transaction_ops.c: also check conflicts for pkgs without rdeps.
2014-07-12 09:41:37 +02:00
Juan RP
b73fb67179
lib/repo_pkgdeps.c: print what dep has been added from repos (debug).
2014-07-12 09:40:07 +02:00
Juan RP
0385812a5a
transaction_sort: if curdep == curpkg don't do any sorting, it's sorted already.
2014-07-06 09:32:06 +02:00
Juan RP
b63cc62e3d
lib/package_unpack.c: add some comments.
2014-07-02 11:30:41 +02:00
Juan RP
e60677116d
Fix #43 (xbps-install: unhelpful message for invalid dependency)
...
If a package that is going to be installed or updated contains invalid
dependencies return ENXIO and XBPS_STATE_INVALID_DEP xbps state to clients.
This improves the error messages returned to the clients when such
condition happens.
2014-07-02 10:59:25 +02:00
Juan RP
21f32a75c5
Fixed a new issue with vpkgs replacing the same vpkg they are providing.
...
Added a new testcase to verify its correctness.
2014-07-01 15:35:55 +02:00
Juan RP
510c84d3bb
libfetch: synchronized with NetBSD's pkgsrc/libfetch, preserving our changes.
2014-06-29 10:29:36 +02:00
Juan RP
be1ef74ba2
libfetch: merge NetBSD's common.c 1.29 too to reduce differences and fix a warning.
2014-06-29 10:04:07 +02:00
Juan RP
7bb36ddaa2
libfetch: fetch_close: make sure conn->ssl is valid before shutting down.
2014-06-28 12:12:03 +02:00
Juan RP
633c20a2e6
libfetch: merge TLS SNI support from NetBSD with some other random changes.
...
Close GH #41
2014-06-28 12:01:00 +02:00
Juan RP
ae2fefeced
xbps_init: remove redundant dbg printf if xbps.conf cannot be read.
2014-06-04 10:49:39 +02:00
Juan RP
6bb61adb0e
Enable syslog logging by default; updated API to use xbps_handle::flags.
2014-06-04 09:39:02 +02:00
Juan RP
7f4753f50e
Process conf files in sys/conf foo.d dirs alphabetically.
2014-06-04 08:05:18 +02:00
Juan RP
776865b548
Added support for system/config virtualpkg.d directories.
...
The system virtualpkg directory set to <rootdir>/usr/share/xbps/virtualpkg.d contains
virtualpkg configuration files (.conf/.vpkg) that can be overrided by the admin
in <rootdir>/etc/xbps/virtualpkg.d bearing the same file name.
This obsoletes the "virtualpkgdir" keyword support from the xbps configuration file.
2014-05-31 07:05:57 +02:00
Juan RP
387987b146
Make system/config repo.d paths always relative to rootdir.
2014-05-31 06:44:07 +02:00
Juan RP
ec3323dcba
lib/package_config_files.c: simplify.
2014-05-31 06:00:33 +02:00
Juan RP
23fef46e9e
Implemented GH #39
...
The system repository directory set to <prefix>/share/xbps/repo.d contains
system repository configuration files (.conf) that can be overrided by the admin
in <sysconfdir>/xbps/repo.d bearing the same file name.
2014-05-30 11:48:10 +02:00
Juan RP
399a99753d
lib/initend.c: do not crash if the include keyword resolves to unexistent files.
2014-05-29 09:30:58 +02:00
Juan RP
19d36aaf04
portableproplib: use __attribute__((unused)) to fix a unused-but-set-variable warning.
2014-05-29 08:32:14 +02:00
Juan RP
61a1d33995
xbps-install(8): implemented single pkg updates without -u, --update.
...
The -u, --update is now only necessary to perform full system updates.
Close #35 (https://github.com/voidlinux/xbps/issues/35 )
2014-05-27 11:33:45 +02:00
Juan RP
18e0524287
libxbps: optimize rootdir access/creation by checking/creating it only once.
2014-05-27 10:02:01 +02:00
Juan RP
889e5d665e
Improve 869466278b
even more; it detects installs/updates correctly now.
2014-05-22 12:19:35 +02:00
Juan RP
ac5aa94e58
lib/package_config_files.c: avoid many small heap allocs and simplify.
2014-05-22 10:52:57 +02:00
Juan RP
0e7e2c0148
lib/package_remove.c: typo fix.
2014-05-22 10:49:01 +02:00
Juan RP
350852bf76
lib/package_remove.c: avoid many small heap allocs and simplify.
2014-05-22 10:42:27 +02:00
Juan RP
0f95cf4e46
lib/package_find_obsoletes.c: avoid many heap allocs and simplify.
2014-05-22 10:41:31 +02:00
Juan RP
ea234f095f
xbps_transaction_init: small memleaks found by valgrind.
2014-05-22 10:41:07 +02:00
Juan RP
d94995eb5a
Improve 869466278b
for non virtual packages.
...
If dependency is installed but does not satisfy the requirements, mark it
as an update and not install. The commit 869466278b
changed the logic
for virtual and non virtual packages.
2014-05-18 14:24:59 +02:00
Juan RP
cafbca06e7
Imported portableproplib-0.6.4.
2014-05-17 20:25:14 +02:00
Juan RP
a3f2898ea6
Explicitly set errno to ENOENT when a pkg hasn't been found in array/dictionaries.
2014-05-17 12:36:02 +02:00
Juan RP
869466278b
Fixed a new issue with virtual packages, as reported by Gottox.
2014-05-15 22:07:10 +02:00
Juan RP
f7d1ed6ae3
lib/initend.c: fix clang warning; no need to initialize partially glob_t.
2014-05-15 17:00:29 +02:00
Enno Boland
7485659687
libxbps: use strlcpy instead of strncpy
2014-05-13 11:58:51 +02:00
Enno Boland
295cfcea76
libxbps: insert space after conditionals
2014-05-13 11:44:49 +02:00
Enno Boland
152ec0354f
libxbps: file including in xbps.conf supports relative paths.
2014-05-13 11:37:09 +02:00
Juan RP
4070255529
pkgdb: added "repository-origin" obj to know its origin repository.
2014-05-11 10:03:17 +02:00
Juan RP
1e273bf575
lib/initend.c: move prototype to the correct place.
2014-05-06 10:21:44 +02:00
Juan RP
42a569b05c
lib/initend.c: add Enno Boland to copyright.
2014-05-06 09:29:26 +02:00
Enno Boland
e5d64d6319
lib/initend.c: include now supports file globbing.
2014-05-05 23:10:18 +02:00
Juan RP
96778da60c
libxbps: detect and fix pkgs that depend on itself.
2014-04-20 18:17:23 +02:00
Juan RP
bb491e2667
libxbps: detect and ignore incorrect deps of a pkg if those are virtual pkgs.
2014-04-20 16:54:50 +02:00
Juan RP
dacbb2f22f
Fixed some warnings reported by clang.
2014-04-20 10:02:54 +02:00
Juan RP
ada3483acc
lib/repo.c: fix two memleaks in error paths found by clang.
2014-04-19 16:07:29 +02:00
Juan RP
4bc6ba2b1c
lib/package_configure.c: fix use-after-free reported by clang.
2014-04-19 15:49:02 +02:00
Juan RP
4530c79bb2
Make sure that root symlinks in void are never removed or detected as obsoletes.
...
Added/improved test cases to detect those conditions work as expected.
2014-03-31 10:16:18 +02:00
Juan RP
d0a9bbb912
Fix #34 (make libfetch always add "Accept: */*" in the HTTP header).
2014-03-18 14:08:40 +01:00
Juan RP
d01d2edf5b
Optimize most common path when resolving package dependencies.
...
Before that change the code would do the following:
1- if dependency is installed, continue
2- if dependency is queued, continue
3- get dependency from repos
After that change the code does this:
1- if dependency is queued, continue
2- if dependency is installed, continue
3- get dependency from repos
So the dependency is checked if it has been queued as the first phase, which
seems to be the most common path in most cases.
2014-03-16 18:08:59 +01:00
Juan RP
cbbdc4c8bc
xbps_configure_pkg: try to use pkgname if possible to configure a pkg.
...
In pwwka's case for some reason the transaction was trying to configure
'man-pages-3.62_1' while in pkgdb there was only 'man-pages-3.55_1'.
By using the pkgname the pkg stored in pkgdb will be configured, without
caring what version it is.
2014-03-13 21:28:31 +01:00
Juan RP
56786ed315
xbps_remove_pkg: misc debugging tweaks.
2014-03-13 21:07:44 +01:00
Juan RP
67b5ba0dc3
xbps_transaction_commit: add some more debugging.
2014-03-13 20:49:54 +01:00
Juan RP
62888d3103
xbps_transaction_commit: add some debugging in error paths.
2014-03-13 20:35:26 +01:00
Juan RP
ef3b6278a6
Added support to pass native machine architecture to pkg scripts (6th arg).
2014-03-12 10:16:37 +01:00
Juan RP
51bdbe41ac
lib/initend.c: ignore -Wformat-nonliteral with clang.
2014-03-11 09:28:50 +01:00
Juan RP
ed4a33e4d0
xbps_pkgdb_init: initialize xhp->pkgdb_plist if it wasn't before.
2014-03-04 14:59:58 +01:00
Juan RP
0416b067d0
Use a POSIX lock for pkgdb and only issue pkgdb writes in exact points.
...
- Rather than using a POSIX named semaphore use a POSIX lock (lockf(3))
for pkgdb for writers. Writers that cannot acquire the pkgdb lock will
get EAGAIN rather then being blocked.
- Due to using a file lock we cannot write the pkgdb every time a package
is being unpacked, configured or removed. Instead pkgdb is only written
at the end of a specific point in the transaction (unpack, configure, remove)
or via xbps_pkgdb_unlock().
2014-03-04 14:37:10 +01:00
Enno Boland
59ee6b6733
Adding xbps_fetch_file_dest().
...
This function is similiar to xbps_fetch_file(). In contrast to xbps_fetch_file()
xbps_fetch_file_dest has an extra paramenter which allow to define an output file
for the request.
2014-03-04 14:19:52 +01:00
Juan RP
f20694a5bf
xbps_entry_install_conf_file: use archive_entry_copy to set new entry pathname.
2014-03-04 09:44:58 +01:00
Juan RP
9101241b20
Fix pkg symlink removal introduced in the two phase package removal feature.
2014-02-26 10:05:19 +01:00
Juan RP
8c47021ec3
Fix #31 and add new test case to reproduce it.
2014-02-25 22:55:39 +01:00
Juan RP
a511292316
lib/plist_find.c: do not return a false positive while matching vpkgs.
2014-02-25 18:43:33 +01:00
Juan RP
f74bf1c1c8
New custom configuration file format that does not need confuse.
2014-02-25 16:42:52 +01:00
Juan RP
1ad01b952a
xbps_transaction_commit: reset var value if binpkg/signature was downloaded successfully.
2014-02-24 11:35:28 +01:00
Juan RP
4d38311fbe
xbps_configure_pkg: show/return proper return value in an error path.
2014-02-23 10:32:21 +01:00
Juan RP
4d1cdcac0c
Fix concurrency issues in pkgdb: only allow 1 write transaction at the same time.
...
This implementation relies on a POSIX named semaphore, which is also
required by xbps-rindex(8).
2014-02-23 08:23:14 +01:00
Juan RP
187d635447
xbps_transaction_commit: return error if downloading binpkg/signature fails.
2014-02-23 08:15:32 +01:00
Juan RP
2fa0d56658
Fixed a xbps_pkgpattern_name() crash and a test to reproduce it (found by Gottox).
2014-02-15 01:26:42 +01:00
Juan RP
596a8c199f
Improve two phase pkg removal: do the check for all entry types.
2014-02-09 12:53:15 +01:00