Commit Graph

47 Commits

Author SHA1 Message Date
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
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
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
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
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
274c8c432b lib/Makefile: build libxbps with --export-dynamic. 2011-01-19 14:31:30 +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
2206b27037 Added "--with-external-libfetch" to build against external libfetch. 2011-01-12 17:06:53 +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
74500381ff lib/Makefile: remove dup values. 2010-11-04 03:48:23 +01:00
Juan RP
99d38bf176 Rename some files in the library to better describe what they do.
--HG--
rename : lib/config_files.c => lib/package_config_files.c
rename : lib/configure.c => lib/package_configure.c
rename : lib/orphans.c => lib/package_orphans.c
rename : lib/purge.c => lib/package_purge.c
rename : lib/register.c => lib/package_register.c
rename : lib/remove.c => lib/package_remove.c
rename : lib/remove_obsoletes.c => lib/package_remove_obsoletes.c
rename : lib/requiredby.c => lib/package_requiredby.c
rename : lib/state.c => lib/package_state.c
rename : lib/unpack.c => lib/package_unpack.c
2010-11-03 20:08:33 +01:00
Juan RP
9c60862e0f Pass LDFLAGS after the objects when creating the sharedlib, otherwise
-Wl,--as-needed will think that zlib is not needed.
2010-11-02 07:40:14 +01:00
Juan RP
8f20f4c0c6 libxbps: use OpenSSL SHA256, 5x faster xbps_get_file_hash() implementation.
* libxbps: improved xbps_get_file_hash() to mmap(2) rather than read(2)
  the file we have to process. With mmap'ed files the hash can be
  processed 5x faster than before, or even more in some cases.

* libxbps: switch to OpenSSL SHA256 implementation and remove the one
  previously used. It's faster and OpenSSL is required for libfetch so
  there is not point in using it.
2010-05-20 02:43:56 +02:00
Juan RP
f888b582f9 Added a configure script to emulate GNU autoconf and related changes.
Changes included in this set:

 * Added strlcat() and strlcpy() from OpenBSD, always use them if the
   system does not have them built in.
 * Changed an array of PATH_MAX size allocated in the stack, to a dynamically
   allocated buffer from heap. This should reduce memory usage a bit.
 * Simplify code that implemented a homegrown realpath(3) implementation,
   simply use realpath(3).
 * If compiler supports -fstack-protector, build all code with
   -D_FORTIFY_SOURCE=2 and --param ssp-buffer-size=1 so that all
   buffers are protected.
2010-05-19 22:38:27 +02:00
Juan RP
a79d7b5884 lib/Makefile: proplib sources need -Wno-stack-protector. 2010-05-11 13:37:21 +02:00
Juan RP
9fe20ccbc8 Also link libxbps to libpthread as it's required now. 2010-05-04 14:57:08 +02:00
Juan RP
9efe430e7c portableproplib can now be built with -Wextra and -Werror, but still needs
-Wno-cast-qual and -Wno-unused-parameter.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100421090458-gh2f2soq8jz25c3x
2010-04-21 11:04:58 +02:00
Juan RP
6256b34ccc Some changes that will appear in 0.5.0:
* Add proplib-0.4.1 source and use it in XBPS. This is to avoid
   an external dependency, so that we depend on the features of the
   internal library. This also means that proplib is not required anymore.

 * Added support to read/write gzip compressed plists by default, thanks
   to proplib-0.4 that gained new functionality.

That means that from now, XBPS will be able to write compressed gzip
plist files for all metadata related work. This will vastly reduce
bandwidth required for fetching remote repo's pkg index file and
binary packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100420122238-zcb85rudt9p34e10
2010-04-20 14:22:38 +02:00
Juan RP
a0b5e9e83a Rework Makefiles one more time.
- use printf to print commands rather than echo, which it may not have
  support for escape sequences (-e).
- Remove DESTDIR from SBINDIR, MANDIR, LIBDIR and INCLUDEDIR so that
  you can override it.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124125958-8mscedj5ntf288jd
2010-01-24 13:59:58 +01:00
Juan RP
c0b280c118 Mega-commit to document the API with doxygen.
Some changes were made to the API when making the documentation:

- A few exported functions are now hidden, because they were only used
  internally in the library.
- A few exported symbols were renamed to document them better than
  previously.
