Commit Graph

551 Commits

Author SHA1 Message Date
Juan RP
a7ef059673 Bump copyright year for changed files. 2012-01-04 17:56:52 +01:00
Juan RP
a31c20e52a Make xbps_configure_pkg/packages accept a flush bool arg for frontends. 2012-01-04 17:41:36 +01:00
Juan RP
e22ba9a972 xbps-bin: simplify and make 'check' target work after regpkgdb flush changes. 2011-12-29 16:43:52 +01:00
Juan RP
c0f81bd482 xbps-uhelper: use xbps_(un)register_pkg() again. 2011-12-28 05:58:03 +01:00
Juan RP
11ca929985 xbps-uhelper: fix 'fetch' target exiting with error value. 2011-12-24 16:56:45 +01:00
Juan RP
9fa2804763 xbps-uhelper: really fix this time after regpkgdb rototill. 2011-12-24 16:37:42 +01:00
Juan RP
5a1ab26972 Introduce xbps_regpkgdb_remove_pkgd, and use regpkgdb funcs to make xbps-uhelper work. 2011-12-24 16:09:30 +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
32597d85c1 Use xbps_regpkgdb_foreach_pkg_cb() where needed. 2011-12-22 14:41:40 +01:00
Juan RP
7bfcdee791 Introduce xbps_regpkgdb_foreach_pkg_cb() and use it in xbps-bin check. 2011-12-22 14:25:27 +01:00
Juan RP
939e2c2417 xbps-bin(8): fix 'find-files' syntax in manpage. 2011-12-22 11:07:54 +01:00
Juan RP
47237846ae xbps-repo(8): the 'find-files' target now accepts multiple patterns. 2011-12-22 11:01:28 +01:00
Juan RP
d4278be914 xbps-bin(8): the 'find-files' target now accepts multiple patterns. 2011-12-22 10:45:13 +01:00
Juan RP
13331f801c xbps-repo: the 'search' target now accepts multiple patterns as arguments. 2011-12-22 09:33:54 +01:00
Juan RP
a5d9eb9853 xbps-bin: it's possible to reinstall any pkg with '-f' option. 2011-12-20 16:08:23 +01:00
Juan RP
6ad7289d68 Detect clock_gettime(2) and use (if available) for the fetch cb. 2011-12-19 16:41:57 +01:00
Juan RP
79fd316f8e xbps-bin: formatting fixes for transaction printfs. 2011-12-18 01:10:24 +01:00
Juan RP
a1f39a0a82 xbps-repo(8): rewriten manpage to mdoc(7) macro format. 2011-12-17 18:30:13 +01:00
Juan RP
99f0b02e03 xbps-bin(8): fix typo. 2011-12-17 18:29:48 +01:00
Juan RP
fa80e01404 xbps-bin(8): rewritten manpage to mdoc(7) macro format. 2011-12-17 17:40:23 +01:00
Juan RP
b0ceeaa58e New configuration file via confuse: xbps.conf. 2011-12-15 11:19:20 +01:00
Juan RP
3f45f563be xbps-bin: syslog support, enabled by default. 2011-12-06 13:02:49 +01:00
Juan RP
afde2a6653 xbps-repo: move list/search code into its own file: list.c. 2011-12-03 10:46:57 +01:00
Juan RP
43d85c76b3 xbps-repo: implement new target 'pkg-list' to list pkgs from target repo. 2011-12-03 10:37:31 +01:00
Juan RP
cb2e941b48 xbps-{bin,repo}: sync manpages. 2011-12-03 09:00:08 +01:00
Juan RP
8be527cbdf xbps_fetch_file: set bytes downloaded correctly for the fetch client cb. 2011-12-01 12:21:13 +01:00
Juan RP
8f119a4076 xbps-bin: make symlinks check to report an error msg on failure. 2011-11-27 10:05:23 +01:00
Juan RP
3ffb44f6fe xbps-bin: move remove code into transaction.c::remove_pkg(). 2011-11-27 09:59:39 +01:00
Juan RP
6229e06a67 xbps-bin: fix a broken condition. 2011-11-27 09:29:13 +01:00
Juan RP
9d731ffe09 Introduce xbps_transaction_remove_pkg() and use it for xbps-bin(8). 2011-11-27 09:05:18 +01:00
Juan RP
0ff0aee226 libxbps: added xbps_transaction_autoremove_pkgs(bool purge).
This is to add package orphans into the transaction dictionary.
2011-11-25 11:20:03 +01:00
Juan RP
bbfd2813b2 libxbps: renamed xbps_repository_{install,update}_xxx to xbps_transaction_xxx. 2011-11-25 10:12:03 +01:00
Juan RP
f3099fa2c6 Added success states for state_cb, move some descriptions to the client cb. 2011-11-25 09:44:49 +01:00
Juan RP
ab17573692 Split XBPS_FLAG_FORCE into CONFIGURE and REMOVE_FILES, bump XBPS_API_VERSION. 2011-11-24 11:50:53 +01:00
Juan RP
ab36420439 xbps-bin: process XBPS_STATE_TRANS cases too. 2011-11-24 11:33:04 +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
435aa84fb0 xbps-{bin,repo}: unbreak the 'show' target, sigh. 2011-11-15 10:21:12 +01:00
Juan RP
9157f7d148 xbps-bin: split main.c into new files: list.c show-orphans.c and unpack_cb.c. 2011-11-11 10:18:52 +01:00
Juan RP
029fd96690 xbps-bin: state_cb.c: initialize var to silence a warning. 2011-11-11 09:45:03 +01:00
Juan RP
86f1f18571 libxbps: revamped trans states/cb to be more generic, not just for transactions. 2011-11-11 09:41:48 +01:00
Juan RP
dc4f7af890 xbps-bin: remove useless printf in autoupdate target. 2011-11-11 00:39:47 +01:00
Juan RP
ced906ff3f xbps-repo: renamed repository.c to show.c. 2011-11-10 23:31:46 +01:00
Juan RP
c2eed68471 libxbps: add xbps_repository_pool_sync, to sync repoidx from all remotes. 2011-11-10 23:14:50 +01:00
Juan RP
de4504c248 Update refs to pkg-index, which aren't true anymore. 2011-11-10 09:21:17 +01:00
Juan RP
59dc65b907 Move prog.mk to the bin directory. 2011-11-08 17:45:14 +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
27c5138324 xbps-bin: use xbps_fetch_error_string in reposync err cb. 2011-11-07 19:56:30 +01:00
Juan RP
fe3353a2b2 xbps-uhelper: optimize some targets where xbps_init() is not necessary. 2011-11-05 08:41:29 +01:00
Juan RP
1031ea0141 xbps-bin: return proper error value if update target fails. 2011-10-31 21:28:21 +01:00
Juan RP
39e8ada644 xbps-repo: simplify code in repository.c. 2011-10-29 11:24:02 +02:00
Juan RP
5731b7d070 xbps-bin: XBPS_TRANS_STATE_REPOSYNC printf tweak. 2011-10-29 10:21:31 +02:00
Juan RP
1c4d486396 xbps-{bin,repo}: new -o flag for the 'show' target, to print specific objs value. 2011-10-29 08:17:54 +02:00
Juan RP
549b5e2e36 xbps-{bin,repo}: dynamically print all objs in the 'show-files' target. 2011-10-28 23:02:07 +02:00
Juan RP
c5fcaa294d xbps-{bin,repo}: dynamically print all objs in the 'show' target. 2011-10-28 18:17:19 +02:00
Juan RP
238c9d9926 xbps-bin: (check) initialize vars to avoid a gcc warning. 2011-10-28 09:35:34 +02:00
Juan RP
8bc705ea63 xbps-bin(8): (check) new test to fix missing requiredby entries in regpkgdb. 2011-10-28 00:57:16 +02:00
Juan RP
f87b40eb76 xbps-bin(8): split individual checks from check.c into its own files.
This is in preparation for new upcoming checks.
2011-10-27 17:08:48 +02:00
Juan RP
2ff2d1f68a xbps-bin(8): 'check' target now works with virtual packages. 2011-10-27 11:02:55 +02:00
Juan RP
807045d1d5 xbps-bin(8): make 'remove' target also follow common style to list pkgs. 2011-10-25 17:52:05 +02:00
Juan RP
746d9894c2 xbps-bin(8): remove specified pkgs first in recursive case.
Previously the specified pkg(s) were added at the tail of the
array, which was wrong. Add pkg(s) to the head of the array so that:

