Commit Graph

114 Commits

Author SHA1 Message Date
Juan RP
8263449f94 xbps_end: don't bother releasing everything; pkgdb is enough.
xbps-query -L now: 115ms
xbps-query -L before: 148ms

Fuck you valgrind!
2015-01-14 18:43:17 +01:00
Juan RP
ee175a2a68 Improve xbps_end() and use it before exit(3)ing.
- Simplify xbps_repo_open::repo_get_dict().
- Use xbps_end() in the utils where necessary.
- Make xbps_end() call xbps_pkgdb_unlock() if necessary.
- Make xbps_end() release rpool resources.
- Make xbps_end() release resources from xbps_handle.
- Fixed 90% of reported leaks (still reachable at exit) from valgrind.

That was to silence valgrind's memcheck with --leak-check=full.
2015-01-10 19:11:31 +01:00
Juan RP
b09faadebc xbps-{install,query}: --repository now accepts relative paths in local repos. 2015-01-10 11:59:31 +01:00
Juan RP
16d2640df8 Files in the configuration directory have preference. 2014-12-09 12:05:18 +01:00
Juan RP
89d11e871f xbps-{install,query}: added -i to ignore repos defined in xbps.d.
See the NEWS file for more information.
2014-11-21 10:56:41 +01:00
Juan RP
428a747fad Fix #69 (No way to set globally a custom architecture)
The "architecture" configuration keyword is now available to override
the native machine architecture returned by (uname(2)).

The XBPS_ARCH environment variable still has preference.
2014-11-19 11:36:09 +01:00
Juan RP
04bde70969 xbps_init: print bestmatching value. 2014-11-07 10:18:01 +01:00
Juan RP
53f13d579e Added the "bestmatching" configuration keyword to enable pkg best matching.
See the NEWS file for more information.
2014-11-07 10:07:51 +01:00
Juan RP
5b522109f7 Replaced config/system {repo,preserve,virtualpkg}.d with a single directory.
See the NEWS file for more information.
2014-11-06 09:58:04 +01:00
Juan RP
9566a0e737 Re-add support for system virtualpkg.d (XBPS_SYS_VPKG_PATH).
This is still useful to set distro defaults for virtual packages, with
the option to override them via /etc/xbps/virtualpkg.d.
2014-11-05 09:40:32 +01:00
Juan RP
595136704e Get rid of system virtualpkg.d support (<prefix>/share/xbps/virtualpkg.d).
Binary packages do not need to provide those virtualpkg configuration files
anymore; all vpkg info is now collected from pkgdb.
2014-11-04 11:17:27 +01:00
Juan RP
a730a61df9 lib/initend.c: CID 62720 (NULL pointer dereference) 2014-10-07 07:59:07 +02:00
Juan RP
8ccb48e65b lib/initend.c: CID 62697 (dereference before NULL check) 2014-10-05 12:55:07 +02:00
Juan RP
bc9ddcfcc8 lib/initend.c: rename a var to make gcc-4.6.x happy. 2014-10-04 22:02:56 +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
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
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
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
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
dacbb2f22f Fixed some warnings reported by clang. 2014-04-20 10:02:54 +02:00
Juan RP
51bdbe41ac lib/initend.c: ignore -Wformat-nonliteral with clang. 2014-03-11 09:28:50 +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
Juan RP
f74bf1c1c8 New custom configuration file format that does not need confuse. 2014-02-25 16:42:52 +01:00
Juan RP
804a39c63b Added XBPS_ARCH environment var to override uname(2) machine result. 2014-01-09 11:41:25 +01:00
Juan RP
ae81cd1ea9 lib/initend.c: define _BSD_SOURCE for strlcpy() with musl. 2014-01-07 21:20:42 +01:00
Juan RP
ec0d38c469 Implement per pkg RSA signatures and on-demand repository access. 2013-12-24 10:43:55 +01:00
Juan RP
2a21354a1c Make some reorganization in struct xbps_handle.
The variables to set cachedir, rootdir and metadir have been
changed to "array of chars", this way there are no extra allocations.

Update clients accordingly and bump API version.
2013-12-16 11:46:39 +01:00
Juan RP
4403caa434 Add repos set in xbps_handle::repositories to the top of the list.
That means that now xbps-install(8) and xbps-query(8) --repository
option does not override the repository list of a configuration file.
2013-12-04 16:59:15 +01:00
Juan RP
8882b0215f Redo how the repository keys are stored.
- Repository keys are now stored in a new directory on metadir (/var/db/xbps):

	<metadir>/key>

- Repository keys are stored with the hex fingerprint of its RSA
  public key in a plist dictionary:

	<metadir>/keys/xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.plist

- Drop xbps-rkeys(8) and merge its functionality into xbps-install(8) and
  xbps-query(8).

- xbps-query(8) -vL now shows some more details of remote repositories:

 3134 http://localhost:8000 (RSA signed, verified)
      Signed-by: Void Linux
      4096 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d
   16 http://localhost:8000/nonfree (RSA signed, verified)
      Signed-by: Void Linux
      4096 60:ae:0c:d6:f0:95:17:80:bc:93:46:7a:89:af:a3:2d

Bump XBPS_API_VERSION.
2013-11-18 16:05:46 +01:00
Juan RP
a5ecaa493f New utility: xbps-rkeys(8) to manage RSA public keys. 2013-10-09 10:13:07 +02:00
Juan RP
5e1432f418 Added support to specify multiple repositories via cmdline (close #17). 2013-09-18 16:45:05 +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
776b94e6bc Remove PackagesOnHold from xbps.conf; use xbps-pkgdb -m hold|unhold instead.
To put a package on hold mode:
	$ xbps-pkgdb -m hold foo

To unhold the package:
	$ xbps-pkgdb -m unhold foo

To list packages on hold mode:
	$ xbps-query -H

This also close #12 from github.
2013-08-12 14:46:54 +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
2c03e1c9a8 Read virtual pkg config files only when it's necessary. 2013-06-14 10:00:33 +02:00
Juan RP
5fd7565e6c xbps-install(8): -R now overrides the repository list set in a configuration file.
Now -R can be used independently if a configuration file exists or not.
2013-04-18 18:17:14 +02:00
Juan RP
dc900353e4 lib/initend.c: xbps_end: remove bogus assignment. 2013-04-04 10:07:19 +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