Commit Graph

1000 Commits (5d796b567819ce91740fcdea7cbafecbda65d8f3)

Author SHA1 Message Date
Timo Teräs 555363f056 url: use libfetch to retrieve http/https/ftp files 2014-10-08 10:10:45 +03:00
Timo Teräs 5496560a4f db: fix crash if unable to download cache item
fixes #3371
2014-10-07 17:05:06 +03:00
Timo Teräs 1bbca16333 io: fix few error path leaks 2014-10-07 17:04:38 +03:00
Timo Teräs 09e48d8f06 db: rework directory permission handling
Apk used to reset directory permissions always, but this is undesirable
if user has modified the permissions - especially during tmpfs boot.
Though, it is desirable to update the permissions when packaging has
changed permissions, or a new package is installed and the merged
permission mask / owner changes.

Thus the new code updates the permissions only if:
 1) We are booting and directory is not in apkovl
 2) The directory is modified by a package install/remove/upgrade
 3) The filesystem directory permission matched database

Additionally "apk fix --directory-permissions" can be used to reset
all directory permissions to the database defaults.

Fixes #2966
2014-10-07 14:11:29 +03:00
Timo Teräs e0f9b0897b solver: enforce conflicts during upgrades and new pkg installs
This makes sure any conflicted packages will be removed first.
Useful if we know there are conflicting files, and want to avoid
adding potentially harmful replaces line. Add a test case for
this too.
2014-10-06 16:30:09 +03:00
Timo Teräs f2d9a14405 cache: delete more aggressively unneeded cached files
Also if --purge is specified delete all uninstalled packages.
Fixes #2889
2014-10-06 15:54:52 +03:00
Timo Teräs f5674b9582 db: use per-pkg architecture (if available) to form download url
Allows one arch index files to refer to other arch packages. Mostly
useful with noarch packages, but could be used e.g. to ship build
with some of packages optimized for specific cpu generation and
share most packages with the standard build.
2014-10-06 14:54:54 +03:00
Timo Teräs 6ea922cc87 info who-owns: print symlink target owner as a fallback
busybox trigger creates symlinks to itself. This helps user
to see where these come from.
2014-10-06 14:45:10 +03:00
Timo Teräs f911f7043b index: fix warning about package names without provider
It's real only if there's a package with actual dependency
(conflicts and install_if dependencies do not count).
2014-10-06 14:09:50 +03:00
Timo Teräs 1dc70477b5 solver: fix installation of non-repository packages during tmpfs boot
allow packages in the cache's installed to be selected for installation
by the solver. add test case for the issue.
2014-05-19 11:50:10 +03:00
Timo Teräs 7e64edfad6 test: improve loading of repositories, fix broken install-if test 2014-05-19 11:48:36 +03:00
Timo Teräs 2c4f6bb503 del: allow deletion of world dependency when it is not installed
this happens e.g. after tmpfs boot when not all packages where
available: the dependency is in world, but not installed.
2014-05-19 08:49:55 +03:00
Timo Teräs 1e36692a8a finally fix building PIE binaries
the dynamic applet registration never worked with PIE, and as
a temporary hack -nopie was added to default link flags in 2008.

this commit reworks the applet registration mechanism to something
that is compatible with PIE, and removes the hack. finally!
2014-05-12 19:45:36 +03:00
Timo Teräs 73a03c2e40 db: allow replacing files of origin package is same
basically this makes packager's life simpler as there is no need
to list the subpkg names in replaces. this was also very error
prone and tedious job to do properly.
2014-04-25 22:17:49 +03:00
Timo Teräs 80e64f4c5d package: do not report duplicate reverse dependencies
most notable in error report from 'del' applet
2014-04-10 11:31:13 +00:00
Timo Teräs 9ee8c7ca00 url: double-fallback to static busybox 2014-04-10 12:57:58 +03:00
Timo Teräs c35086dc92 solver: purge install_if packages deleted from repositories on upgrade -a 2014-04-10 11:10:40 +03:00
Timo Teräs 9fa64ca1db solver: fix cleaning of packages that got replaced by provides 2014-04-10 09:52:40 +03:00
Timo Teräs 06071700c5 solver: fix inherited flags/pinning for install_if packages
noticeable fixes upgrading of packages which get pulled in only
by install_if rule. this also simplifies the inheritance calculation
for packages, as well as the place where it is done for install_if
triggered packages.
2014-04-04 13:05:52 +03:00
Timo Teräs ec1a3d57ab solver: do not consider packages in cache as 'available'
'available' really means 'available in one or more configured
repository'. Cache is not a repository we track, so those are
only available for installation, but not available as preferred
to be installed from repository. fixes #2831.
2014-04-04 10:56:13 +03:00
Timo Teräs c39dacf21b audit: report missing files in system mode
fixes #2113
2014-03-12 14:59:49 +02:00
Timo Teräs 065715a377 solver: additional improvements to install_if handling 2014-03-12 13:10:19 +02:00
Timo Teräs d99e82c633 audit: include all files in etc/apk in overlay
This implements a new protected path flag '!' to include always
matching entries in the backup mode (overlay). This is also turned
on for etc/apk to include everything there in overlay, because
the full list of repositories and signing keys need to be in
overlay - just getting them from a package is not enough during
bootstrap.
2014-03-12 09:08:26 +02:00
Timo Teräs 5fdc391c10 solver: fixes to install_if handling 2014-03-11 18:38:39 +02:00
Timo Teräs f19566f6a8 info: fix printing of 'replaces' field 2014-03-07 10:22:03 +02:00
Natanael Copa f8b1c3ef83 fetch: disable all progress/log output with --stdout 2014-02-03 12:09:41 +00:00
Timo Teräs 354ba70dc5 fetch: disable progress when outputting pkg to stdout 2014-02-03 13:08:34 +02:00
Natanael Copa 5ccaa6796f Revert "fetch: run quiet when --stdout"
This reverts commit a99bedba6f.
2014-01-06 15:17:23 +01:00
Natanael Copa b06a43a465 apk: new option --print-arch
Simply print the default arch and exit.
This is so scripts don't need to parse the output of -V.
2014-01-06 14:52:05 +01:00
Natanael Copa a99bedba6f fetch: run quiet when --stdout
Prevent the progressbar and status messages to mess up stdout.
2013-12-10 15:47:56 +01:00
Natanael Copa 1f8b793471 print: flush on apk_log
Makes it more useful whith pipes.
2013-12-05 10:58:23 +01:00
Timo Teräs 5173787218 print: use stdout instead of stderr for logging and progress
stdout is the proper place for it. this also fixes the progress
bar in musl, which seems to not support using line buffering for
stderr.
2013-10-11 14:52:34 +03:00
Timo Teräs a6c4103df5 db: allow using cached packages with --no-network 2013-10-02 16:06:10 +03:00
Timo Teräs 74c4c95976 db, url: fix exec sentinels
http://ewontfix.com/11/
2013-10-01 16:22:29 +03:00
Timo Teräs 2721772488 db: minor improvements to an error and a verbose log messages 2013-09-20 21:54:33 +03:00
Timo Teräs 73820e4a3e archive: fix handling of name lengths of exactly 100 bytes 2013-09-20 21:51:57 +03:00
Timo Teräs cecb810746 db: fix error message 2013-09-20 21:31:29 +03:00
Timo Teräs 1c4223124d apk: new option --no-scripts
to not run any per-package scripts. useful for managing buildroot
when cross-compiling.
2013-09-10 13:51:30 +03:00
Timo Teräs 462bb3b8d3 solver: if pinning is specified, it overrides preferred repos
add also a test case for this
2013-09-06 14:21:59 +03:00
Timo Teräs 0fe8507f9d arch: use armhf for arm hardfloat eabi
at least debian and musl do this, so let's go along with that.
2013-09-05 11:52:12 +03:00
Natanael Copa 1fb5f71154 apk: minor fix in help text and a whitespace fix 2013-08-28 14:23:49 +00:00
Natanael Copa f69f047f25 search: implement --has-origin
This option lets us search for all package with given origin.
2013-08-28 14:17:45 +00:00
Natanael Copa 0a4ff4f534 commit: fix segfault
apk would try run the trigger even if package failed to install.
2013-08-05 10:57:00 +02:00
Timo Teräs 065427f417 commit: don't ask questions if simulating 2013-08-03 17:31:49 +03:00
Natanael Copa ed06091189 solver: do not disqualify already disqualified packages
We should not disqualify non-selectable packages as it would mark it as
dirty, forcing it to reconsider the name again, which could end up in
an endless loop.