$ xbps-bin -Rp remove foo blah

foo and blah will be removed before any of its automatic dependecies.
2011-10-24 10:23:07 +02:00
Juan RP
4f8e6c00af xbps-bin: install: use a shell wildcard pattern if only pkgname is set. 2011-10-24 10:03:54 +02:00
Juan RP
bda1feb396 xbps-bin: more printf cosmetics for the install target. 2011-10-19 16:25:06 +02:00
Juan RP
40d15fd342 xbps-bin(8): the 'check' target now switches to auto mode if required. 2011-10-19 09:44:18 +02:00
Juan RP
8fa21753b1 xbps-bin: printf cosmetics for the install target. 2011-10-18 21:40:26 +02:00
Juan RP
931a03b806 New configuration schemas changes, round 3.
struct xbps_handle::conffile has been renamed to confdir, and it now
expects the path to a directory, where the configuration files are
stored.

Change xbps-bin(8) and xbps-repo(8) along with its manpages to mention
that -C expects a directory.
2011-10-17 15:11:54 +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
d70036dd81 xbps-repo8(8): make the show targets be aware of vpkg settings in conf. 2011-10-16 16:54:08 +02:00
Juan RP
2d50109da5 xbps-bin: detect broken symlinks in the 'check' target. 2011-09-28 11:06:24 +02:00
Juan RP
edb909c899 xbps-{bin,repo}: minor change to long_desc obj printing. 2011-09-01 09:50:47 +02:00
Juan RP
4aa06921ff xbps-*: do not pass a NULL pointer to xbps_end(). 2011-07-29 11:27:43 +02:00
Juan RP
2857214afa libxbps: improve returned errnos for repository API functions.
- xbps_repository_update_packages: return ENOENT if regpkgdb is NULL
  (no packages currently registered).
