Commit Graph

128 Commits

Author SHA1 Message Date
Juan RP
920db08f5c lib/remove.c: bump copyright year for previous change.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125072838-shechb5lff4y3zyk
2010-01-25 08:28:38 +01:00
Juan RP
1c4d43306a xbps-bin(8): if -f is set, remove files and configuration files even
if its hash doesn't match for the remove and purge targets respectively.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125070948-841kw2r4knz2793e
2010-01-25 08:09:48 +01:00
Juan RP
17d87b3559 Repair upgrades of preserve packages, i.e kernel.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125052754-6xri8lfmykhof5dz
2010-01-25 06:27:54 +01:00
Juan RP
0ebff2c636 lib/plist.c: fix an assertion.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125011444-xzvixcod832ione4
2010-01-25 02:14:44 +01:00
Juan RP
088baa7699 Add defs for default fetch cache connection limits and use them in
xbps_fetch_cache_connection() if 0 is passed as argument.

xbps-bin: enable fetch cached connection when downloading binpkgs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124153156-4updprik11nwi7c1
2010-01-24 16:31:56 +01:00
Juan RP
801785cbab Add xbps_fetch_set_cache_connection() to set libfetch's cache connection limits.
Use it in xbps_fetch_file(), by default set with 8 and 16.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124144829-hqsr2bl6uflf0nhu
2010-01-24 15:48:29 +01:00
Juan RP
03e8fa53d9 Merge libfetch-2.30 from NetBSD's pkgsrc.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124144753-ni487x8m7r05847b
2010-01-24 15:47:53 +01: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
49134b3e62 xbps_find_orphan_packages: improve doxygen documentation.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100123052934-bq05edsd09x3pgds
2010-01-23 06:29:34 +01:00
Juan RP
97266fa921 lib/unpack.c: improve doxygen description.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100123051605-ojcxt8uz91hg1h4k
2010-01-23 06:16:05 +01:00
Juan RP
823fe6d67c Don't export xbps_get_remote_repo_string() to the API, it's only
used internally in the library.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100123051334-8ndutg9gqfljff3p
2010-01-23 06:13:34 +01:00
Juan RP
31f821669f Add infrastructure changes to build the API documentation.
doxygen and graphviz are required. It's disabled by default, use
the BUILD_API_DOCS make(1) argument to enable it.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100123013719-pkk3a3823cx09v8l
2010-01-23 02:37:19 +01:00
Juan RP
dac80a3fa2 libxbps: improve doxygen documentation, still not finished.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100122225955-8jd0006rtgjnvl13
2010-01-22 23:59:55 +01:00
Juan RP
4b0c08ebcf xbps_unpack_binary_pkg: multiple fixes and improvements.
- Don't write any archive entry to disk unless the package metadata
  plist files are found.
- Always check for the package metadata plist files in the first 4
  entries, if they aren't found stop the unpacking... invalid archive.
- Don't check for removing INSTALL/REMOVE scripts on each iteration when
  extracting, just check it once before the loop.
- Add doxygen comments and related stuff.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100122225639-wameh8ls94bkm68h
2010-01-22 23:56:39 +01:00
Juan RP
65f241a081 xbps_repository_get_pkg_plist_dict_from_url: stop processing the archive
once that 4 entries are checked for the plist file.

Processing 6 entries is too much, we can be sure that plist file will
always be in the first 4 entries.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100122225433-u440x01bf8io3vd3
2010-01-22 23:54:33 +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
e11a1fe651 xbps_unpack_binary_pkg: fixed some bugs while upgrading essential pkgs.
* A package failed to be upgraded properly if current pkg contained
  INSTALL/REMOVE scripts, while the new one didn't have any of them.
  Fixed this by always removing current scripts if they exist.

* Essential pkgs are never removed (they are replaced) so the pre remove
  action target was never called, now it all works properly.

