Commit Graph

52 Commits

Author SHA1 Message Date
Duncan Overbruck
44cd938115
Revert "Use shared LICENSE file for all xbps code."
This reverts commit be7d8cfaf1.

This commit missed some previous copyrights mentioned,
in general I think its better to have this per-file to
follow who wrote what and when.
2020-04-29 14:12:10 +02:00
Juan RP
be7d8cfaf1
Use shared LICENSE file for all xbps code. 2020-04-24 11:44:19 +02:00
Juan RP
530e79c7ee
Fix warnings detected by LTO. 2020-04-23 08:32:54 +02:00
Juan RP
c8d676f10e xbps_find_pkg_orphans: fix for #234
Make sure "automatic" bool is initialized to false before
checking its value. This way if xbps_dictionary_get_bool()
fails, "automatic" will be set to false.

Closes #234
2020-02-22 00:00:22 +01:00
Juan RP
06c9891ae3 xbps_transaction_*: multiple performance improvements (v2).
This commit implements multiple performance improvements
to the transaction code:

- Don't process xbps_pkg_name() N times each time we access
  its package dictionary (via pkgdb or rpool), just do it once
  at xbps_pkgdb_init() time. At pkgdb init time, it just creates
  a property in pkgdb, "pkgname". At rpool time, each time a
  package is accessed, the "pkgname" string property is added.

- The package transaction dictionary contains the "transaction"
  object to know what's the pkg type. This has been changed to an
  uint8, this simplifies the logic and it's faster than checking
  a string object. See xbps_trans_type_t and xbps_transaction_pkg_type().

- Fixed the issue that was marked with XXX in transaction shlibs
  checking code. This has been fixed and improved and resources are
  now just freed as expected.

- Simplified random code all over the place, avoiding unnecessary
  allocations or operations.

- Rename some transaction files to have a better description.

This is my first rototill to the code in 2020.
2020-02-21 09:37:32 +01:00
Juan RP
8a0c3032b7
xbps_find_pkg_orphans: improvements.
While checking for orphans in automatic mode (xbps-query -O,
xbps-remove -o) there's no need to generate a fulldeptree...
instead we need to iterate against pkgdb until no more orphans
are found.

See https://github.com/void-linux/xbps/issues/156#issuecomment-578473222

Also add some debugging that helped me to catch the issue
easily.

Closes #156
2020-01-26 07:40:25 +01:00
Duncaen
b60054267b lib/package_orphans.c: the argument is not UNUSED 2019-07-02 09:48:05 +02:00
Juan RP
0677678387 Added LTO support and fix warnings (maybe-uninitialized). 2019-06-27 18:09:26 +02:00
Juan RP
a9a889c54d fulldeptree: return a proper error if deps can't be resolved.
xbps_get_pkg_fulldeptree() now returns NULL and sets errno to ENODEV
when there are missing dependencies, rather than assert()ing.

Added another test case to check returned error codes.

Signed-off-by: Juan RP <xtraeme@gmail.com>
2019-06-15 18:04:20 +02:00
Foxlet
0f33859701 Fix namespace violation 2018-09-25 22:11:30 -04:00
Juan RP
c5d6556c50 xbps-remove: fix #95 (xbps-remove -R pkg lists/removes orphans) 2015-05-06 17:21:13 +02:00
Juan RP
1f6a5c0e47 libxbps: detection of orphaned packages is now 66% faster. 2015-01-10 05:43:35 +01:00
Juan RP
c9514ad617 libxbps: fixed replaces/replace_vpkg test case. 2014-09-14 12:50:17 +02:00
Juan RP
e4ff957e42 xbps_find_pkg_orphans: fix regression adding false positives. 2014-09-11 09:05:57 +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
2d5a8dee19 xbps_find_pkg_orphans: minor optimizations. 2013-12-08 08:06:28 +01:00
Juan RP
192ffa2d58 Update API documentation and dot files. 2013-09-25 11:15:04 +02:00
Juan RP
4057e4961c Use C99 for loop initializers.
That means that a C99 compiler is now mandatory.
2013-09-15 10:06:49 +02:00
Juan RP
a039330f3c Misc cleanups: use __attribute__((__unused__)); remove dead code. 2013-08-29 10:45:30 +02:00
Juan RP
11fbffa241 Fix #14 from github (Removing recursively does not respect manual installation mode for dependencies). 2013-08-17 09:50:19 +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
a92863cb62 xbps_find_pkg_orphans: remove workaround for target pkgs; ignore unknown pkgs. 2013-03-11 12:13:42 +01:00
Juan RP
f9fc39fcdc Repair xbps_find_pkg_orphans() after pkgdb 0.21 format switch.
The problem was that pkgdb is now a dictionary, thus this contains
an unordered set of objects, therefore we cannot depend in the order
anymore.
2013-03-09 09:56:36 +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
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
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
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
7289547432 Welcome "repository index format 1.5". See NEWS for information. 2012-05-31 16:29:56 +02: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
6057bd83b3 Update pkgdb dot file with latest changes. 2012-01-20 11:16:07 +01:00
Juan RP
6940505de9 regpkgdb rototill: renamed to pkgdb, improve the public API. 2012-01-20 11:10:52 +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
b232ca1815 libxbps: cache regpkgdb just when it's needed not via xbps_init(). 2011-12-22 12:56:56 +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
508f119bc9 Moved install transaction code to libxbps, see NEWS file. 2011-07-27 17:13:54 +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
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
2c644c6587 Treat pkgs with NULL or empty requiredby arrays as orphans. 2011-02-26 11:08:58 +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
de034c28f5 xbps_find_pkg_orphans: simplify even more. 2011-01-29 18:34:50 +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
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
efea94bec6 Fixed API documentation comments for doxygen. 2011-01-19 00:31:22 +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