Commit Graph

86 Commits

Author SHA1 Message Date
Juan RP
c9825feb29 util.c: add stricter checks for pkgver conformance (v2).
There was another case where it now was failing: "fs-utils-v1.00_1".

Previous code didn't take into account that a valid version might also
contain a non digit after '-'.

Added more tests to the testsuite to verify its correctness.
2013-11-17 12:25:02 +01:00
Juan RP
c44d7070a4 util.c: add stricter checks for pkgver conformance.
Make xbps_pkg_{name,version} return NULL if next character
after the last '-' character is not a digit, and if there's a digit
make sure that there exists a '_' character too.

Added more tests to the testsuite to catch this. With these changes
'python-e_dbus' is properly detected and validated.
2013-11-17 11:34:14 +01:00
Juan RP
53ecaf9819 Remove xbps_print_hexfp() from API and move it xbps-rindex, where it belongs. 2013-11-08 09:12:29 +01:00
Juan RP
c69134f851 xbps_repository_is_remote: optimize and check for http:// first. 2013-10-07 09:23:25 +02:00
Juan RP
8d5c48b861 Added support for the long awaited feature: RSA signed repositories. 2013-10-05 11:38:04 +02:00
Juan RP
42c0766c00 Get rid of libfetch and proplib external dependencies.
The list of required external deps is now confuse, libarchive and openssl.

libxbps now includes a wrapper for proplib prefixed with xbps_ rather than prop_.
2013-06-20 10:26:12 +02:00
Juan RP
9d80524a34 Minor optimization: no need to check if obj is NULL, prop_object_type() does that already. 2013-06-14 12:22:29 +02:00
Juan RP
db1efb3aa6 Relax memory requirements on 64bit platforms; fix two memleaks. 2013-06-12 10:04:10 +02:00
Juan RP
99be698979 Use a single file to store repository data.
This is just the starting point to extend repositories with PGP signatures.
2013-06-10 10:28:39 +02:00
Juan RP
5eddf04898 Ignore executing install/remove scripts if XBPS_TARGET_ARCH is set.
Instead a two stage approach is necessary when packages for target arch
are installed:

	- XBPS_TARGET_ARCH=arch xbps-install foo <- only unpack
	- xbps-reconfigure -a <- configure natively or via an emulator
2013-03-07 18:08:12 +01:00
Juan RP
7c1a0ac3e8 New pkgdb (0.21) and repo index (1.7) format, see NEWS for info. 2013-03-05 04:08:42 +01:00
Juan RP
ea2f2c7297 Silence -Wformat-nonliteral warning with clang. 2013-01-04 10:35:00 +01:00
Juan RP
1d42986b75 libxbps: finish support for rindex 1.6. 2012-12-07 17:11:52 +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
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
d6735d5685 xbps_xasprintf: do not return NULL anymore; remove checks for this. 2012-11-11 09:37:27 +01: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
f7a5c55bc7 libxbps: xbps_pkg_arch_match: fix conditional tests. 2012-07-21 21:49:37 +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
c24ce8e4da libxbps: use memcpy in critical paths for performance, fixed some memleaks. 2012-06-18 10:43:05 +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
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
c37026d4c6 libxbps: require an underscore in strings to detect correctly pkgname/version. 2012-06-05 10:58:39 +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
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
9bada162a1 New "metadir" member in xbps_handle to override default metadata dir. 2012-03-13 10:22:35 +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
5a892023f4 Be a bit more paranoid by checking allocs and expected types. 2011-12-22 08:23:11 +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
b0ceeaa58e New configuration file via confuse: xbps.conf. 2011-12-15 11:19:20 +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
bbd83767c6 libxbps: missing arg in printf format for xbps_pkg_index_plist. 2011-11-11 00:10:35 +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
662b5acc08 Implemented "New repository scheme and configuration file" from issue 16. 2011-11-07 20:28:35 +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
c6636d1b79 libxbps: xbps_pkgpattern_xxx extend set of chars to be detected. 2011-10-24 10:03:45 +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
9fb3c38aa2 Extend assertions by checking passed in proplib type. 2011-10-19 16:53:38 +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
508f119bc9 Moved install transaction code to libxbps, see NEWS file. 2011-07-27 17:13:54 +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
5dfe493a88 xbps_check_is_installed_pkg_by_name: also check for virtual pkgs. 2011-07-17 01:43:56 +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
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
0bc77f86fa xbps_pkg_epoch is not supported anymore with NetBSD's dewey. 2011-06-14 11:26:00 +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
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
d9eb0341cd Some dead stores and build fixes reported by LLVM 2.9. 2011-04-07 12:24:20 +02:00