- xbps_repository_update_packages: return EEXIST if no updates are
  available.
- xbps_repository_pool: return ENOTSUP if no repositories were
  registered.
- make xbps-{bin,repo} handle ENOTSUP errors.
2011-07-29 11:17:34 +02:00
Juan RP
e71e3e9958 trans_cb: fix obvious error in REPOSYNC state. 2011-07-29 11:12:34 +02:00
Juan RP
3bbc6ae18d trans_cb: also show old pkgver when updating a pkg. 2011-07-29 08:09:23 +02:00
Juan RP
5e390b8839 Introduce new pkg state: half-unpacked.
Packages in this state shall be re-installed and re-unpacked because its
files weren't unpacked properly.
2011-07-28 16:25:01 +02:00
Juan RP
6c0b24029b xbps-bin(8): fix a couple issues in the 'check' target. 2011-07-28 16:24:16 +02:00
Juan RP
6f783389dd Share transaction callbacks for xbps-{bin,repo}, reposync cb support. 2011-07-28 09:25:30 +02:00
Juan RP
43b841dce1 Use xfcd->cookie to pass user-supplied data to the fetch cb. 2011-07-27 18:04:38 +02:00
Juan RP
508f119bc9 Moved install transaction code to libxbps, see NEWS file. 2011-07-27 17:13:54 +02:00
Juan RP
6b02c28bd7 xbps-bin(8): simplify previous commit and reuse new code. 2011-07-25 16:44:26 +02:00
Juan RP
e26b6e23e6 xbps-bin(8): make 'show{,-deps,-revdeps}' target work with virtual pkgs. 2011-07-25 16:40:34 +02:00
Juan RP
19f4cbd995 Generate transaction pkg count stats in the transaction dictionary.
This removes a chunk in frontends to compute number of installed,
updated, configured and removed pkgs in transaction.
2011-07-24 17:43:17 +02:00
Juan RP
d1454c21d2 Improvements to xbps-bin(8) and xbps-repo(8) manpages. 2011-07-23 08:33:12 +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
fddb472dd0 xbps-uhelper: remove unused targets/code. 2011-07-15 16:29:55 +02:00
Juan RP
5917fc7404 xbps-repo: printf uint64_t with PRIu64. 2011-07-11 12:12:55 +02:00
Juan RP
f7918ec5aa xbps-repo: ignore pkgs providing virtualpkgs in genindex target. 2011-07-11 10:12:42 +02:00
Juan RP
c163801fd0 xbps-bin: print the list of pkgs when removing a pkg with reverse-deps.
This commit also removes the printf for -F, it seems that it's confusing
so I simply removed it and it won't proceed unless -F is specified.
2011-07-10 20:24:29 +02:00
Juan RP
b62f1f0396 xbps-repo: remove unused pkgname var for previous commit. 2011-07-09 13:33:48 +02:00
Juan RP
cdf4640246 xbps-repo(8): 'genindex' now removes entries for unexistent pkgs.
Packages that were previously registered in repository's pkg-index.plist
and are now unaccessible are removed.

