Commit Graph

92 Commits (917698ec1d4c9a79e3580cce4cbeb56fd4fa5a96)

Author SHA1 Message Date
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 bbc31806b9 common: fix apk_array copying, and additional size_t fixes 2012-01-06 10:25:28 +02: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 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +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 6b24f3c399 apk: improve indented printing
* fixup the help messages to align up properly
 * refresh screen width on SIGWINCH
2011-07-22 12:08:35 +03:00
Timo Teräs 116d9a0ea7 apk: improve progress bar
* make it as wide as the screen
 * make sure it's drawn after package change
 * and draw it using ansi escapes in line buffered stderr
2011-03-19 15:20:47 +02:00
Timo Teräs 59d222d58c upgrade: perform upgrade of apk-tools first if available
Also re-exec's apk-tools to perform rest of the upgrade using
the new apk-tools. This allows handling of new apk-tools features
properly. Fixes #140.
2011-01-01 15:48:10 +02:00
Timo Teräs fca1c30b80 pkg, db: add preliminary support for arch field
Architecture is now:
 - parsed from .PKGINFO
 - written to index and installed db
 - appended to repository URL when fetching files
2010-12-14 17:06:29 +02:00
Natanael Copa 3ec82a5a42 First steps for libapk 2010-06-11 07:02:18 +00:00
Timo Teräs 7be853e637 all: rework how arrays work
Instead of having a null pointer, use a dummy array which just
says the array is empty. This helps in multiple places of the code
which would otherwise need explicitly need to check first if the
array exists. This has been cause of multiple seg.faults in the
past as the array check is easily omitted.