Bumped XBPS_RELVER because I consider these bugs so important.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100118184932-pdsb0djvf0swylm3
2010-01-18 19:49:32 +01:00
Juan RP
952e265b8f xbps_repository_pool_init: fix memleaks in error paths, found by cppcheck.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100117232650-qkg4zh4blx2mhy3d
2010-01-18 00:26:50 +01:00
Juan RP
a165d20193 Error and warning messages should go to stderr, make it so.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100115141916-tpg2rga1i4pm42kj
2010-01-15 15:19:16 +01:00
Juan RP
d2a093a401 xbps_repository_install_pkg: don't forget to release repository pool stuff.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114175814-0bin80brsh13swbj
2010-01-14 18:58:14 +01:00
Juan RP
d8a025a56a xbps_repository_install_pkg: before adding pkg into the transaction,
check that it wasn't added before.

This change fixes and endless loop while doing the following:

$ xbps-bin install libXext libX11

where libX11 is a dependency of libXext and was already queued.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114125713-o9vxzayz1tnhlt96
2010-01-14 13:57:13 +01:00
Juan RP
023841b060 Implemented blueprint 'install-pkg-by-pkgmatch' as specified in
https://blueprints.launchpad.net/xbps/+spec/install-pkg-by-pkgmatch

The implementation works as expected, it was easier that I thought.
Bump XBPS_RELVER because the API was changed slightly.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114011431-xv5q6bgahm6v9dbq
2010-01-14 02:14:31 +01:00
Juan RP
15be7b43a4 xbps_pkgmatch: before checking pattern with csh_match(), try to see if
a full match with strcmp() is enough.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114000042-ge4iajc9jownixhe
2010-01-14 01:00:42 +01:00
Juan RP
05bad9c0d5 xbps_remove_pkg: fix a memleak, thanks valgrind.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100113171003-aiome0xxe5l1f96a
2010-01-13 18:10:03 +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
e404632f7e Sync fetch code with libfetch-2.27.
joerg@netbsd libfetch-2.27:
The connection sharing didn't handle the case of active transfers
correctly and tried to close the connection in that case (PR 42607).
Correctly check if there is a transfer going on and just leave the
connection alone in that case.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100111192421-5fddbsek3ayi9wm8
2010-01-11 20:24: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
4be79d4535 xbps_register_pkg: if automatic-install obj is there, don't overwrite its value.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091224003242-9twye4isotebbips
2009-12-24 01:32:42 +01:00
Juan RP
7eea0f8e8e xbps-bin(8): implemented Launchpad blueprint "arbitrary-pkgname-args".
See https://blueprints.launchpad.net/xbps/+spec/arbitrary-pkgname-args.

The install, update and remove targets now accept a list of package
names that will be processed.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091222113736-0dawl4whvtdi5dj3
2009-12-22 12:37:36 +01:00
Juan RP
009c2131fc xbps_yesno/noyes: change the funcs to only accept "yes" or "no"
(case insensitive) answers rather than the short ones.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091222112759-0mnzjt3qcwp45ugn
2009-12-22 12:27:59 +01:00
Juan RP
6e863cbf45 lib/fetch/Makefile: ignore fstack-protector warnings.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091218122139-g4ljwb50cvnr8alj
2009-12-18 13:21:39 +01:00
Juan RP
f89e128a81 repository_sync_index.c: add missing sys/stat.h.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091218122054-bm5uchhrmubnfb0m
2009-12-18 13:20:54 +01:00
Juan RP
279219a348 xbps_unpack_binary_pkg: set INSTALL/REMOVE perms to 0750.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091211095846-kwszryu1wlho39eq
2009-12-11 10:58:46 +01:00
Juan RP
6c2a648510 repository_plist.c: fix lp bug #494905 "xbps build failure on x86_64".
fetchIO_read returns ssize_t not int, applied patch from submitter.
Thanks.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091210081328-cxkzuxjapaven6a3
2009-12-10 09:13:28 +01:00
Juan RP
eb885bbcc2 When executing the INSTALL/REMOVE scripts, always pass the UPDATE
value to them.

Bump XBPS_RELVER to 20091209.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091209151435-1yy9f7k2880tswz7
2009-12-09 16:14:35 +01:00
Juan RP
026dc6dbd9 xbps_unpack_binary_pkg: bail out if required metadata plist files aren't
found after processing 6 entries from the archive.