This fixes issue #1 in github.com/vanilla/xbps.
2011-07-09 13:18:11 +02:00
Juan RP
81d5bdd79a xbps-repo: fix the 'genindex' target with missing directories.
This fixes issue #3 in github.com/vanilla/xbps.
2011-07-09 11:21:17 +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
7999d393e2 xbps-bin: return ENODEV in missing dependencies, not 1. 2011-07-02 23:44:51 +02:00
Juan RP
8b43800e94 xbps-repo: improve error msg if 'sync' target fails. 2011-06-30 10:58:10 +02:00
Juan RP
539dd1c0cd xbps-bin: when replacing pkgs only purge for pkgs that aren't going to be updated. 2011-06-25 22:53:47 +02:00
Juan RP
cf4b9b5011 xbps-uhelper: make 'register' target to not set automatic-install (i.e manual). 2011-06-24 22:40:00 +02:00
Juan RP
97fcd43bbe xbps-bin: also purge pkgs that shall be replaced. 2011-06-23 11:46:15 +02:00
Juan RP
6b4aaae971 xbps-bin: check: missing whitespace in printf. 2011-06-22 09:37:59 +02:00
Juan RP
96bf160032 xbps-bin: check: don't play stupid games removing previous lines. 2011-06-22 09:33:39 +02:00
Juan RP
de9e153bb9 xbps-bin: check target: ignore symlinks with empty targets. 2011-06-22 09:16:48 +02:00
Juan RP
2719f63642 xbps-repo: improve error string when xbps_fetch_file() errors out. 2011-06-20 23:16:58 +02:00
Juan RP
ed82315813 xbps-{bin,repo}(8): don't mention xbps-src, this info is outdated. 2011-06-20 12:56:43 +02:00
Juan RP
32a5cd501e xbps-bin: improve error printfs while checking files.plist. 2011-06-06 09:09:30 +02:00
Juan RP
90549d829a xbps-bin::util.c: do not use C99 struct initialization, it's too long to type. 2011-06-04 22:35:48 +02:00
Juan RP
48f689d8e6 xbps-bin: error msg when cachedir cannot be created. 2011-06-04 16:37:05 +02:00
Juan RP
bb4cefcd2c xbps-{bin,repo}: init conffile to NULL. 2011-06-04 13:53:55 +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
c9a673cc11 xbps-bin: make the 'check' target also test for modified symlinks. 2011-06-01 07:31:38 +02:00
Juan RP
cfa637db48 Repository package index format 1.2.
The pkg index now stores all package objects from props.plist, so that
xbps-repo(8) doesn't have to access the target binpkg anymore.
2011-05-27 17:32:42 +02:00
Juan RP
d88b852843 xbps-dgraph: add two new optional objs: homepage and license. 2011-05-27 09:26:50 +02:00
Juan RP
73200498a5 xbps-repo: do not add build_date, homepage and license objs into the index. 2011-05-27 07:10:33 +02:00
Juan RP
f7882f7215 xbps-{bin,repo}: parse three new objects in pkg props.plist: homepage, build_date and license. 2011-05-26 10:54:48 +02:00
Juan RP
408c10c57d xbps-repo: add missing \n. 2011-05-25 15:31:16 +02:00
Juan RP
a13c7d695e xbps-repo: more meaningful messages for the show{,-deps,-files} targets. 2011-05-25 15:29:26 +02:00
Juan RP
ef28101203 xbps_register_pkg: remove 'automatic' boolean argument.
It should be provided in the proplib dictionary with key 'automatic-install'.
This fixes a regression not respecting the 'automatic-install' value stored
in regpkgdb.
2011-04-11 14:42:06 +02:00
Juan RP
ad66fa2e3d xbps-bin::install.c: remove unused var to make this build with gcc-4.6.
Reported and patch provided by ojab in issue 4.
2011-04-08 19:25:41 +02:00
Juan RP
007d6b4bd5 xbps-bin.8: bump date. 2011-02-26 11:17:02 +01:00
Juan RP
dd72cb295d xbps-uhelper: added two new targets 'setsource' and 'fromsource'.
Both targets will be used by some upcoming changes in xbps-src, therefore
they shouldn't be used manually by the user.
2011-02-26 11:15:17 +01:00
Juan RP
221291929e xbps-bin: added -A and -M options for explicitly setting install reason to auto or manual. 2011-02-26 11:14:05 +01:00
Juan RP
f2ef0c0050 xbps-bin: return rval if 'install' target cannot find a pkg. 2011-02-25 13:41:57 +01:00
Juan RP
2eb7331907 xbps-bin: return 1 if there are missing deps, return errno in other errors. 2011-02-25 12:27:42 +01:00
Juan RP
0a84799ac7 xbps-bin: add a simple unpack cb that mimics the 'check' target. 2011-02-24 10:18:24 +01:00
Juan RP
5f2ae48b71 xbps-bin: skip some unneeded stuff in the download and configure phases. 2011-02-23 23:43:45 +01:00
Juan RP
12cdc7c242 xbps-bin: remove the unpack callback with a percentage.
It messes up some xbps_*printf()s, and removing it makes it look like
previous versions (<=0.7.3).
2011-02-22 16:33:54 +01:00
Juan RP
a306cebc96 xbps_set_pkg_state_installed: added two new optional arguments: version and pkgver.
This can be used to avoid some rare cases where the pkg dictionary is regpkgdb
is in a state where code can be faulty if those objects are not found.
2011-02-22 11:09:39 +01:00
Juan RP
9abcb92e39 xbps-bin::instal.c: some bugfixes for pkg state and the transaction steps.
- While installing a package, always check its state and don't ignore it
  if it was already unpacked, we have to configure it.
- Before unpacking packages, configure packages that were unpacked previously.
2011-02-22 11:07:34 +01:00
Juan RP
9e22df0725 xbps-bin: skip packages to be configured in the install/update stage, fix configured pkg count. 2011-02-21 23:28:39 +01:00
Juan RP
870ad18d58 xbps_init() now sets rootdir, cachedir and flags.
That means that the following functions were removed:
	- xbps_set_{cachedir,flags,rootdir}.
	- xbps_get_{cachedir,flags,rootdir}.

With this change fixed an obvious typo that made -c argument to not work,
and now the cache directory is an absolute path not relative to rootdir.
2011-02-21 17:42:47 +01:00
Juan RP
3acf91bb15 xbps-bin: unpack_progress_cb_verbose printf to stdout for consistency. 2011-02-21 13:53:08 +01:00
Juan RP
22ae7aa2e8 Introduce struct xbps_handle and use it for xbps_init().
This structure sets up function callbacks for fetching files and
unpacking binary packages, as well as setting the debug boolean.