This also removes (or fixes) all existing checks accordingly.
2010-06-05 12:33:54 +03:00
Timo Teras 6417de4d10 apk: remove the unneeded --never-overwrite
turns out the logic does not work with overlays as expected due
to busybox symlinks being unmanaged. remove the useless option.
2009-12-21 16:53:47 +02:00
Timo Teras d0909569c6 apk: --overlay-from-stdin
get list of overlay files from stdin, so those do not get overwritten.
2009-12-21 14:14:02 +02:00
Timo Teras a93a35eeca apk: add --never-overwrite flag (ref #197)
to never ever overwrite a while in the filesystem the user knows
about. it gives the impression of extraction succeeding even though
nothing was done. this is inteded to be used only for bootstrapping
with overlay.
2009-11-06 11:31:03 +02:00
Timo Teras 279513bfbe db: implement triggers (fixes #45) 2009-08-13 14:10:30 +03:00
Timo Teras f02f326238 db: prefer local repositories, and implement --no-network
this helps boots sequence when network is not available.
2009-08-06 16:00:20 +03:00
Timo Teras 6f8526da3e del: add '-r' to remove top-level dependencies recursively
and by default just update the world, and dump a lost of packages
that are not removed. fixes #47.
2009-08-04 10:57:33 +03:00
Timo Teras ea90152664 apk: use *at instead of chdir+normal file syscall
this way we never change cwd, and relative filenames are always
parsed consistently. this also helps filename construction in many
places. this patch also changes '--root' to override location of
all configuration to be in the new root. previously it depended
on the file which one was used.
2009-07-31 16:08:09 +03:00
Timo Teras 1c92602172 apk: add -i/--interactive option (fixes #60)
and use that to figure if questions are allowed or not instead
of the verbosity level.
2009-07-24 14:18:45 +03:00
Timo Teras 90aaa28a95 apk: add --purge option (fixes #61)
and do not remove modified configuration files unless --purge is
specified.
2009-07-22 21:34:25 +03:00
Timo Teras 5375efac1a apk: allow-untrusted option
to not make hard error of untrusted or missing signatures
2009-07-22 16:06:34 +03:00
Timo Teras 93f0b3524c various: more informative error messages 2009-07-22 14:56:27 +03:00
Timo Teras 0a7991f70d various: misc fixes
- error codes for verification failure types
- fix some fdb corruption on file migration
- combine some dependency parsing code
- fix versioned dependencies
2009-07-22 14:24:19 +03:00
Timo Teras e98d8253b9 blob: add some likelyness to help compiler optimizations 2009-07-14 14:08:15 +03:00
Timo Teras e00f5ea74a build: optimize with -O2 by default
also make the array code more explicit to have gcc optimizer happy.
2009-07-14 11:01:03 +03:00
Natanael Copa 080fa825dd implement --update-cache option
This will update the repository cache upon db_open.
2009-07-09 06:08:44 +00:00
Timo Teras bf094dc5ea csum: use openssl instead
instead of having static md5 implemenation, use the openssl
library for digest functions.
2009-07-08 10:45:49 +03:00
Timo Teras c84196e0d3 apk: add --wait option to wait for exclusive lock (fixes #26) 2009-07-07 10:30:54 +03:00
Timo Teras 3a48856475 upgrade: add --available option
That will make the upgrade prefer packages available in repositories.
This is good if one want's to downgrade packages by removing an experimental
repository. Or to force re-install of locally built vs. repository version
when the package version are same, but checksum is different. Fixes #51.
2009-06-25 11:09:40 +03:00
Timo Teras 9567337fd2 fetch: new applet to download .apk files
Fixes #24.
2009-04-15 09:56:09 +03:00
Timo Teras a23f6f4afb state: rework changeset calculation algorithm
Calculate changesets directly by stabilizating the package graph instead of
recalculating the whole graph and then diffing (similar approach as seen
in 'smart' package manager). The algorithm is not complete: defferred
search space forking is missing. So you don't always get a solution on
complex graphs.

Benefits:
- usually the search state tree is smaller (less memory used)
- speed relational to changeset size, not database size (usually faster)
- touch only packages related to users request (can work on partitially
  broken state; upgrades only necessary packages, fixes #7)

Also implemented:
- command prompt to confirm operation if packages are deleted or downgraded
- requesting deletion of package suggests removal of all packages depending
  on the package being removed (you'll get list of packages that also get
  removed if you want package X removed)
- option --simulate to see what would have been done (mainly for testing)
- an untested implementation of versioned dependencies and conflicts

A lot has changed, so expect new bugs too.
2009-04-14 18:48:02 +03:00
Timo Teras a62dcf37c1 apk: --force to overwrite files 2009-03-04 08:36:56 +02:00
Timo Teras 457943f83e apk: --clean-protected option
So you will not get .apk-new files of the new configuration files.
2009-03-04 08:27:06 +02:00
Timo Teras 3e6fc1389f add: --upgrade|-u to control if upgrading is preferred or not 2009-01-16 13:59:36 +02:00
Natanael Copa 50daa05773 info: only show package desc when --verbose
also introduce apk_verbosity. --quiet reduce verbosity and --verbose
increases it.

Default verbosity is 1.
2009-01-16 09:33:55 +00:00
Timo Teras 052fbe3f86 various: make fancy progress bar and update todo 2009-01-07 21:45:11 +02:00
Timo Teras fb911432cb apk_array: clear newly allocated memory 2009-01-06 21:23:26 +02:00
Timo Teras f0609951b9 hash, db: use apk_blob_t and list_* 2008-11-27 20:25:01 +02:00
Timo Teras 8e23a2ba4e db: checksum installed files, protect config files
Checksum of installed is computed on the fly when extracting them
and it'll be saved to fdb. When installing config files those are
diverted with suffix .apk-new if earlier version of same file with
local changes exist.
2008-11-14 14:26:59 +02:00
Timo Teras 219a1b2ee8 Overwriting of bb files, apk_create (from old apk-tools), chdir changes,
other stuff.
2008-04-22 08:16:26 +00:00
Timo Teras 384c2f1d94 Preserve uid and gid. Quiet flag to print dots on progress. 2008-04-22 06:04:20 +00:00
Timo Teras d6c7435242 Initial commit of some stuff written so far. Still in state of flux. Expect
breakage and major changes.
2008-04-17 14:09:13 +00:00