This to detect non-valid XBPS binary packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091207062422-fnwx9n0miq1nwadt
2009-12-07 07:24:22 +01:00
Juan RP
972af411d1 libxbps: share code for removing pkg files in remove.c and purge.c.
A new function has been created, xbps_remove_pkg_files() that accepts
a dictionary internalized from files.plist and a key to remove
links, dirs, files and conf_files.

As result of this, now when purging a package those directories that
were used in configuration files will also be removed if they are empty.

Bump XBPS_RELVER to 20091207.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091207053006-egw65u6y1jcuraje
2009-12-07 06:30:06 +01:00
Juan RP
f5744b0d3d xbps_remove_pkg: when removing dirs there is no need to look for
the "keep" obj anymore.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091207042711-g3raluagagj9b4au
2009-12-07 05:27:11 +01:00
Juan RP
b03a18ff84 xbps_unpack_binary_pkg: removed 2nd bool argument, look for a preserve object
to not remove files in removal or upgrades.

Bump XBPS_RELVER to 20091202.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091202053103-uby6hwu313pieafa
2009-12-02 06:31:03 +01:00
Juan RP
94bb169c88 Rename lib/repository_plist.c exported functions.
xbps_get_path_from_pkg_dict_repo -> xbps_repository_get_path_from_pkg_dict
xbps_get_pkg_plist_dict_from_repo -> xbps_repository_get_pkg_plist_dict
xbps_get_pkg_plist_dict_from_url -> xbps_repository_get_pkg_plist_dict_from_url

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091130113538-bji65cydf3bkwxkw
2009-11-30 12:35:38 +01:00
Juan RP
d90a248244 Rename struct repository_data to repository_pool.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091130112404-mlrt6x08thdvmrsn
2009-11-30 12:24:04 +01:00
Juan RP
91aeac4dad Rename some function from lib/repository* with more meaningful names.
xbps_unregister_repository() -> xbps_repository_register()
xbps_register_repository() -> xbps_repository_unregister()
xbps_find_deps_in_pkg() -> xbps_repository_find_pkg_deps()
xbps_prepare_pkg() -> xbps_repository_install_pkg()
xbps_find_new_pkg() -> xbps_repository_update_pkg()
xbps_find_new_packages() -> xbps_repository_update_allpkgs()
xbps_get_pkg_props() -> xbps_repository_get_transaction_dict()

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091130110846-5uaqxdhfo0kl0cqd
2009-11-30 12:08:46 +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
45f1d7b70a xbps_sort_pkg_deps: add debugging, use xbps_pkgdep_match().
--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129045327-x2y95weqecbon4l4
2009-11-29 05:53:27 +01:00
Juan RP
bd9b545fc9 xbps_find_pkg_repo_deps: check if current pkg version in repo is
enough to satisfy the required rundep for a pkg!

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129045232-ext4zxqrtsmbbqku
2009-11-29 05:52:32 +01:00
Juan RP
1a5d19dca2 Fix and improve how missing pkg dependencies are handled from repos.
- Use an array of strings to store the pkgdeps.
- While adding a missing pkgdep, check if it's already in the queue and
  new required version is greater, in that case replace with new one.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091129021735-5dqfucofny8slks2
2009-11-29 03:17:35 +01:00
Juan RP
a85073f6e8 xbps-repo: also print binpkg compression type in the show target.
Now it looks like:

$ xbps-repo show xbps-devel
Fetching info from: /storage/xbps/packages
Filename: xbps-devel-20091128.i686.xbps (size: 69K)
SHA256: 2c54a61fbd128097692edc19a7c17bfb10d93b3f055b04171cd1e4d97cde79df
Compression type: xz
Package: xbps-devel
Installed size: 216K
Maintainer: Juan RP [xtraeme@gmail.com]
Architecture: i686
Version: 20091128
Description: The XBPS package system (development branch)
 The XBPS package system. A new, fast, from scratch and simple
 binary package manager. This packages includes code from a development
 branch available from https://launchpad.net/xbps
$

--HG--
extra : convert_revision : xtraeme%40gmail.com-20091128051134-qzqqnwd76tcxgxb0
2009-11-28 06:11:34 +01:00