This way the affected functions (xbps_fetch_file() and
xbps_unpack_binary_pkg()) do not need to accept the fn cb pointers
and data as arguments.

Bump XBPS_RELVER.
2011-02-21 13:38:44 +01:00
Juan RP
078f9f1cda Fixed finally another real case when updating and replacing pkgs. 2011-02-18 16:39:42 +01:00
Juan RP
b90c815e80 Minor nits to the xbps-{bin,repo}.8 manpages. 2011-02-05 17:32:14 +01:00
Juan RP
d5c2a3266f Rename the transaction object key to "transaction" rater than "trans-action". 2011-02-05 12:21:04 +01:00
Juan RP
14d3fe8aa7 xbps-bin: shorter informative messages for transactions. 2011-02-05 11:47:02 +01:00
Juan RP
2e140cde7b xbps-bin.8: fix typo. 2011-02-05 11:29:18 +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
d25bc35711 xbps-bin::show_pkg_info() remove useless prop_object_type_t member. 2011-02-04 18:00:47 +01:00
Juan RP
40cf7bad32 xbps-repo: call xbps_end() in usage() before exit(3). 2011-02-04 16:24:22 +01:00
Juan RP
097b50b3c2 Fix all warnings found by clang analyzer as reported by ojab in issue 3. 2011-02-03 17:49:43 +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
7b159d6f33 xbps-dgraph: parse the "provides" obj for virtual packages. 2011-01-31 16:40:33 +01:00
Juan RP
fca3d6b9bf Use xbps_{error,warn}_printf() everywhere. 2011-01-30 18:23:33 +01:00
Juan RP
243685507a xbps-bin: some cosmetic informative printfs. 2011-01-30 12:40:16 +01:00
Juan RP
89faf75db4 xbps-bin/remove.c: fix some comments. 2011-01-30 12:12:49 +01:00
Juan RP
f27b7557bc xbps-bin: there's no need to add objs in inverted order for -R. 2011-01-30 08:22: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
7c8a89c968 xbps-repo(8): fix wrong sentence. 2011-01-29 17:48:13 +01:00
Juan RP
03b1b254cc xbps-bin::check.c: reset a var to avoid false positives. 2011-01-28 12:18:17 +01:00
Juan RP
faad0a6597 Make xbps_remove_pkg_from_* use shared code, and add another variant.
The functions have been renamed to really match what they do.
2011-01-27 18:22:57 +01:00
Juan RP
080334da8b xbps-bin: make 'list' target without arguments to only show pkgs in "installed" state. 2011-01-27 14:45:40 +01:00
Juan RP
255f229a78 xbps-bin.8: fix a typo. 2011-01-27 14:44:39 +01:00
Juan RP
c952337fd4 xbps-bin(8): added -D option to only show the URL to download binary packages. 2011-01-27 14:36:33 +01:00
Juan RP
1c21a98545 Rename some symbols in repository_plist.c.
xbps_repository_get_pkg_plist_dict_from_url -> xbps_repository_plist_find_pkg_dict_from_url
xbps_repository_get_pkg_plist_dict -> xbps_repository_plist_find_pkg_dict
2011-01-27 13:53:33 +01:00
Juan RP
69512d4da7 Rename xbps_find_pkg_from_plist to xbps_find_pkg_dict_from_plist_by_name. 2011-01-27 12:41:49 +01:00
Juan RP
26701d3bf3 Rename a few symbols for clarity.
xbps_check_is_installed_pkg -> xbps_check_is_installed_pkg_by_pattern
xbps_check_is_installed_pkgname -> xbps_check_is_installed_pkg_by_name
xbps_check_is_repo_string_remote -> xbps_check_is_remote_uri_remote
2011-01-27 12:34:13 +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
bc259ae720 xbps-{bin,repo}: use static const tables to parse objs in XBPS_PKGPROPS files. 2011-01-26 16:34:26 +01:00
Juan RP
ada7820312 xbps-bin: reset some static vars for correct indentation in output. 2011-01-25 17:52:04 +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
fd30feadcb xbps-bin/check.c: save some lines by using prop_object_type() directly. 2011-01-25 03:33:51 +01:00
Juan RP
082efc3535 Added xbps_callback_array_iter() and use it in xbps-bin to list missing pkgdeps. 2011-01-25 02:55:34 +01:00
Juan RP
6b4c6970a3 xbps-bin/question.c: use sizeof(). 2011-01-24 19:26:52 +01:00
Juan RP
0feae4fa20 xbps-uhelper: added 'getpkgdepversion' target. 2011-01-24 19:13:11 +01:00
Juan RP
72d82a3a26 Simplify and share common code in xbps_repository_{update,install}_pkg(). 2011-01-24 18:49:24 +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
81b6b62aef xbps-bin/fetch.c: use else if conditionals.
--HG--
branch : progress_callback
2011-01-22 13:08:36 +01:00
Juan RP
724c4a6f0a Added fetch.c for xbps-bin, with the fetch function callback.
--HG--
branch : progress_callback
2011-01-22 12:40:58 +01:00
Juan RP
984eae1578 Make xbps_fetch_file accept a callback to update its progress.
This also makes xbps_unpack_binary_pkg follow this convention by avoiding
static variables.