fixes #2135
2013-07-17 08:31:40 +03:00
Natanael Copa 21d4e9243a db: fix segfault when --root points to invalid dir
fixes #2134
2013-07-17 08:30:53 +03:00
Timo Teräs 3f8c817b6e del: don't print own name as reverse dependency 2013-07-08 15:18:10 +03:00
Timo Teräs 70e45998ad apk: give more space for applet descriptions on generic help 2013-07-08 15:12:35 +03:00
Timo Teräs 26558bd126 io: use fget{pw,gr}ent_r only on uclibc and glibc
musl does not have those.
2013-07-04 10:36:47 +03:00
Timo Teräs 4fad6d9c15 solver: use ffs (posix) instead of ffsl (gnu extension)
for musl compatibility
2013-07-04 09:00:23 +03:00
Timo Teräs 608ae57ef7 upgrade: prefer not to upgrade dependencies during self-upgrade 2013-07-02 11:05:03 +03:00
Timo Teräs e184571feb defines: detect endianess on arm, for armel 2013-07-02 11:01:05 +03:00
Dubiousjim 927456fd97 Allow "apk search -x" for -e 2013-06-30 11:17:21 +03:00
Dubiousjim d035ef60d2 apk: infrastructure for short-option-only synonyms 2013-06-30 11:16:52 +03:00
Dubiousjim bfa39f6bf6 fix: improve usage
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-28 13:49:39 +03:00
Dubiousjim fbc4d912ab version: clarify usage
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-28 13:48:58 +03:00
Dubiousjim f45aefd961 add, del: main dependencies -> 'world'
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-28 13:47:14 +03:00
Dubiousjim ac7616b0a9 various: applet help text and comment fixes
Acked-by: Natanael Copa <ncopa@alpinelinux.org>
2013-06-28 13:45:41 +03:00
Natanael Copa fcb540ab69 build: lua module build fixes
- do not link with -llua. We should not link apk or lua module with it.
- default to lua 5.2
- allow override the lua version with LUA_VERSION
- allow override the lua pkg-config package with LUA_PC
- only add the pkg-config lua --cflags to the lua module
2013-06-26 16:42:10 +02:00
Timo Teräs a2fa544ac6 db: write ipkg flags in proper place 2013-06-21 11:48:15 +03:00
Timo Teräs 654ddbf05f db: reset broken pkg state on reinstall 2013-06-21 11:45:03 +03:00
Timo Teräs f28e77b64d commit: fix another re-installing misspelling to reinstalling 2013-06-21 11:32:23 +03:00
Timo Teräs e1068ce649 commit: fix ssize_t printing 2013-06-20 15:56:04 +03:00
Timo Teräs 3f27da2ade solver: fix pinning+cache to work
Mistakenly allowed masked out package to be installed if it was
in cache.
2013-06-20 14:08:16 +03:00
Timo Teräs 7e18398781 commit, db: make file conflicts and script errors non-fatal
fixes #1482
2013-06-20 13:12:44 +03:00
Timo Teräs 17145f82ae solver: fix package deletion to consier provides properly 2013-06-19 21:39:01 +03:00
Timo Teräs 6da083fc24 all: few behavioural regression fixes
Wildcard matching with no names should match all packages only for
info and search applet. "apk del" would otherwise try to delete
everything, etc.

Fix also interactive mode to ask questions only if we are actually
changing something.
2013-06-19 20:56:18 +03:00
Timo Teräs e4c65886dd solver: properly order deletion of unneeded packages 2013-06-19 20:46:53 +03:00
Timo Teräs 81152df214 applets: unify help message by removing final dots 2013-06-19 16:49:14 +03:00
Timo Teräs 9c54ef726c fetch, del: perform wildcard matching
ref #511
2013-06-19 14:49:44 +03:00
Timo Teräs a984fd3679 solver: add logic: transitive provides exclusion
If name N is required, and all providers of A also provide B, it
means that only instances of B can be selected that provide N. This
is strong help with cases when so:libfoo.so.1 is updated to
so:libfoo.so.2 and not everything is recompiled.
2013-06-19 13:15:53 +03:00
Natanael Copa 956bd5f032 apk: set automatic flags before parsing the opts
Otherwise we cannot override with --no-progress
2013-06-19 10:00:31 +00:00
Natanael Copa adc5b0b161 print: move progress bar update logic to apk_print_progress
- let the apk_print functions deal with the forced print itself. We
  avoid that the callbacks need to deal with the force flag. We can
  also get rid of the APK_PRINT_PROGRESS_* defines.

- let the reader of --progress-fd decide how often things are updated
  rather than having a fixed granularity off 1/100 (percent)

- avoid detect screen size and percent/bar calculations in case the
  --no-progress was given

- track satistics for both the ascii bar and percent info and update bar
  only if either percent or bar changes. This makes the bar go smoother
  when width is wider than 100 chars and it makes the percent counter
  go smooth when screen width is less thann 100 chars. It also
  simplifies the callbacks as they no longer need to deal with update
  granularity.