- Cosmetic changes all along the way, as well as some fixes here and there.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100121021019-onbsivlrhdb7t3ou
2010-01-21 03:10:19 +01:00
Juan RP
61d2ea8896 Rework Makefile files, fully parallel builds are now possible.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100118201826-q2zsyooicxi7lcfm
2010-01-18 21:18:26 +01:00
Juan RP
3d3c92dcbc Install shlib with 755 perms to match what the world does.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100113155721-c8fb2cg7jfu30mp8
2010-01-13 16:57:21 +01:00
Juan RP
ec907d0646 Restructure the Makefiles, INET6 and SSL support in libfetch is now
mandatory, build executables as PIE objects.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100106101556-tqzwk80xpp0iz20t
2010-01-06 11:15:56 +01:00
Juan RP
d55391e2e9 Cleaned up the Makefiles, improve README about what's required.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091228151958-ehx17nupq3uckhhg
2009-12-28 16:19:58 +01:00
Juan RP
e4cda0e9cc Rename lib/sync_remote_pkgidx.c to repository_sync_index.c.
xbps_sync_repository_pkg_index() renamed to xbps_repository_sync_pkg_index().

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

--HG--
rename : lib/depends.c => lib/repository_finddeps.c
rename : lib/findpkg.c => lib/repository_findpkg.c
extra : convert_revision : xtraeme%40gmail.com-20091130103814-25tr08vkc73cqutu
2009-11-30 11:38:14 +01:00
Juan RP
88ba635780 Split unpack.c config files and remove obsoletes code into its own files.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128044321-6kmhrrxggv2h681w
2009-11-28 05:43:21 +01:00
Juan RP
494504dbec Added support for a cachedir to store downloaded binpkgs.
libxbps:
 * Added xbps_set_cachedir() and xbps_get_cachedir(). By default it's
   set to /var/cache/xbps if not specified and it's always relative
   to the root directory.
 * Move mkpath() code from sync_remote_pkgidc.c into its own file mkpath.c
   to use it in another parts of the code.
 * Added xbps_get_binpkg_local_path(), that returns the local path to
   a binary package file, stored in cachedir or local repo.
 * Remote pkg index files are now stored directly in metadir/repodir,
   skipping the arch directory because binpkgs are now in cachedir.

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

Bump XBPS_RELVER to 20091128.

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

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

Bump XBPS_RELVER to 20091126.

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

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

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091125020936-7uf2ncrf1692c5hz
2009-11-25 02:09:36 +00:00
Juan RP
db9ae90dd4 Improve make output similar to what recent GNU configure scripts do.
Also always build the static bins so that it's done in one pass,
that means that objects are PIC and built with SSP.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091119050337-hkdksjqxy9n7vy7m
2009-11-19 06:03:37 +01:00
Juan RP
e8d947e15b Reorganize the Makefiles so that parallel build is possible.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091118090545-wpvgwmnqyh77sgz8
2009-11-18 10:05:45 +01:00
Juan RP
adbd3d727c Added support for shell (and csh as well) patterns for required
dependencies, as specified in blueprint "improved-version-matching".

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

Code lifted from FreeBSD, thanks! :-)

Change XBPS_RELVER to 20091107 to match latest additions.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091107035620-3051wcwrirqn2g14
2009-11-07 04:56:20 +01:00
Juan RP
10f2bef7cb Bah, fix these stupid make targets.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030163209-td7vxbq5vkxva5zc
2009-10-30 17:32:09 +01:00
Juan RP
5b6724b550 Fix up some issues for building shared/static bins.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030162345-2so2ejfvvqr29s7v
2009-10-30 17:23:45 +01:00
Juan RP
4aeea194e3 lib/Makefile: don't forget to install the static lib.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030112231-h1onlwabxst3am0h
2009-10-30 12:22:31 +01:00
Juan RP
3905c2106c Properly build shared/static libxbps and utils.
xbps-fetch: added -v flag to see verbose messages in libfetch.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091030111726-axf9paz2k01ntqzz
2009-10-30 12:17:26 +01:00
Juan RP
ac897c8383 libxbps: move remote repo pkg-index sync code into its own file.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027034000-rsg33sjonqsu0d5t
2009-10-27 04:40:00 +01:00
Juan RP
7aebea684b Implemented support for working with remote repositories.
libfetch from NetBSD's pkgsrc has been imported into lib/fetch, but
the objects are embedded into libxbps. Only a public function to fetch
files has been implemented: xbps_fetch_file().

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

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

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091027004600-0lq9aao67lisbzxv
2009-10-27 01:46:00 +01:00
Juan RP
c72f3a1a3c Remove xbps-src and its associated code. This is required for the
upcoming 0.3 version.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091018091539-4f7ynscyvsqt3st4
2009-10-18 11:15:39 +02:00
Juan RP
4aac305105 Add some PHONYs to the install target in Makefiles.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20090821091758-6am9fbkvy9doooef
2009-08-21 11:17:58 +02:00
juan
3f3b6d00dd Initial import of xbps with code as August '09.
--HG--
extra : convert_revision : juan%40xbps-20090817170720-amxxac4a2e8bza1j
2009-08-17 19:07:20 +02:00