--HG--
branch : progress_callback
rename : bin/xbps-repo/util.c => bin/xbps-bin/util.c
2011-01-22 12:40:19 +01:00
Juan RP
8c2ccea435 WIP checkpoint for progress callbacks in the API.
At this moment I've only implemented the part for unpacking, other parts
will also use progress callbacks.

--HG--
branch : progress_callback
2011-01-21 17:16:58 +01:00
Juan RP
ab857595d7 Check that return value of snprintf(3) is not negative, rather than only -1. 2011-01-21 00:32:46 +01:00
Juan RP
84b578b0e4 libxbps: modify xbps_get_binpkg_repo_uri() to accept repository URL as 2nd arg. 2011-01-20 16:41:49 +01:00
Juan RP
2adaf610e7 libxbps: xbps_yesno/noyes() are only used in xbps-bin(8), remove from API. 2011-01-18 23:45:12 +01:00
Juan RP
0a8fabbfac xbps-bin: remove spurios chars in two printf()s. 2011-01-18 23:42:51 +01:00
Juan RP
992e8c6a14 libxbps::xbps_humanize_number(): use common values and hide implementation details from API.
So now its prototype is the following:

int xbps_humanize_number(char *buf, int64_t bytes)

It is a wrapper around NetBSD's humanize_number(3) which uses 6 digits for max
length, HN_AUTOSCALE and HN_NOSPACE|HN_DECIMAL. All users have been updated.
2011-01-18 23:10:07 +01:00
Juan RP
fe15380e1b libxbps: modify the API, new func xbps_get_binpkg_repo_uri().
This function replaces xbps_repository_get_path_from_pkg_dict() and
xbps_get_binpkg_local_path(). It takes a pkg dictionary as returned
by a repository pkg index or a transaction dictionary and returns
a string with the full path to the binary pkg, either in local
repos, cachedir or remote repos.

Update all code to use this function... sorry I broke ABI compatiblity.
2011-01-18 18:21:55 +01:00
Juan RP
8e0a94d5cc xbps-repo: use xbps_repository_pool_find_pkg(). 2011-01-18 14:57:25 +01:00
Juan RP
6051eb29ab Added another bunch of compiler warnings and fix code. 2011-01-15 11:59:44 +01:00
Juan RP
057deb180c xbps-repo: report the errno string when a repository cannot be added and fix a NULL pointer deref. 2010-12-25 02:35:11 +01:00
Juan RP
5b101eae2b xbps-repo: fix a memleak in the 'add' target. 2010-12-24 05:43:00 +01:00
Juan RP
57453d1926 xbps-{bin,repo}: use strlcpy(). 2010-12-24 05:31:37 +01:00
Juan RP
45b4fada3d xbps-repo: fix a memleak in the 'show' target. 2010-12-24 05:29:39 +01:00
Juan RP
f2c33b0b08 xbps-repo: fix a memleak in the 'find-files' target. 2010-12-24 05:21:49 +01:00
Juan RP
a7886f62db xbps-bin: fix a memleak in the 'find-files' target. 2010-12-24 05:21:22 +01:00
Juan RP
e3b86d5ff6 xbps-dgraph: use PRIu64 to printf uint64_t from <inttypes.h>. 2010-12-23 17:23:14 +01:00
Juan RP
e01399c242 xbps-uhelper: added -d flag to enable debugging. 2010-12-18 10:26:12 +01:00
Juan RP
b017f6d024 xbps-repo: fix the 'genindex' target due to 0.7.0 API changes. 2010-12-16 11:37:31 +01:00
Juan RP
e6503b98cc xbps-uhelper: fix the 'unregister' target, wasn't updated for 0.7.0 API changes. 2010-12-16 00:25:53 +01:00
Juan RP
ece608a080 xbps-repo(8): implemented 'find-files' target. 2010-12-15 15:14:44 +01:00
Juan RP
60c37406c1 xbps-repo: zero out allocated mem to avoid garbage in the 'search' target. 2010-12-04 10:31:17 +01:00
Juan RP
4f6e20c431 xbps-bin: zero out allocated mem to avoid garbage in the 'list' target. 2010-12-04 10:30:01 +01:00
Juan RP
237991fd79 xbps-bin: added -F flag for the remove target.
Unless it's set, packages that are dependencies of other installed packages
won't be removed. This flag overrides this behaviour and forces the package removal.