2013-06-19 10:00:31 +00:00
Timo Teräs 0c1a26f25c del: fix a segfault when trying to delete uninstalled packages 2013-06-19 11:01:08 +03:00
Natanael Copa 0e9d67aea8 print: percent arg for process_fd is integer
With commit 0a13141889 the percent
variable became an integer instead of size_t. We fix the format
modifier accordingly.
2013-06-19 08:07:37 +02:00
Timo Teräs 8c425a1e33 dot: new option: --installed
to consider only installed packages
2013-06-19 08:48:24 +03:00
Timo Teräs d315c9019c upgrade: new option: --latest (-l)
Select latest version of package (if it is not pinned), and print
error if it cannot be installed due to other dependencies.

Together with --available, it selects the latest package which is
present at least in some repository.

This also fixes few solver issues with ordering of package selection
that got quite apparent with this flag. Namely, we cannot "lock"
a package until it's reverse dependencies are locked or not all of
the solver flags are propagated properly.
2013-06-19 08:33:51 +03:00
Timo Teräs f91b01fea8 errors: fix a test case, and misanalysis of certain names
the pinning11 changed when @repo got the leading @ on error messages.
analyze_dep() now properly ignores conflict dependencies, as those
names are usually intentionally left unassigned.
2013-06-18 16:23:14 +03:00
Timo Teräs 5725f656b0 policy: new applet
to show different versions of package and the repositories from
which it is available from.
2013-06-18 14:54:18 +03:00
Timo Teräs 98c6b46de6 db: store repository tag names including leading @ 2013-06-18 14:30:44 +03:00
Timo Teräs af2b008bab fix, info, ver: perform wildcard matching
ref #511
2013-06-18 13:34:01 +03:00
Timo Teräs fe41ae07b9 apk: use string array in applet mains, separate apk_name_foreach_matching 2013-06-18 13:02:27 +03:00
Natanael Copa c51d82f8f6 url: fix fetching from local repositories 2013-06-18 08:53:35 +00:00
Timo Teräs 01ec60f718 errors: improve analysis for virtual packages
if all packages named N provide the virtual package, list only the
name N instead of all packages providing it.
2013-06-18 08:03:40 +03:00
Timo Teräs 54509e7a1a all: various conversions to foreach_array_item, and simplifications of code 2013-06-18 08:03:40 +03:00
Timo Teräs 72139b82d3 fetch: implement progress (fixes #1170) 2013-06-17 17:51:41 +03:00
Timo Teräs 656190b0a0 io: get rid of APK_PROGRESS_SCALE
no need to muldiv all the time, just pass the current amount of bytes
done, and let callbacks use that directly.
2013-06-17 17:28:03 +03:00
Timo Teräs ade8d0b4e9 cache: implement progress bar (ref #1170) 2013-06-17 17:13:14 +03:00
Timo Teräs 0a13141889 print: move progress printing to common functions 2013-06-17 16:47:49 +03:00
Timo Teräs 92764088a2 db, cache: do not use cache/tmp for downloads
instead use prefix for temporary files.
2013-06-17 16:33:59 +03:00
Timo Teräs 557d360c7f url: remove unused apk_url_download 2013-06-17 14:40:50 +03:00
Timo Teräs 9d10037807 db: refactor repository file construction
Fixes also 'fetch' applet to prefer copying/linking to files from
cache if possible.
2013-06-17 14:38:27 +03:00
Timo Teräs dbb642206d io: fix splice for copying unknown lengths 2013-06-17 14:23:14 +03:00
Timo Teräs f79e3946a4 pkg: apk_pkg_foreach_* add matching generation
So same package it is possible to not match same package multiple
times. Use generation count, so this is handled cleanly during
recursion, like in the use case of search applet.
2013-06-15 22:25:23 +03:00
Timo Teräs 5b02400b26 lua: use apk_dep_analyze
and remove the now unused apk_dep_is_materialized_or_provided
which was superceded by apk_dep_analyze.
2013-06-15 19:48:30 +03:00
Timo Teräs ac0c7457c2 errors: detect self-conflicts properly
and add the provided version information to the conflicts.
fixes the final test case that was broken. hooray.
2013-06-14 21:37:38 +03:00
Timo Teräs 56b623b9e2 solver: use array_foreach_item and clean ups 2013-06-14 21:24:33 +03:00
Timo Teräs edf03b155b audit, index, search, upgrade: use foreach_array_item 2013-06-14 20:26:48 +03:00
Timo Teräs 59d15ab259 solver, errors: fix few additional test cases and clean ups 2013-06-13 21:59:08 +03:00
Timo Teräs 2ff59b7c23 search: speed up searching exact package names 2013-06-13 21:19:30 +03:00
Timo Teräs f4ce2bf4c4 search: fix reverse dependency searching (fixes #2084)
use the new apk_pkg_foreach_reverse_dependency helper to find
the reverse dependencies properly.
2013-06-13 21:12:40 +03:00
Timo Teräs bcda66bf08 pkg: add global reverse dependency iterator helpers and use them
... in the error printing and the package deletion.
2013-06-13 20:48:38 +03:00
Timo Teräs e51232e710 errors: rewrite the logic how errors are reported
Instead of the dependency oriented logic, switch to print them
for each package or name needed. Might give a bit more readable
errors now. There's still few corner cases that proper error is
not output, which are cought by the test cases.
2013-06-13 18:22:00 +03:00
Timo Teräs 25ff68a87e solver: prune broken world dependencies with --force
mostly useful for reboot, when all packages are not available.
2013-06-13 18:22:00 +03:00
Timo Teräs 59678309ea solver: corner case fixes
- try harder to not change anything during self-upgrade
- also honor locking to packages that where earlier used in
  merging common dependencies
- clarify upgrade applet help messages
2013-06-13 18:22:00 +03:00
Timo Teräs e7fd4d03bf solver: rewrite as deductive solver -- pinning support
Fix also pinning test cases to be more sane.
2013-06-13 18:22:00 +03:00
Timo Teräs 426a12686e solver: rewrite as deductive solver -- per name flags
Handle properly per-name preference flags, and add test cases
for testing those via fix applet.
2013-06-13 18:22:00 +03:00
Timo Teräs b8c44536ca solver: rewrite as deductive solver -- core features
Implementing basic dependency handling, install_if and awareness
of pinning.
2013-06-13 18:22:00 +03:00
Natanael Copa f292a85867 lua: support for lua 5.2 2013-06-13 14:21:01 +00:00
William Pitcock 860aa642f0 Revert "Revert "solver: increase score fields to 32-bits (from 16-bits)""
This reverts commit a2d873a77c.
2013-06-12 10:47:11 -05:00
William Pitcock 78ee4267cd libapk, apk(8): fix header inclusion issues with musl's headers 2013-06-12 10:47:11 -05:00
root a2d873a77c Revert "solver: increase score fields to 32-bits (from 16-bits)"
This reverts commit 84bfef1a6b.
2013-06-11 10:30:31 -05:00
Timo Teräs 447b194b26 index: add sensible error message if metadata is too long
fixes #1476

Instead of:
ERROR: Index generation failed: Success

The following is now printed:
ERROR: Metadata for package timo-1.0-r0 is too long.
ERROR: Index generation failed: No buffer space available
2013-05-30 10:22:35 +03:00
Timo Teräs aec93ee730 db: unify handling of special packages
make cache a special kind of repository, and automatically cache
special packages (virtual packages, or ones installed from command
line). add test cases for handling virtual packages. fixes #1617.
2013-05-30 08:48:32 +03:00
Timo Teräs 035da87036 db, info: allow packages to install files/symlinks to root
fixes #1578
2013-05-29 14:37:42 +03:00
Timo Teräs 6a761c72e2 db: make dev/null a character device with --initdb
fixes #1714
2013-05-29 13:44:42 +03:00
Timo Teräs 84bfef1a6b solver: increase score fields to 32-bits (from 16-bits)
We are having so many packages that they might overflow otherwise.
"ERROR: Preference overflow" was already reported.
2013-04-29 14:14:57 +03:00
Timo Teräs 4c08eca3bb upgrade: handle solver failure gracefully
It is internal bug, but don't segfault on it. Fixes #1576.
2013-04-29 14:14:57 +03:00
Pierre Carrier 4d95266e4d apk_hash.h: include stddef.h
Needed for ptrdiff_t in some libcs.
2013-04-18 06:19:45 +00:00
Pierre Carrier 61b4c443c9 *.c: malloc.h->stdlib.h 2013-04-18 06:19:33 +00:00
Timo Teräs 72cd34cf81 solver: remove backjumping by name
It is incorrect optimization causing valid solutions to be skipped.
Any performance it might've gained, should be fixed by reintroduction
of the minimum penalty logic added in previous commit.
2013-01-28 15:34:09 +02:00
Timo Teräs cb98b55b7e solver: reintroduce minimum penalty logic
Basic per-name per-package specific scoring added.
2013-01-28 15:31:34 +02:00
Timo Teräs 528156a9fa solver: do not backtrack over "exclude none"
Otherwise we can return no solution at all instead of partially
satisfied solution (and give proper error message).
2013-01-22 16:23:16 +02:00
Timo Teräs 93bd305713 solver: simplify strength evaluation in constraint handling 2013-01-21 15:37:23 +02:00
Timo Teräs 2a194f3e7b solver: check if solution is not found at all
This is an internal error.
2013-01-21 09:12:44 +02:00
Timo Teräs b960759daa solver: fix reset of last_touched to zero 2013-01-18 16:21:38 +02:00
Timo Teräs cb15b31b79 solver: some code clean ups 2013-01-18 16:20:55 +02:00
Natanael Copa 3c40070752 solver: build fix for debug print on x86_64
use %zu for size_t
2013-01-18 14:46:25 +01:00
Timo Teräs 86a7338575 solver: fix name assignment logic to not mess up internal state
Should get rid of error messages like:
ERROR: Saved_score {4/0/0,74} != score {6/0/0,74}
2013-01-18 11:38:31 +02:00
Timo Teräs e50da7e4a5 ver: fix help message of --limit 2012-11-05 13:59:10 +02:00
Timo Teräs 832dfed637 solver: fix package prefence calculation a bit 2012-11-04 12:13:19 +02:00
Timo Teräs 60f9a03174 del: consider also reverse dependencies for provided names
So we get better error report if package is not deleted due to
reverse dependency.
2012-10-09 13:09:56 +03:00
Timo Teräs 16b70566bf solver: additional backjumping scheme
Enabled when all attempts to satisfy a name failed, we know that we
can ignore all decisions until we find a decision affecting the name
we wanted to satisfy.
2012-10-08 15:22:06 +03:00
Timo Teräs 01d0e4c408 solver: optimize backjumping
to be functional when backtracking
2012-10-08 12:25:43 +03:00
Timo Teräs 831bce5cf9 solver: properly calculate decision "strength" with provides 2012-10-08 11:50:52 +03:00
Timo Teräs dec409c6d4 solver: fix back jumping once more 2012-10-05 17:26:53 +03:00
Timo Teräs bc7e8f5da8 solver: record dependency apk_name in apk_decision
We can't just use the primary name, as that would mess up
backtracking. We need to record the name which caused the name
to get considered - that way the right last_touched_decision is
used on backtracking.
2012-10-05 15:48:12 +03:00
Timo Teräs 4dd8c58df9 solver: various fixes
* push_decision expects to always get the package primary 'name'
   as apk_name. ASSERT that and fix problem cases.
   (though - this might need to be reverted, and store the non
    primary name in apk_decision instead to accomodate for better
    backtracking optimizations)
 * fix error reporting of virtual package names
 * make 'assign_name' errors soft. the incorrect packages just are
   no longer consider instead of aborting whole calculation.
 * fix backtracking of virtual packages that are not depended
   directly
2012-10-03 15:07:31 +03:00
Natanael Copa 081155c438 solver: improve assert error messages
Print name of package and void double "ERROR"
2012-10-03 09:16:28 +02:00
Natanael Copa 00958d9207 solver: fix compile with -Werror on 64bit 2012-10-03 09:04:35 +02:00
Natanael Copa 4b7b5d4668 info: --provides alias -p is reserved for --root, use -P
fixes #1396
2012-09-28 10:25:30 +03:00
Timo Teräs 43850a126b apk: implement --progress-fd to write progress to a specified fd 2012-09-20 15:12:15 +03:00
Timo Teräs 8a4371ccd7 db: remove AT_SYMLINK_NOFOLLOW for directory permissions
fchmodat does not support this flag - symlinks do not have permissions.

Sysadmin probably does not expect us to not follow symlinks either:
if /var -> /mnt/foo/var, we should be making sure the permissions
and ownership is correct on the target directory, not on the symlink.

Since fchmodat never returned ENOENT with AT_SYMLINK_NOFOLLOW, this
also fixes directory re-creation if it does not exist. fixes #1348.
2012-09-04 10:38:13 +03:00
Timo Teräs 0999ec9533 audit: report new directories in recurse mode too
Add new 'd' flag for it.
2012-07-16 16:34:35 +03:00
Timo Teräs ea5b08d1d5 audit: fix protection mask of non-db directories
If a directory has protection mask, but does not exist in db, we
do not handle it right unless we calculate the protection mask by
hand, or create temporary db dir entry for it. For simplicity create
always the db dir entry -- depending on audit type we likely need
to create it anyway. This commit also caches the db dir entry in the
audit tree context to avoid duplicate lookups. ref #1241.
2012-07-16 14:44:15 +03:00
Timo Teräs 5aa6998459 audit: get right protection mask for base directories in the lists
Use the paths' protection mask where available instead of the parent
paths'. ref #1241
2012-07-09 14:59:40 +03:00
Natanael Copa dde96976d3 search: improve output format for --rdepends
- makes -v option useful
- makes --origin --quiet --exact useful for piping and scripting
- makes the default output more readable
2012-06-06 15:32:13 +02:00
Natanael Copa a6b28beef0 ver: show all packages with -v
ref #1122
2012-05-07 10:53:45 +02:00
Natanael Copa 08595072ae ver: make --quiet output suitable for scripting/piping
Do not print version numbers or compare result char when in quiet
mode. This makes the output suitable for be used in scripts or pipes.

For example:

  # Upgrade all packages that matches a given regexp
  apk version --limit '<' --quiet | grep $regexp | apk fix --reinstall

  # Delete all packages that are removed from repository
  apk version --limit '?' --quiet | xargs apk del
2012-05-07 08:58:16 +02:00
Natanael Copa 9154b8b5e4 ver: print '?' when package is not available in any repo
This makes it possible to differ between downgradable packages (-l '<')
and unavailable in repos (-l '?').
2012-05-07 08:51:02 +02:00
Timo Teräs c9a43a1469 audit: apply protected_paths.d masks to individual files 2012-05-01 15:40:31 +03:00
Timo Teräs 38c1e65afb db: strip leading and trailing slashes from protected path spec 2012-05-01 14:30:06 +03:00
Timo Teräs bbba72c694 solver: fix install_if triggers on cyclic and early deps 2012-04-27 09:13:11 +03:00
Timo Teräs 29c7fb359e solver: fix backtracking with install_if dependencies 2012-04-27 08:47:20 +03:00
Timo Teräs 06323b3778 ver: show all versions if package name specified
fixes #1116
2012-04-27 08:39:33 +03:00
Timo Teräs ff83382e21 db: fix has_protected_children setup on leaf path entries
Fixes --recurse during audit.
2012-04-27 08:09:59 +03:00
Timo Teräs a3280c3061 pkg: honor --allow-untrusted when installing non-repository packages
fixes #1072
2012-04-03 13:16:49 +03:00
Timo Teräs 7458e4d3f4 solver: fix a type from previous commit 2012-03-31 23:31:43 +03:00
Timo Teräs a57db1bba0 solver: fix installation of non-repository packages 2012-03-31 23:27:15 +03:00
Timo Teräs ebaf8305b5 info: fix exit code for -e
fixes #1069
2012-03-30 09:20:21 +03:00
Timo Teräs 86bfc631ab build: openssl seems to require -ldl for now, so add that 2012-03-28 11:28:41 +03:00
Timo Teräs 5ae0206d0b solver: properly set allowed flag for installed packages 2012-03-01 15:17:58 +02:00
Timo Teräs 3e429a8100 solver: rename some fields 2012-02-29 13:15:10 +02:00
Timo Teräs 2f66295fc7 solver: merge apk_name_state to apk_name
apk_name_state is now quite small; and we avoid overhead of two
pointers (+ malloc overhead) when we just make it part of apk_name.
It also fixes some problems (that got introduced) where apk_name_state
was not allocated.
2012-02-29 11:26:12 +02:00
Timo Teräs 15adb0475f info: support displaying provides 2012-02-29 08:59:26 +02:00
Timo Teräs f27f194d92 solver, test: make conflicts unconditional
Solver will now never report partial solution where a conflict
constraint is not satisfied. The is because with --force we might
install the partial solution; and if conflicted packages were to
be installed we might have extra trouble.
2012-02-29 08:53:43 +02:00
Timo Teräs 2e8fe783a1 add: allow specifying repository tag with added virtual packages 2012-02-28 14:56:08 +02:00
Timo Teräs fd812dc722 lua: fix bindings, and build by default 2012-02-28 14:36:03 +02:00
Timo Teräs ef53dd52c5 solver: ask confirmation in interactive mode only if there's changes 2012-02-28 11:32:39 +02:00
Timo Teräs c7bd973367 solver: do not consider non-allowed packages in main loop
Instead cache the allowed pinning decision, and use it. Update
install decision heuristic to also use this cached information.
2012-02-28 11:27:56 +02:00
Timo Teräs 2655d27ea1 solver: consider provided names also for preference
ref #574
2012-02-28 11:27:17 +02:00
Timo Teräs 179b453ab7 solver: fix conflicting provides detection
ref #574
2012-02-28 10:28:39 +02:00
Timo Teräs 536c21979b solver: allow multiple packages with same virtual provides
ref #574
2012-02-28 09:39:35 +02:00
Timo Teräs b7a22e555f solver, test: implements more provides things, add tests
ref #574
2012-02-27 16:35:04 +02:00
Timo Teräs 1074c4d326 solver: have most inherited things per-package and clean ups
Required for provides support as package might be pulled in via
non-primary package name. This allows relatively easily to pass
through inherited flags via the provided names. ref #574.
2012-02-27 10:26:30 +02:00
Timo Teräs f0f2029eb1 solver: remove minimum penalty logic
Reasoning:
- it is less useful now that we do not do common dependency merging
- provides support would make the required logic overly complicated
- callgrind reports that depending on the case it can improve or
  decrease performance (the overhead pays off only in some cases);
  the difference is not large either way
2012-02-27 08:29:35 +02:00
Timo Teräs 12bdec38a3 solver, dot: elementary provides fixes
implementation is still not near finished, but now at least it
can handle it to a minimum degree. many cases are not done right
yet, though. ref #574.
2012-02-24 18:29:30 +02:00
Timo Teräs 99145e2c0d all: introduce apk_provides and use it in apk_name
in preparation for provides support. implements also some
dependency satisfaction helper routines.

ref #574.
2012-02-24 16:31:40 +02:00
Timo Teräs 97d44b5a00 solver: unallowed pinning is worse than changing installed package 2012-02-24 16:27:51 +02:00
Timo Teräs d420d41148 solver: non preferred actions are worse then non preferred pinning
Otherwise we might start to change packages unexpectedly when not
upgrading. This also fixes some other things the solver might've
decided to do.

Add also few test cases to detect bad behaviour.
2012-02-24 11:13:31 +02:00
Timo Teräs e128c95fdf pkg: add field for provides as 'p'
ref #574
2012-02-24 10:13:05 +02:00
Timo Teräs 9ef5bf6e2d pkg, db: use 's' for source repository tags instead of 'p'
Will use 'p' for provides.
2012-02-24 09:22:42 +02:00
Timo Teräs 426954fc7b verify: report only bad packages with -q
fixes #1010
2012-02-24 09:00:27 +02:00
Timo Teräs e145738ace apk: do not enable automatically interactive mode with --simulate 2012-02-24 08:47:37 +02:00
Timo Teräs 4676c5d63a test: improve pinning tests 2012-02-24 08:42:40 +02:00
Timo Teräs 1bb2fa7862 solver: fix output of broken dependencies 2012-02-23 22:05:33 +02:00
Timo Teräs 64e5a64442 test: rewrite the testing framework to use the real applets
also merge the expected output to the *.test files.
2012-02-23 22:05:02 +02:00
Timo Teräs 082ffbd3d6 pkg: fix writing of versioned conflicts 2012-02-23 21:33:01 +02:00
Timo Teräs 7392acb95e db: keep architecture in $ROOT/etc/apk/arch
This we use proper arch in case modifying chroot installation.
2012-02-23 17:04:51 +02:00
Timo Teräs a9a84215c7 solver: report size difference in kibi- or mebibytes 2012-02-23 16:02:03 +02:00
Timo Teräs 92d6e99144 apk: /etc/apk/interactive enables interactive mode for tty sessions
In case someone prefers extra quesions while running apk in a
terminal. The file is always from the real root; not from --root
so that we will not accidentally enable interactive mode when in
initramfs bootstrap.
2012-02-23 15:53:35 +02:00
Timo Teräs ba3ee3f863 audit, db: add etc/apk/protected_files.d and new audit features
fixes #607.

audit is now mostly rewritten for the new functionality. And
has new features like --check-permissions, --recursive and
--packages.

$ROOT/etc/apk/protected_files.d/*.list can now contain additional
protected paths, one path per line:

+etc
@etc/init.d
-tmp

+ will include the directory as protected configuration directory.
@ considers the directory protected, but will backup only symlinks.
- removes any protection

lbu should be modified to put include and exclude paths in
etc/apk/protected_files.d/lbu.list. Additionally, some packages
might provide their own listings.

E.g. ssh might want to provide ssh.list with something like:
+root/.ssh
+home/*/.ssh
2012-02-23 15:05:06 +02:00
Timo Teräs a1d16c5d5d db: fix repositories.d to be loaded only without --repositories-file 2012-02-22 17:08:07 +02:00
Timo Teräs 77e203bf32 db, io: load repositories also from etc/apk/repositories.d/*.list
Load additional repositories from $ROOT/etc/apk/repositories.d/*.list
unless --repositories-file is given as parameter.
2012-02-22 13:57:05 +02:00
Timo Teräs d633746892 solver: lock early names that have only single option left
care is needed to get the score right.
2012-02-22 13:09:51 +02:00
Timo Teräs 93a0f0b3cc solver: lazily update name state in main loop 2012-02-22 12:59:46 +02:00
Timo Teräs b9f3db2158 solver: handle fix/reinstall better
In case someone did "fix --force" for package for which we have no
APK available, we would uninstall the package instead of silently
ignoring the request. This could mean worse things.

So now we just consider unavailable packages a bad deal for reinstall
requests. And will downgrade if necessary. But if we really don't
have any APK available, we just skip the request but report it.
2012-02-22 10:31:07 +02:00
Timo Teräs 8e5c040ffd db: merge identical repositories
Just in case same repository is mentioned with different tags.
2012-02-22 09:52:28 +02:00
Timo Teräs a7500a9df5 solver: transitive dependency requiring
If n+1 packages depend A, and A depend on B. Add n+1 dependencies
to B. Otherwise if someone conflicts B, B might be left out.

Leaving package unassigned is no longer a non-preferred action,
this fixes the final test case that was failing.

And with --force we might even install that scenario.
Add also some debug checks.
2012-02-22 09:43:47 +02:00
Timo Teräs 955153eac2 solver: remove dependency merging; it's not worth it
callgrind says it's more overhead than improvement. back jumping
effectively prunes all bad trees. but can be added later if it
becomes needed; due to e.g. provides support.
2012-02-22 09:08:14 +02:00
Timo Teräs bf82e2e5fd db, solver, io: scan cache items at startup
It is faster to just scan the cache directory for existing packages
at startup than trying to faccessat() them on demand. It also makes
quite a few parts of the code more readable and simpler.
2012-02-22 08:45:40 +02:00
Timo Teräs 568d57336d solver: make apk_score a 64-bit int for speed 2012-02-21 11:01:21 +02:00
Timo Teräs c18e159185 solver: remove unneeded flag 2012-02-21 10:36:26 +02:00
Timo Teräs 6f237d9149 solver: implement backwards jumping and various other optimizations 2012-02-21 09:19:24 +02:00
Timo Teräs 6ae573887d solver: rewrite backtracking and scoring system
* properly do absolute scoring now, the previous scoring where
  preference could get reduced could have caused incorrect early
  pruning of search tree

* backtracking is now separated from package state, and first
  branching point is the decision if a name is left unassigned
  or if something _has_ to be assigned. this allows multiple future
  search tree optimizations like handling of common dependencies
  early.

* merge common dependency names early to provide deeper forward
  checking.
2012-02-20 13:02:09 +02:00
Timo Teräs a9d526836e apk: fix some unharmful leaks reported by valgrind 2012-02-17 10:02:44 +02:00
Timo Teräs 15c920ab90 solver: get rid of saved score in backtracking
also, discover late if package is needed or not.
2012-02-17 09:43:14 +02:00
Timo Teräs 4bc8add78d solver: convert some package state flags to bitfields 2012-02-16 21:46:09 +02:00
Timo Teräs 706664c178 solver: name's unlocked chosen is always next package getting locked
Instead of "skipping" certain packages, we include them as-if required,
and at expansion time we decide if they actually need to be considered
for installation. This cleans up the expansion main loop a little bit
and makes the code work together better.
2012-02-16 21:35:05 +02:00
Timo Teräs b0c0b900db solver: rework internals a bit
* cleaned up little bit on the internal state machine
* the decision applying mechanism now aborts early to avoid work
  if we are approaching bad solution candidate
* package availability checking is now done on-demand; which
  could still be improved
2012-02-16 21:11:22 +02:00
Timo Teräs 53f8a36c1f solver: fix allowed pinning calculation 2012-02-16 11:45:54 +02:00
Timo Teräs 0800d7e050 solver: record repository tag, and flags in solution
name state could get overwritten later, so we can't use that when
generating the changeset.
2012-02-16 10:57:52 +02:00
Timo Teräs 7399f1950f solver: remove an unneeded name state variable 2012-02-16 08:28:08 +02:00
Timo Teräs 7a4647d27b ver: handle pinned packages better 2012-02-15 14:28:29 +02:00
Timo Teräs 41fb3a4f9e solver, db: repository pinning improvements
* solver internally calculates now using tags; not repository masks
* installeddb now contains the tag name where the package came from
  -> we can now handle upgrades properly
* the pinning is still a preference, and not strictly enforced;
  versioned dependencies may overrule preference
2012-02-15 13:57:36 +02:00
Timo Teräs 29064d88f3 ver: by default show only upgradeable packages 2012-02-14 16:34:10 +02:00
Timo Teräs ab20d61832 audit: check dirent mode, uid and gid if requested 2012-02-14 16:31:40 +02:00
Timo Teräs 97bd260bfd db: record file uid/gid/mode in installed db 2012-02-14 15:51:26 +02:00
Timo Teräs 087c587e57 db: allow directory to have sticky bit, and suid/sgid bits set 2012-02-10 23:08:10 +02:00
Timo Teräs 9ac8d87102 db, fix: more secure way to choose effective directory permissions
And implement --directory-permissions for fix-applet to reset all
directory uid, gid and modes.
2012-02-10 16:40:01 +02:00
Timo Teräs f2e41a488e db: fix directory permissions recalculation 2012-02-10 15:58:35 +02:00
Timo Teräs 29ebf435d7 db: smarter handling of directory owner, group and mode 2012-02-10 15:21:41 +02:00
Timo Teräs dd923ed065 print: minimum screen width of 50 2012-02-10 15:20:57 +02:00
Timo Teräs 073df81973 blob: fix base64 decoding after previous optimizations 2012-02-10 14:19:53 +02:00
Timo Teräs fe9b4a3888 blob: optimize spn and cspn 2012-02-08 17:01:14 +02:00
Timo Teräs 3320fba50d db: increase hash sizes 2012-02-08 14:02:51 +02:00
Timo Teräs 4aa80564f9 blob: optimize digit and base64 decoding 2012-02-08 14:02:26 +02:00
Natanael Copa 7d88cdc9e4 db: do not abort on bad repositories
Only show a warning if we have a non-existing repository or bad
repository signature but don't abort.

This is not to break compat with behaviour in previous releases.
2012-02-01 17:04:06 +01:00
Natanael Copa ddd386157c db: fix bug with --repository
The 'r' variable is overwritten and no longer holds the repository
number.
2012-02-01 13:41:25 +01:00
Timo Teräs 304dc4a692 pkg, db: fix signature checking for files without control part
Also clean up handling of signature failures for index files.
2012-01-31 15:49:04 +02:00
Timo Teräs 0f89565099 solver: fix regression from "calculate branch minimum penalty early"
Forgot to reset per-name penalty when it got locked by apply_decision.
This also fine tunes compare_package_preference() to always prefer
packages specified on command line speeding up calculation certain
complicated solutions.
2012-01-20 10:39:38 +02:00
Timo Teräs 00fd7b07f1 lua: fix compile error 2012-01-17 15:59:01 +02:00
Timo Teräs b3df78ed03 solver, upgrade: properly detect missing repository tags
* upgrade needs explicit check so we don't try self-upgrade
   (which would print additional messages on screen)
 * add can fix problems, so check against the new world
 * merge the code in few places
2012-01-17 14:48:22 +02:00
Timo Teräs eaaba3ee89 upgrade: make -a reset versioned dependencies like it used to
regression from upgrade to the new solver system.
2012-01-17 14:31:29 +02:00
Timo Teräs 64b03ab603 solver: fix change ordering of removed pages in relation to installed 2012-01-17 14:18:10 +02:00
Timo Teräs 12183024fd solver: calculate branch minimum penalty early
Previously we would cache the penalty when evaluating the final
solution, and adding that until we backtrack to first topology
position changing that penalty. However, we can just keep track
of minimum penalty based on name state, and add it. This allows
us to bail out early on bad branches because we know in advance
how things will turn out.
2012-01-17 14:18:02 +02:00
Timo Teräs 60ee611620 db: print dependencies referring to missing tags instead of tags 2012-01-17 10:53:35 +02:00
Timo Teräs fc57b73101 db: fix loading of world after previous commits 2012-01-16 10:29:49 +02:00
Timo Teräs 2ea61da9d9 add: make repository tag pinning stronger
Previously we would not upgrade just by doing "apk add foo@tag" if
foo was already installed. It required explicit '-u'. This allows
'apk add' to explicitly prefer the newly specified pinning.
2012-01-13 10:39:06 +02:00
Timo Teräs 1f9a36de68 db: support line feed as 'world' dependency separator
* default writing the world with spaces if a space is found
   (for backwards compatibility) for now
2012-01-12 14:33:29 +02:00
Timo Teräs 30965aa867 solver: print repository tag when committing package changes 2012-01-12 11:33:04 +02:00
Timo Teräs f1de353b81 db, solver: refuse committing changes if there is missing tags 2012-01-12 10:42:27 +02:00
Timo Teräs 2372692660 add: fail if repository tag does not exist 2012-01-12 10:27:09 +02:00
Timo Teräs 1de86529a9 pkg: fix writing of deps with tag and version specifier
It is really name(@tag)(>=version).
2012-01-06 13:42:27 +02:00
Timo Teräs 23c39085ce add: print an error about malformed arguments 2012-01-06 13:40:55 +02:00
Natanael Copa 09b28210a2 info: display short info if packages are given
instead of just list all installed package
2012-01-06 10:38:23 +01:00
Natanael Copa 92c75d6b33 test: fix printf of size_t for 64 bit 2012-01-06 09:46:21 +01:00
Timo Teräs 3e8dc3da09 db: properly detect when pkg install trigger needs executing
call apk_pkg_install() and hlist_tail_ptr() only once. the latter
is O(n) and can get very slow.
2012-01-06 10:35:04 +02:00
Timo Teräs bbc31806b9 common: fix apk_array copying, and additional size_t fixes 2012-01-06 10:25:28 +02:00
Timo Teräs 34756e6b87 solver: report number of (mega)bytes used 2011-12-27 14:06:03 +02:00
Timo Teräs 83b098d357 update: report number of distinct packages available 2011-12-27 14:05:49 +02:00
Timo Teräs 415e41a072 info: -e and -W operate on database only (repos not needed)
.. so do not load them.
2011-12-24 15:52:35 +02:00
Timo Teräs d80536b750 solver: fix error detection for certain unsatisfiability cases
did not properly detect as error if name could not be satisfied
due to being available in tagged repository which is not enabled.
2011-11-23 14:35:54 +02:00
Timo Teräs 716ee9e223 solver: fix zero score comparison 2011-11-01 14:44:39 +02:00
Timo Teräs 078e8b00d8 solver: return changeset even for partial solutions
otherwise --force does might not work during boot.
2011-11-01 08:40:50 +02:00
Timo Teräs f13ec9cf5e solver: consider world dependencies to determining exit score 2011-11-01 08:29:24 +02:00
Timo Teräs e36e99f31d cache: fix download 2011-10-31 20:47:52 +02:00
Timo Teräs 918807c45b solver: misc fixes
caused upgrading package X with "apk add path/to/x...apk" where
the package file was not in any repository to not work properly.
2011-10-31 16:51:53 +02:00
Timo Teräs cb5054e686 solver: fix indentation of package lists (in interactive mode)
broken in commit bfd53b59d2 (print: minor cleanup to indented writer).
2011-10-29 23:43:50 +03:00
Timo Teräs 500f8d4a7d solver, db: implement repository pinning
Improves /etc/apk/repositories format so you can say:
http://nl.alpinelinux.org/alpine/v2.3/main
@edge http://nl.alpinelinux.org/alpine/edge/main
@testing http://nl.alpinelinux.org/alpine/edge/testing

After which you can pin dependencies to these tags using:
 apk add stableapp newapp@edge bleedingapp@testing

Apk will now by default only use the untagged repositories,
but adding a tag to specific dependency:
 1. will prefer that tag for the name
 2. allowing pulling in dependencies from that tag (though,
    it prefers untagged packages to satisfy deps if possible)

fixes #575
2011-10-29 05:18:21 +03:00
Timo Teräs e682e6596c solver, pkg: implement versioned conflicts
One can now say in dependency "!foo<2" which means, that if foo is
installed, it needs to be >=2, but it's not a required dependency.
2011-10-24 10:16:40 -04:00
Natanael Copa bd0242e1de lua: adapt to new API
Use new apk_blob_pull_dep instead of the old apk_dep_from_blob
2011-10-20 12:46:13 +00:00
Timo Teräs 8d4d68d818 pkg: convert struct apk_install_package flags to bitfield 2011-10-19 15:26:55 -04:00
Timo Teräs 89d003f8c2 pkg: introduce "replaces_priority"
If two packages replace each other, the one with highes priority
will keep the file. Additionally, if we have a package overriding
another's file it's remembered and handled properly. This is
essentially to allow "policy packages" which just overwrite certain
(configuration) files from other package(s).
2011-10-19 11:38:23 -04:00
Timo Teräs a787038dbe pkg, info: remember installed packages "replaces"
"replaces" is now turned to a full dependency type list, so you can
make package overwrite files only certain versions of the package
(though, we should probably take this into account already at solution
calculation phase).

Also make 'info --replaces' print the "replaces" of the package.

This is in preparation for the policy package support, which still
requires "replacement priority" field to decide which packages' files
get the preference.
2011-10-18 18:11:26 -04:00
Timo Teräs afd854a3e2 solver: preference scoring
Should now choose packages better if the best available version
is uninstallable for some reason.
2011-10-14 21:01:43 +03:00
Timo Teräs 3f098e7d8c solver: return error code if things fail during package install 2011-09-28 14:04:02 +03:00
Timo Teräs f76535cb5e solver: evaluate penalty of unsatisfiable name early
this prunes the search tree considerably and fixes a speed
regression introduced in an earlier commit.
2011-09-28 08:39:52 +03:00
Timo Teräs f4ac687a8a pkg: fix dependency checking against non-installed packages
the solver requires this.
2011-09-27 11:38:16 +03:00
Timo Teräs 012bcbe41c solver: fix backtracking
We need to refresh all name states after backtracking as options
that were excluding due to topology ordering might have become
available.
2011-09-22 13:09:23 +03:00
Natanael Copa 78a372464b all: fix array size data type on 64 bit
The array struct aligned size to 64 bit on x86_64 which caused bad things
to happen.

We use size_t to make sure the size element is correct regardless arch.

Solution found by Timo.
2011-09-20 16:13:20 +02:00
Timo Teräs 51999c97da solver: inheritable solver flags
allow per-name solver flags to be inheritable, and use them in
self-upgrade, add -u  and the fix applet. this gives more familiar
behaviour for the upgrades.
2011-09-16 17:10:50 +03:00
Timo Teräs bcd0d45a49 fetch: reimplement -R after solver changes 2011-09-16 14:09:41 +03:00
Natanael Copa 17918f6765 build: fix make install of shared lib and lua module 2011-09-16 07:12:45 +00:00
Natanael Copa 391cd01b41 lua: implement iterator with installed packages 2011-09-15 17:13:08 +00:00
Natanael Copa 9e60a72b92 lua: implement exists/is_installed
Tests whether given package string is installed
2011-09-15 17:13:08 +00:00
Natanael Copa c79302d973 lua: init fixes
- call apk_atom_init()
- if no open flag is specified, then default to read-only.
2011-09-15 17:13:08 +00:00
Natanael Copa 08533d74fa lua: implement who_owns 2011-09-15 17:13:07 +00:00
Natanael Copa 17b1e1aeca lua: open and close db 2011-09-15 17:13:07 +00:00
Natanael Copa d7374642c2 lua: initial db_open
so far we just parse the db options
2011-09-15 17:13:07 +00:00
Timo Teräs cca6a7e332 solver: fix sorting when solver is used multiple times within run
namely this fixes apk upgrade without --no-self-upgrade when
the solver is called twice.
2011-09-15 09:49:25 +03:00
Natanael Copa 21a213c212 lua: remove unneeded global vars 2011-09-14 14:28:36 +00:00
Natanael Copa 8e887db746 build: support building lua module without shared libapk
Use the build option SHARED_LIBAPK for building shared.
2011-09-14 14:18:23 +00:00
Natanael Copa 3cdee6a406 lua: typecast apk blob len
So we can build with -Werror
2011-09-14 14:14:22 +00:00
Timo Teräs 803f55ece5 solver: make state pointers completely internal
the only bit of information needed in solver commit is the "hard"
topology sorting information for trigger ordering. fixes a bug in
"apk del" which uses the state pointers to do intermediate
calculations between solution solving and commit.
2011-09-14 16:48:28 +03:00
Timo Teräs 6b1a55825a apk: remove unneeded global apk_screen_width 2011-09-14 15:39:53 +03:00
Timo Teräs 4803444731 search: implement --exact and --all
also optimize search to happen for enumeration of package names.
fixes #39, fixes #560
2011-09-14 15:26:43 +03:00
Timo Teräs 3197d0f64a search: implement --origin to print origin package name
fixes #714
2011-09-14 11:56:44 +03:00
Timo Teräs e34d2ed5fd solver, db: run triggers in dependency order
fixes #738
2011-09-14 11:30:35 +03:00
Timo Teräs f95e7e5850 upgrade: --no-self-upgrade option
Use it to avoid self-upgrade loops in case something fails during
the initial upgrade attempt.
2011-09-14 11:07:45 +03:00
Timo Teräs f51aa6d42d upgrade: reimplement self-upgrade (after solver merge) 2011-09-14 10:57:51 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs c6d9962d81 solver: add per-name specific flags, and fix the fix applet 2011-09-13 11:47:34 +03:00
Timo Teräs b42421722e upgrade: fix context allocation 2011-09-09 22:00:49 +03:00
Timo Teräs 7d5cd2c8a0 pkg: consider script failure as non-fatal
Make a loud warning if the script returns failure, but do not
abort installation sequence because of that.
2011-09-09 20:16:48 +03:00
Timo Teräs bfd53b59d2 print: minor cleanup to indented writer 2011-09-09 20:06:10 +03:00
Timo Teräs 4bf13c3d9a del: fix recursive deletion and messages (after solver merge)
Deduce the world dependencies to remove locally, and same for the
additional messages about packages not deleted.
2011-09-09 19:41:19 +03:00
Timo Teräs 31e4f58894 test: fix for updated solver api 2011-09-09 16:52:49 +03:00
Timo Teräs a5a7021658 applets: start using solver code
still todo:
  - 'fix' is missing
  - 'del -R' does not work
  - 'upgrade' does not do self-upgrade first

... and a lot of testing.
2011-09-09 16:32:31 +03:00
Timo Teräs 0e24207c2e solver: report 'complete' solutions with errors
Allow to select packages that conflict in case we are looking for
errors. This allows 'add --force' to install (on boot) the set of
packages with minimum conflicts.
2011-09-05 11:04:00 +03:00