While being here, misc cleanups.
2010-12-03 17:36:07 +01:00
Juan RP
98a2034fcf Also show the conflicts object if available and simplify the code. 2010-12-03 06:37:01 +01:00
Juan RP
b3c8a8ef5c Backed out changeset e82cc0e4b779
Otherwise the refcount in repository pool will initialize/release on every op.
2010-11-25 21:33:14 +01:00
Juan RP
c7f6f9f44a xbps-bin: there's no need to init repository pool. 2010-11-25 16:23:49 +01:00
Juan RP
2c72c81db0 xbps-bin: always check if the there are missing deps regardless of the errno value. 2010-11-25 10:58:44 +01:00
Juan RP
278a37a24a xbps-bin: fix for previous. 2010-11-24 16:39:14 +01:00
Juan RP
940e077fb4 Improvements for xbps-{bin,repo}.
- Indent properly with the longest "pkgver" object while listing or searching
  for packages.
- Also match strings in the short description object while searching for
  packages in xbps_repo.
2010-11-24 16:37:30 +01:00
Juan RP
d2be842ce5 Fix and improve when there are missing deps in the transaction dictionary. 2010-11-23 23:17:04 +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
ffc255b715 Starting to clean up the public API, move private stuff into xbps_api_impl.h. 2010-11-13 03:18:58 +01:00
Juan RP
420225d414 xbps-dgraph: new utility to generate dot(1) graphs for package metadata properties. 2010-11-08 23:27:15 +01:00
Juan RP
c3afb4f4fb New function: xbps_get_pkg_dict_from_metadata_plist.
This function returns and internalized dictionary from a package's metadata
plist file as specified by its arguments.

Update all code to use it where appropiate.
2010-11-08 03:14:41 +01:00
Juan RP
679833156a Always release the object dictionary returned by xbps_find_pkg_dict_installed().
Document this in the public API header and update all code accordingly.
2010-11-08 02:02:35 +01:00
Juan RP
ec7cdde1e0 Misc cleanups and performance improvements.
- There's no need to check rval for prop_dictionary_get_*, we are sure the
  objects are there at prop_dictionary_set_* time.
- Avoid two chdir(2) calls per INSTALL/REMOVE run.
- Avoid using access(2) to check for existence of INSTALL/REMOVE scripts,
  just try to run the executable directly and check for ENOENT.
2010-11-06 06:44:00 +01:00
Juan RP
8ef8d86c12 Some changes for the XBPS libfetch's frontend code.
1) Raise the cache connection settings to more sane defaults (8->6, 16->2).
2) Introduce xbps_fetch_unset_cache_connection() to drop the caches.
2010-11-03 12:23:57 +01:00
Juan RP
8d998948ef xbps-bin.8: fixed two formatting errors. 2010-10-31 01:59:48 +02:00
Juan RP
210f2799fc xbps-bin(8): modify the 'list' target to accept an optional argument to
list packages in the specified state, so that you can list packages that
 need to be purged, configured and broken (will be used in the future).
2010-10-27 13:10:03 +02:00
Juan RP
ef7da88db1 xbps-bin(8): added a new target "find-files".
This new target 'find-files' can be used to find which installed
package(s) own a file. Exact matches like "/bin/mount" or patterns
like "/usr/lib/libb[ao]b\*" can be specified.
2010-10-27 00:25:02 +02:00
Juan RP
8534b79ffc Prepare for going-to-be-released 0.6.1.
Includes the following change:

* When replacing a package that is going to be updated in the transaction
   do not remove it, just overwrite its files and continue. The updated
   package will find that old files didn't match the SHA256 hash and will
   skip them. This solves the issue of new package updates requiring new
   dependencies with files that were previously stored in the old version.
   For example gtk+-2.20 containing gdk-pixbuf, and gtk+-2.22 requiring
   gdk-pixbuf externally.
2010-10-23 18:09:35 +02:00
Juan RP
8e764dca60 xbps-repo: put back sanitize_url() and improve the implementation. 2010-05-20 14:45:12 +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
8b222fd093 xbps-repo/index.c: fix a typo. 2010-05-18 23:06:27 +02:00
Juan RP
754ec6ebb1 xbps-repo: fix genindex target to not return error when a package is already
registered in the index.
2010-05-18 02:42:21 +02:00
Juan RP
1fbc19959f xbps-bin: when replacing a pkg do not purge the old one, just remove it. 2010-05-12 07:47:40 +02:00
Juan RP
401d197c06 xbps-repo(8): improved the 'search' target to also match substrings
in package/version tuples.
2010-05-12 05:04:35 +02:00
Juan RP
b8c9577df6 xbps-bin(8): added a new target 'show-orphans' that list all package
orphans currently installed.
2010-05-04 17:04:36 +02:00
Juan RP
1b44e18b35 Remove asciidoc build dependency, use troff manpages directly. 2010-05-03 21:50:34 +02:00
Juan RP
59693bf505 Update manpages for new XBPS project locations. 2010-05-02 11:36:17 +02:00
Juan RP
2d68c5fb20 xbps-repo(8): fixed the 'search' target to also match patterns against
its description, and not only from the package/version touple.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428214659-lz1au5hjg80h4j37
2010-04-28 23:46:59 +02:00
Juan RP
7976ac3707 xbps-repo/index.c: fix warnings found by clang.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428211333-wi7id42b9ol7g2ae
2010-04-28 23:13:33 +02:00
Juan RP
b04a0230cd xbps-bin/check.c: remove dead code, fix warnings found by clang.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428211107-nvoflpkfkz37y3us
2010-04-28 23:11:07 +02:00
Juan RP
db685f280d xbps-bin/install.c: remove unused vars, found by clang.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428193336-61glbrl5rnjpby4p
2010-04-28 21:33:36 +02:00
Juan RP
8ec438e168 xbps-bin/main.c: remove unused var found by clang analyzer.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428163341-3b947nuva6l5pv85
2010-04-28 18:33:41 +02:00
Juan RP
11de88d122 xbps-bin/install.c: fix a NULL pointer dereference in error path, found by
the clang analyzer.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428163137-hs9ac0rm47sz9k14
2010-04-28 18:31:37 +02:00
Juan RP
e274585c3c xbps-bin(8): added -p flag to also purge packages for the 'remove'
and 'autoremove' targets, after successful removal.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100428012613-e2wpzknmrxkjntsd
2010-04-28 03:26:13 +02:00
Juan RP
a5d8d486ea xbps-repo: show a warning when a repository has been already added.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100427160215-pi2urhu9xzeblv71
2010-04-27 18:02:15 +02:00
Juan RP
ad12302a69 xbps-uhelper: remove unused debug code.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100420123503-std182rf5dt59ccq
2010-04-20 14:35:03 +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
9bceb2adb7 xbps-bin: fixed the install target to work with pkgnames containing
multiple '-' characters, which resulted in incomplete pkgname.

The fix is to always append '>=0' if a pkgname is specified, and passing
a pkgpattern to xbps_repository_install_pkg().

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100226051333-od2siux4rmsa88m7
2010-02-26 06:13:33 +01:00
Juan RP
9f4b36292d xbps-bin: unset some bool vars while processing the transaction to avoid
wrong messages for preserve pkgs.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100217041941-wrvm86m0tc7ynlvu
2010-02-17 05:19:41 +01:00
Juan RP
83ab3fe977 xbps-bin/remove.c: set some pointers to NULL before checking them.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100128164423-i00yg3xp3nlsoh6j
2010-01-28 17:44:23 +01:00
Juan RP
61dde1ac02 Always overwrite files while unpacking, this makes the "essential" obj obsolete.
This helps to catch upgrade problems and simplifies some parts of the code.
Bumped XBPS_RELVER because xbps_remove_pkg() has been changed.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100128150850-gcs93su38t6moydn
2010-01-28 16:08:50 +01:00
Juan RP
375330a956 xbps-bin: print different msgs for pkgs marked as preserve and essential.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125151648-s3d0zxaro5v5bh95
2010-01-25 16:16:48 +01:00
Juan RP
dae134cd48 xbps-bin/remove.c: simplify error paths.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125151604-jwhoavlbdhr645df
2010-01-25 16:16:04 +01:00
Juan RP
bf6b96c651 xbps-bin/check.c: simplify exit paths.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125151533-z7ub7xlqbhg97ij2
2010-01-25 16:15:33 +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
7f343b8dbe xbps-bin: fixed some stdout vs stderr printf issues.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100125021454-n1bh7qjy27azr9du
2010-01-25 03:14:54 +01:00
Juan RP
232660167b xbps-uhelper: make 'fetch' target accept an arbitrary number of arguments.
Also set default libfetch's cache connection limits.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124162517-iorbhh21je4c65xo
2010-01-24 17:25:17 +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
489f6baaa6 xbps-bin: remove an extra newline in transaction ops.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100124130757-mf0p5d6kajwd6t2k
2010-01-24 14:07:57 +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
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
6c27794c5b xbps-bin: simplify pkgname_from_pkgmatch() and fix a bug.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114123917-3tvrb3tp097nnq8r
2010-01-14 13:39:17 +01:00
Juan RP
7230203be4 xbps-bin: really fix previous, by using a hack for now.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114052501-e8xak6rhwf8tonf6
2010-01-14 06:25:01 +01:00
Juan RP
37008d3c75 xbps-bin: don't make false positives detecting pkgmatches vs pkgnames
while installing packages.

--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114030001-0m1cb3m1cf7oc7un
2010-01-14 04:00:01 +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
6c29fe7514 xbps-repo: search target: also report exact matches by pkgname.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100114000654-tnrtvi1ymy2iveyx
2010-01-14 01:06:54 +01:00
Juan RP
27dd304d76 Install the xbps_api.h header.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100113183225-gz8xn8fa5hp2vdan
2010-01-13 19:32:25 +01:00
Juan RP
536fb8a86e xbps-repo/util.c: bump copyright year.
--HG--
extra : convert_revision : xtraeme%40gmail.com-20100113160523-8f0blxmmep2hn44e
2010-01-13 17:05:23 +01:00