Commit Graph

1000 Commits (5d796b567819ce91740fcdea7cbafecbda65d8f3)

Author SHA1 Message Date
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
Timo Teräs 1fb1afc5c2 solver: reintroduce install_if support
* each package name has two sorting positions, one which causes
   install_if triggers to be run, and other for bulk dependencies
 * fix also inverted ordering of package installations
2011-08-18 13:08:27 +03:00
Timo Teräs 48d368e7d5 solver: move topology sorting to solver code
this allows quite some optimizations to running time and memory
requirements.
2011-08-05 14:34:58 +03:00
Timo Teräs a5146f1b6c solver: generate proper error messages
* the solver no longer does look-ahead locking of names
   (could be possibly optimized later); instead names are now
   always ordered strictly to properly detect the package names
   which are unsolveable
 * basic error tests added, so we can see the most likely problem
   in dependencies easily
2011-08-01 16:21:47 +03:00
Timo Teräs 1a04425fad solver: don't consider package that we can't have
Packages that need (re-)installation but which are not available,
are excluded now properly.
2011-07-27 22:10:44 +03:00
Timo Teräs ad45a6de17 solver: permutate each preferred solution first
The first found solution is the most preferred one then.
2011-07-27 20:45:38 +03:00
Timo Teräs 034c02f0de test: don't crash if the expected files are not there 2011-07-27 15:25:58 +03:00
Natanael Copa 9cd57a8fc7 Makefile: make it possible to override pkg-config via PKG_CONFIG 2011-07-27 05:56:38 +00:00
Timo Teräs 79b53d4d76 solver: new package selection logic (which is not yet used)
* basic code for a backtracking, forward checking dependency satisfier
 * works better when there are tricky dependencies to solve
   (when can't just upgrade everything to most preferred versions)
 * the new code always evaluates all of 'world' constraints
   (old code just does incremental updates based on heuristics)
 * is probably somewhat slower than old code (probably unnoticeable
   difference in most cases)
 * makes easier to write support for provides and repository pinning
 * test applet and a bunch of test cases added which uses the new code
 * from the old feature set install_if is not yet implemented
2011-07-26 17:08:43 +03:00
Timo Teräs 169cb3a97e dot: applet to generate the dot attributed graph language files
This applet can be used to generate data for graphviz tools.
Useful to visualize package dependencies, and possible errors
in the repository.

Usage examples:
  apk dot gnome-desktop | tred | dot -Tpng gnome-desktop.png
    -- to generate simplified dependency chart of gnome-desktop
  apk dot --errors | dot -Tpng index-errors.png
    -- to generate chart visualizing dependency errors in index
2011-07-24 14:56:52 +03:00
Timo Teräs 04950974bf ver: database is not needed for version string checking and tests 2011-07-24 14:24:58 +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
William Pitcock 384eada8af apk_database: add APK_DEFAULT_ARCH for ppc, ppc64 and arm ports 2011-07-16 04:31:27 -05:00
William Pitcock 86a67d4415 apk: use APK_DEFAULT_ARCH in version(). 2011-07-16 04:29:09 -05:00
William Pitcock 37a682e560 apk_database: move APK_DEFAULT_ARCH to headers so that we can use it in version(). 2011-07-16 04:28:41 -05:00
William Pitcock 1c54d13614 apk: display command descriptions in command list 2011-07-16 04:14:58 -05:00
Timo Teräs 9cb0ce545a cache: return error if cache sync or download fails
fixes #666
2011-07-11 11:22:26 +03:00
Timo Teräs 433da92e37 index: handle errors instead of silently failing
Make indexer keep noise about errors that prevent index generation.
Detect certain errors in the APKs better. And also have the applet
return error in these scenarios.
2011-06-28 15:40:52 +03:00
Timo Teräs 95555ede4d db: more fix for read-only cache remounting
remount to read-write before trying to create the cache directory
subdirs. fix a fd leak that might prevent remounting back to rw.
2011-05-27 16:49:25 +03:00
Natanael Copa 38e54240a3 db: remount read-only after the file handles have been closed
The apk cache might be on the readonly media so we need wait with
remounting til after atleast this filehandle is closed.
2011-05-27 11:38:50 +00:00
Timo Teräs 57572979a9 state: fix commit order of packages
commit 4e72075fba introduced a bug where package installation might happen
in wrong order (reminder for self to separate the package version deduction
to separate step from installation ordering). this restricts the earlier
commit to not mingle with the install order.
2011-05-23 15:35:02 +03:00
Timo Teräs c5de3cdc4c db: fix post-install script error message formatting 2011-05-23 15:32:32 +03:00
William Pitcock 9f219e4f46 state: make some of the interactive messages line up with apt which weren't already 2011-04-26 22:49:06 -05:00
Timo Teräs 9901058891 db: remount ro cache to rw earlier for update to work 2011-04-22 11:24:33 +03:00
Timo Teräs 595c66595c apk: default screen width 70 if ioctl says 0 as width 2011-04-22 11:13:32 +03:00
Natanael Copa cec1fa2b0f db: Allow override arch when using --root
This is so we can do x86 --root installs on x86_64 hosts.

Using --arch without --root can make great damage so we only enable it
if --root is used.
2011-04-14 19:59:01 +00:00
William Pitcock 762e0c717b state: make the progress bar look nice 2011-04-09 08:16:46 -05:00
William Pitcock 2911d0cad2 upgrade: Improve english messages on apk-tools/baselibs upgrade transaction. 2011-04-09 08:05:49 -05:00
Timo Teräs 91c4cc6c18 fetch: fix fetching of packages with arch 2011-04-07 14:14:27 +03:00
Timo Teräs 5a9d8323a0 pkg: add origin, maintainer, build_time and commit id to index
Parse these fields from .PKGINFO, and write them to index.
2011-04-04 14:05:52 +03:00
Timo Teräs 0cc2086e27 index: support rewriting of architecture
Our build infra does not yet handle properly noarch, so for the
time being we will rewrite them as native packages in index. This
allows the package to be fetched from the proper URL. This feature
will be removed once abuild and the build infra handle noarch
properly.
2011-04-04 13:19:12 +03:00
Timo Teräs dded261924 state: late locking for install_if package selection
improves behaviour under certain corner case conditions.
2011-03-31 09:22:12 +03:00
Natanael Copa e43ec60874 state: use db in own struc when committing
The db parameter to apk_state_commit is not needed so we remove it.
2011-03-30 12:53:02 +00:00
Timo Teräs 0f6475b884 state, info: implement install_if (fixes #443)
Implement the logic for install_if lines. Update info applet to
also display the install_if related fields.
2011-03-29 16:36:10 +03:00
Timo Teräs 9eeb95470b apk-tools-2.1.0_pre1 2011-03-29 14:51:57 +03:00
Timo Teräs e783f20eff fetch: fix package version print
broke after making the version field an atom because the printf
was not updated accordingly.
2011-03-29 13:09:45 +03:00
Timo Teräs 8e01be4777 apk: fix gcc 4.6 warnings 2011-03-27 02:51:51 +02:00
Timo Teräs 79b7123b09 state: fix late locking of packages
commit 4e72075fba introduced late locking for top level packages,
but used the wrong package's top level flag for the check. this
fixes a problem that dependencies might not get pulled in.
2011-03-27 02:50:48 +02: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 7b6e44b11b upgrade: reset world dependencies during traversal
This allows us to get apk-tools dependencies get reset at proper
time in world. As a bonus, it reduces code amount.
2011-03-19 14:21:58 +02:00
Timo Teräs 4e72075fba state: lock package late for names specified on command line
This will fix certain scenarios where multiple packages are
installed with full package files specified on command line
and they depend on each other.
2011-03-19 14:17:02 +02:00
Timo Teräs 93eb38a31a db: relocate from /var/lib/apk
move all files therein to other places. this allows /var to be
mounted from harddisk, but rest of system be run from ramdisk.

this also removes support for historical version of the scripts
database which was obsoleted in 2.0_pre16 (in July 2009).
2011-03-16 16:53:07 +02:00
Timo Teräs 2222a15edd db: move lock file to /var/lock
in accordance with FSH. this also to clear /var of apk related things
as we might want to run /var as harddisk, but rest of system from
ramdisk.
2011-03-16 15:39:36 +02:00
Timo Teräs 20775276b9 apk: show progress bar by default for tty controlled runs
and make the progress bar disappear on regular runs too.
2011-03-16 15:22:05 +02:00
Timo Teräs 5d64bc5d8c db: fix cache tmpfs detection
comment out the code that was out for testing. duh.
2011-03-16 15:21:41 +02:00
Timo Teräs 415e230a7f db, cache: automatically remount cache read-write when needed
.. and back to read-only after finishing with modifications.

fixes #512
2011-03-16 14:56:13 +02:00
Timo Teräs 1e17da9d70 db: handle arch similarly to stable branch
if package arch is not set, do not append anything to repository.
if arch is set, it is appended to repository.
2011-03-16 14:56:13 +02:00
Timo Teräs 15badbfd97 db: detect tmpfs better
Use statfs() filesystem type, instead of the device IDs.
2011-03-16 14:56:13 +02:00
Natanael Copa ca85bcb7bd url: try wget from $PATH first and fallback to busybox wget
If GNU wget is available, then we want use it as it gives the user
possibility to set misc options, such as bandwidth limit in wgetrc.

It might also be that busybox is not available in case bootstrapping
alpine from other distros (think debian vserver host creating an
alpine guest)

In any case we, fall back to busybox wget in case wget libs are getting
upgraded. (see http://redmine.alpinelinux.org/issues/347)
2011-03-11 08:40:25 +00:00
Timo Teräs 1c6ab67984 db: fix package caching 2011-01-21 09:37:19 +02:00
Timo Teräs 0e450c5fb6 add: use default arch instead of noarch, improve errors
Packages without architecture should get the platforms default
architecture (so we are backwards compatible). Only the virtual
packages should get 'noarch' by default. Also print full path
to the index file which failed.
2011-01-05 14:33:16 +02:00
Timo Teräs 94ce7f01bf db: check and initiailize required package fields before addition to db
The atomization change broke virtual packages because they don't
have license or arch set.
2011-01-04 11:45:34 +02:00
Timo Teräs 28dcd5d3b3 pkg: recognize install_if
Parse install_if from package metadata and include it in the
indexes. Also setup the reverse install_if dependencies when
loading a database. ref #443.

Actual install_if functionality is not yet implemented.
2011-01-04 10:05:20 +02:00
Timo Teräs d8ba07e484 pkg, db: allow index with unsupported features to be loaded
Just disable installation of packages using the new stuff. Also
flag lower case package info fields as non-critical and allow
installation even if that features is not supported.
2011-01-03 21:06:41 +02:00
Timo Teräs 1f42cc1aed version: fix evaluation order to make valgrind happy
otherwise we get reads from uninitialized/unallocated memory.
2011-01-03 19:15:35 +02:00
Timo Teräs 1c7e8d2617 pkg: dependencies to specific package checksum
When package is installed from commandline, we should always
install that specific instance of package (never favor repository
version if it has difference identity). Otherwise we might not
always end-up installing the .apk given on command line. The
dependency is now against specific checksum identity (marked
with >< dependency comparison). Fixes #492.
2011-01-01 16:58:58 +02:00
Timo Teräs 6582676150 various: use APK_DEPMASK_REQUIRE where applicable
.. instead of the longer flag combo.
2011-01-01 16:04:42 +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 0cc41ba4dc index: remove support of old index format
It's no longer needed or used.
2011-01-01 12:17:06 +02:00
Timo Teräs b01d144c69 various: fix breakage from converting dependency versions to atoms
The version now needs to be initialized atom always, since it's
dereferenced in various places.
2011-01-01 12:11:49 +02:00
Timo Teräs aae0a563ed url: use always busybox wget
I think there used to be problems with using http_proxy on bb wget,
but those have been fixed for quite some time. This fixes #347.
We should probably use libcurl or similar library eventually, but
I'm not entirely sure if/when we want that.
2011-01-01 12:09:42 +02:00
Timo Teräs f126316c79 gunzip: fix ordering of boundary callbacks
The boundary callback should not happen until all the uncompressed
data has been consumed. This previously seems to have worked
because normally gzip library returns "no error" instead of the
"stream end" if we extract exactly the amount of bytes remaining
in the archive. (Perhaps this was changed in new zlib.) In any
case, verification was broken with some apks due to this callback
ordering issue.
2010-12-17 09:47:24 +02:00
Natanael Copa cdeb9caaad info: return error if owning package was not found 2010-12-15 10:33:39 +00:00
Timo Teräs 972bec3210 various: use 'atoms' for certain package field and misc fixes
- implement a hash table for commonly shared fields such as
   license, version and architecture
 - use macroes to print blobs or pkgname-pkgver strings
 - fix some old cruft
2010-12-14 19:51:16 +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
Timo Teräs 6e34f048c7 db: remove support for unsigned repository index
Unsigned indexes should not be needed anymore anyway.
2010-12-10 16:42:25 +02:00
Timo Teräs 1f985b9d0f pkg: remove support for obsolete APKv1 (alpine-1.8 and earlier)
should not be needed anymore.
2010-12-10 16:29:40 +02:00
Timo Teräs 6e89c1d5b7 db: print full url/filename of the failing package
.. instead of the pkgname-pkgver string.
2010-12-09 11:10:12 +02:00
Timo Teräs d92df52079 io: enhance istream/bstreams with pipe to forked child
* prunes the child pid to avoid zombies
 * handles the errors so e.g. file-not-found is reported properly
2010-12-09 10:47:09 +02:00
Natanael Copa c9690b0e7c blob: fix segfault on x86_64 with --virtual
blob.ptr might be non-null on empty field in /var/lib/apk/installed
so we compare with blob length.

This fixes a segfault on x86_64.
2010-11-23 09:37:12 +00:00
Timo Teräs 37e8f803a5 db: fix hash lookups on 64-bit machines
The hash is 'unsigned long' everywhere which is 64-bits (on 64-bit
boxes). Fix the one instance of it being 'unsigned int' since that
would be 32-bit and cause lookup failures on 64-bit boxes.
2010-11-23 11:32:42 +02:00
Timo Teräs 6398d338c6 db: fix the previous commit
id cache needs to be initialized early. and group database filename
is surprisingly 'group'.
2010-10-08 16:09:03 +03:00
Timo Teräs 19419f1a88 io, db: id cache should be specific to database root, not system root
Otherwise we end up using wrong uid/gid mappings when doing install
to alternate system root. Fixes #434.
2010-10-08 15:36:54 +03:00
Timo Teräs 28745420d0 archive: resolve uid, gid for file information
the uid and gid are used in other places than just changing file
ownership on extraction.
2010-09-23 15:44:46 +03:00
Natanael Copa 5c4583a902 db: optionally remove dirs when unref
We want remove dirs when they are unreferenced so we remove all dirs on
apk del, but we don't want remove dirs when closing database. So we make
removing dir optional when unreferencing it.

This partially reverts commit c7ffc96a16.

fixes #406
2010-09-22 14:34:35 +00:00
Natanael Copa b4adf7645f Fix building on eglibc
Seems like recent eglibc requires that you include sys/stat.h
2010-08-30 13:04:25 +00:00
Timo Teräs dd6008995a static build: do not use openssl engines
We want minimal static build. And this now also breaks with our openssl
since it tries to automatically dlopen some of the engine modules.
2010-06-30 16:55:50 +03:00
Natanael Copa fc4c60f233 Makefile: do not require lua pkgconfig unless you intend build lua module 2010-06-16 07:37:17 +00:00
Timo Teräs 2dd7ad9a9b upgrade: warn (do not fail) on missing top-level package names
We we can upgrade rest of system just fine then.
2010-06-15 18:34:03 +03:00
Timo Teräs e706f63eda state: handle properly packages which are installed
Installed package does not need to be checked for availability.
Account for packages missing if they get pruned out due to
installability check.
2010-06-15 18:31:45 +03:00
Timo Teräs ec6359732d db: reinitialize trigger_pkg_list node after deletion
The trigger list can be reused after it's cleared, make sure
the list node is initialized all the time.
2010-06-15 14:40:46 +03:00
Natanael Copa efdd2f10f5 Makefile: Don't build or install the libapk and lua module by default
Make the libapk and lua module optional at buildtime and off by default.
This is because enabling libapk requires that mkinitfs also copies the
libapk.so or the initramfs will not work.

To build libapk:

 make LIBAPK=yes

To build lua module (will enable LIBAPK=yes):

 make LUAAPK

To link apk to libapk (will enable LIBAPK=yes):

 make SHARED_LIBAPK=yes

All the above applies to make install target as well.
2010-06-14 09:41:06 +00:00
Timo Teräs 8b317678e3 db: --simulate never needs write access to db
So open the db in read-only mode instead. This allows --simulate to
be run as non-root user.
2010-06-12 13:48:42 +03:00
Timo Teräs 3062d681f9 archive: honor username/groupname instead of uid/gid
Take the uid/gid from passwd and group.
2010-06-12 13:43:29 +03:00
Timo Teräs 43cb554c3f various: use O_CLOEXEC and add some error checking 2010-06-11 13:42:21 +03:00
Timo Teräs bcbe575c3b build: fix CFLAGS, and use pkg-config for lua 2010-06-11 13:41:52 +03:00
Natanael Copa 11925542d8 print: clean up after copy-paste 2010-06-11 07:09:25 +00:00
Natanael Copa 36d1bfb4ed db: make apk_wait a part of dbopts 2010-06-11 07:02:18 +00:00
Natanael Copa 7aed449427 lua: initial lua module 2010-06-11 07:02:18 +00:00
Natanael Copa 3ec82a5a42 First steps for libapk 2010-06-11 07:02:18 +00:00
Natanael Copa 60b537e356 db: do not free trigger list after package is unpacked
The triggers are read during apk_db_unpack_pkg(). If we delete the
triggers list after then unpack we delete the triggers which is not
what we want.

This fixes bug introduced in ce3cf8bff9
2010-06-10 17:50:11 +00:00
Timo Teräs 8ac170c49d info: fix usage of arrays 2010-06-08 14:26:35 +03:00
Timo Teräs efe90d43c8 state: fix error printing 2010-06-08 10:24:21 +03:00
Timo Teräs f85d87e5f9 db: fix usage of apk_name_array in install_ctx
got broken to the previous array cleanup and grepping struct
definition only from headers.
2010-06-07 17:45:04 +03: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 Teräs 069c898984 state: fix a crash in error printing 2010-06-03 22:03:02 +03:00
Timo Teräs ce3cf8bff9 db, pkg: fix triggers related crash
clean up the triggers properly, in proper order.
2010-06-01 16:46:53 +03:00
Timo Teräs 440cffef58 state: print missing package names on error
especially important if the package requested from command line
does not exist. otherwise we would not print an error at all.
2010-06-01 15:06:48 +03:00
Timo Teräs 038b672061 state: improve error messages from dependency failures
Print more information why installation changeset calculation failed.
Fixes #187.
2010-06-01 11:49:32 +03:00
Timo Teräs 2165547bad state: modify reinstallation prints
To print upgrading if package is actually being changed instead of
pure reinstall.
2010-05-27 16:19:14 +03:00
Timo Teräs 4fde5f101a state: show changed packages as upgrades
If version is equal, but package contents are different we should
show the package being upgraded.
2010-05-27 16:01:29 +03:00
Timo Teräs 4a21764ee1 state: fix deletion of obsoleted dependencies
In addition to autocleaning dependencies on deletion, we need to
autoclean the old package on upgrade too. This is to make sure that
obsoleted dependencies (existed previously, but not in new package)
are removed where appropriate.
2010-05-27 11:34:17 +03:00
Timo Teräs fe55da7074 package: don't leak signing key file fd
openssl BIO does not close the fd unless we explicitly tell it to
do so.
2010-05-26 14:30:08 +03:00
Timo Teräs d9bf4aabff search: add search for reverse dependencies in index
So it'll be easier to rebuild affected packages. Fixes #349.
2010-05-19 16:49:32 +03:00
Natanael Copa 47bac8c29c upgrade: reset versioned deps in world when doing upgrade -a
Doing "apk add file.apk" adds a versioned dependency to allow
downgrading, and sticky version. Most often this is to install
single packages from newer repository. So it would make sense
to reset them to non-versioned if doing:

 apk upgrade -a

fixes #346
2010-05-12 06:08:18 +00:00
Timo Teras 87420aaf29 info: fix querying of removed, but referenced packages
Check that package name has packages associated with it before
dereferencing the pointer. Fixes #345.
2010-05-05 08:56:06 +03:00
Timo Teras e3f919a4f5 state: virtual packages are always installable
they do not have any package associated. this is indicated by
package with zero installed_size.
2010-03-15 09:16:14 +02:00
Timo Teras b40b2f0429 state: check package availability always
even if we have only one package as candidate, we need to check
it's availability. otherwise we can endup with bad changeset
referring to unavailable package.
2010-03-10 14:55:31 +02:00
Timo Teras ef7d467083 fetch: do not include installed non-repository files in search
we do not create mirror repositories from other valid repositories,
not from what was installed locally.
2010-03-04 14:01:37 +02:00
Timo Teras 4b29ea2a08 cache: do not download files existing in local repository
wget:ing local files results in error and is useless.
2010-03-01 11:27:27 +02:00
Timo Teras 49f5d8cb01 db: fix previous commit
add the missing variable.
2010-03-01 11:26:45 +02:00
Timo Teras fcdb316ab7 db: read also non-repository package index if reading repository indexes
otherwise regeneration of non-repository index might go wrong or we
might delete too many files from cache when doing 'cache clean'.
2010-03-01 11:20:17 +02:00
Natanael Copa 2d7171b2e7 Merge branch 'master' into prog 2010-02-26 13:35:45 +00:00
Natanael Copa 028990d576 state: write status for each package change
prints like:
(1/12) Installing...
(2/12) Installing...
etc...
2010-02-26 13:27:09 +00:00
Natanael Copa 69b5357390 state: show percent in progress bar
This makes things a little bit nicer when installing from network with
slow lines.
2010-02-26 13:26:16 +00:00
Natanael Copa 9f3fbedcc9 add: print all failing packages instead of only first
We want see all packages that fails to install and not only the first
2010-02-26 12:57:06 +00:00
Timo Teras 3f9fe4c28b db: keep packages with no files with installed status
got broke few commits ago when apk_pkg_installed() call was
moved to happen after the package name has been read.
2009-12-25 14:15:10 +02:00
Natanael Copa d67ee300b6 state: Default interactive action is Yes
When pressing only <enter> on the question "..continue [Y/n]?" then
lets take that as a "yes"
2009-12-25 07:17:06 +00:00
Timo Teras b58ec46f7c db: make fdb load package description before calling pkg_install
this is now mandatory after the overlay fixes. otherwise the
package will not get listed as installed.
2009-12-22 17:33:44 +02:00
Natanael Copa d4f0b2ab70 db: check the overlay files package name rather than the ovl file itself 2009-12-21 16:39:53 +00:00
Timo Teras 884fabbf30 db: honor overlay file even for protected paths 2009-12-21 18:12:45 +02: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 f44f34811d db: accept files in overlay without directory
appears this is possible, so support it.
2009-12-21 16:31:58 +02:00
Timo Teras f2a7800b22 db: use proper instance for overlay file entries
lookup proper directory instance as the tar output might not be
linear.
2009-12-21 14:30:33 +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 366e7d07ae db: read time only once when writing scriptsdb
less syscalls.
2009-12-21 11:42:39 +02:00
Natanael Copa 407ef801d9 db: check if target exist before renaming tempfile
do not overwrite target if we have --never-overwrite and target exists.

ref #197
2009-11-24 08:25:24 +00:00
Timo Teras 98de535355 archive: overwrite protection needs to use real filename
otherwise we always extract the file as .apk-new and the database
side just overwrites.
2009-11-06 16:16:49 +02:00
Timo Teras 4dd183f3c1 version: add support for version control suffixes
add cvs, svn, git and mercurial tags for creating snapshot
packages.
2009-11-06 13:29:58 +02:00
Timo Teras ff45ff3152 version: fix remaining version comparisons
even more corner cases found which were broke. now all tests
should pass.
2009-11-06 13:21:00 +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 44ac0b06af version: fix comparison of version again
-t 1.3-r0 1.3.1-r0 was broke
2009-11-05 17:49:12 +02:00
Timo Teras a7360395ea db: fix migration and pruning of symlinks to dirs
the old code treated a symlink to directory as file; it tried
to calculate regular has of it. fix this by: 1) using no follow
on migration and pruning stats, and 2) the helper function to
check if it's point to directory and not calculate hash in that
case. fixes #188.
2009-10-26 09:46:09 +02:00
Timo Teras cc4644a54e version: fix comparision of pre-suffixes
got broke in 0b9bfa8d52 which
fixed another corner case. hopefully it's good now. fixes #191.
2009-10-26 09:33:12 +02:00
Timo Teras aebe73549f pkg: fix parsing of empty dependencies
if the dependencies are empty with only trailing new line, the
parsing was incorrect. fix the new line check.
2009-09-16 20:23:34 +03:00
Timo Teras d3861d70a8 version: --index output to stdout instead of stderr 2009-09-04 11:38:19 +03:00
Natanael Copa 330dc5511a index: do not segfault if there are no description 2009-09-03 13:15:10 +00:00
Timo Teras 58e771303c index, version: support for repository descriptions (fixes #141)
ability embed description information to repository indexes
(e.g. repository name and version) and show it via "apk version -I".
2009-09-03 14:56:24 +04:00
Timo Teras f936d78d5f state: require an available package for re-installs
otherwise we would not be able to pick a package that exists
as a candidate for re-installation. fixes #138.
2009-08-19 15:37:21 +03:00
Timo Teras f9b2035897 fix: upgrade also mentioned package (fixes #136) 2009-08-17 15:37:19 +03:00
Timo Teras 0b9bfa8d52 version: fix comparison against empty version 2009-08-17 14:24:13 +03:00
Timo Teras 9e71df3cf3 db: cache needs to be on non-tmpfs
check device major if it's tmpfs and refuse to use cache if
we've been fooled.
2009-08-13 20:27:33 +03:00
Timo Teras e20ce5a9c0 db: fix script arguments
the first item is place holder for argv[0] = script name. it's
overwritten by the apk_pkgi_run_script.
2009-08-13 19:21:31 +03:00
Timo Teras 6c96730cdf add, del, db: fix various bugs introduced by earlier commits
- make virtual packages work again
- make apk del (for non-empty packages) work again
2009-08-13 18:41:03 +03:00
Timo Teras 892395d594 add: refuse to add bad dependencies to world
allow also overriding old (possibly bad) world dependency.
hopefully it's more bullet proof now.
2009-08-13 16:02:02 +03:00
Timo Teras 6b94ed8a7a fix: parse pkgfile properly (fixes #132)
accept also pkgfile in addition to pkgname. make also the signature
verification stuff work properly again with non-repository files.
2009-08-13 14:33:43 +03:00
Timo Teras 279513bfbe db: implement triggers (fixes #45) 2009-08-13 14:10:30 +03:00
Timo Teras b71606dbf4 info: clean ups, print triggers (ref #45) 2009-08-13 10:45:48 +03:00
Timo Teras 05f016481a db: fix some (unimportant) memory leaks 2009-08-12 19:29:14 +03:00
Timo Teras 36b5cee98b db, pkg: separate structure for fields of installed packages
this makes the database package entry smaller, and we propbably
get more fields to installed_package later too. this cleans up
the way scripts are stored and is a preparation for supporting
triggers. some parsing for trigger meta-data. ref #45.
2009-08-12 19:17:46 +03:00
Timo Teras dee6ffa492 io: better error handling when writing stuff out
also have the output stream support writing to temporary file
and do renameat/unlinkat on close depending on if all writes
succeeded or not.
2009-08-12 11:05:09 +03:00
Timo Teras bd9835a20e archive: update for new place of checksum in tar header
and take checksums for symlinks too.
2009-08-11 19:57:30 +03:00
Timo Teras addae04c26 db, audit: audit symlinks (by hash of the link target) 2009-08-11 19:02:22 +03:00
Timo Teras 949d375aa9 db: fix checking of non-repository files from cache
otherwise, non repository files present in cache are not
considered for installation (e.g. when booting from cdrom).
2009-08-11 18:28:22 +03:00
Timo Teras 5d19789a3b pkg, db: execute scripts from /var/cache/misc (fixes #129) 2009-08-11 17:56:24 +03:00
Timo Teras 1011c4e346 db: fix previous commit 2009-08-11 16:01:29 +03:00
Natanael Copa 6dd59d7817 db: ignore empty lines in /etc/apk/repositories
fixes #127
2009-08-11 09:22:12 +00:00
Timo Teras bc93eaffb0 db, pkg: fix package verification during installation
some hooks to package verification code were missing causing the
verification to not be done (causing pre-script to be not run).
fixes #124, #126.
2009-08-10 08:47:05 +03:00
Timo Teras a120a96db4 state: installed package does not need downloading
so do not skip it even if it's no longer available.
2009-08-06 17:19:01 +03:00
Timo Teras 8ae244db7d add: world needs to be updated before state instantiation
otherwise old world deps are used and unintended results will
happen.
2009-08-06 17:04:40 +03:00
Timo Teras ba005f2e97 state: bug fix 2009-08-06 16:54:59 +03:00
Timo Teras bf7b80662d state: do not look into world in state_new
instead enforce world dependencies when the package name
is first referenced upon.
2009-08-06 16:39:09 +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 ced1fa83d6 state: indent package lists 2009-08-06 15:34:33 +03:00
Timo Teras 974a00bc5f state, update: fixes 2009-08-06 14:50:51 +03:00
Timo Teras ecdacd1503 all: implement database open options
so user can override trusted keys directory and repositories file.
2009-08-06 14:25:03 +03:00
Timo Teras fac43e2d60 db: make missing index non-fatal
it's a warning not an error to have non-existant repository.
bad signature means tampering; but we might want to just ignore
those. this is especially important if we have http repositories
and we are bootstrapping (without network).
2009-08-06 13:12:26 +03:00
Timo Teras 20b3c7c8b3 audit: do not load repositories
they are not needed, and cause errors if signing keys are not
present.
2009-08-06 13:09:38 +03:00
Timo Teras 0b2052ed06 state: ignore missing world dependencies with --force and --quiet 2009-08-06 11:47:44 +03:00
Timo Teras 6f1de8cd53 db: command line repositories take preference
over the ones in config file. also remove the apk_root == NULL
check as this cannot happen anymore. a valid root is always
required.
2009-08-06 10:17:28 +03:00
Timo Teras 7419771b02 audit: fix --backup 2009-08-06 08:57:50 +03:00
Timo Teras 2cfca5b6ed info: fix a --exists to work if the name is non-existant 2009-08-05 19:11:32 +03:00
Timo Teras f14cbbf4e5 info: support dependency style tests in package existance checking 2009-08-05 15:36:46 +03:00
Timo Teras 46e9329568 io: flag for following symlinks on fstat
usually we are interested on the actual file's length. but
audit is interested about the link. so add a flag for this and
use it in audit.
2009-08-05 13:13:52 +03:00
Timo Teras 856181a032 fetch: --link is -L for short, not -l 2009-08-05 12:45:02 +03:00
Timo Teras 1a67a8e2b6 state: world might be empty
so do not choke on it.
2009-08-05 12:28:00 +03:00
Timo Teras bb77b01244 index: root is needed for signing keys
so initialize db with a root, but avoid loading state or
repositories.
2009-08-05 09:28:25 +03:00
Timo Teras a602c49b31 db: support "replaces" directive (fixes #113)
it will allow to overwrite files owned by some other packages
to get upgrades right (e.g. when splitting or renaming packages)
2009-08-04 16:54:15 +03:00
Timo Teras 1fea5639b4 fix: new applet to reinstall and fix package
also makes it possibly to upgrade package without adding it to
top-level deps. fixes #69.
2009-08-04 15:19:29 +03:00
Timo Teras ec2ade1542 state: fix world dependencies to be honored always
previously they might have been skipped on certain situations.
this also fixes some other reverse dependency enforcements and
implements new "pending" state for locked name.
2009-08-04 13:57:54 +03:00
Timo Teras 8c19869c29 db: return hard error if repository opening fails
otherwise we can accept unsigned repositories, and install bad
packages.
2009-08-04 11:08:19 +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
Natanael Copa 59dcbfefee archive: compile fix
We need the define for uint16
2009-08-03 11:42:26 +02:00
Timo Teras 1029d15ecd db: jump through hoops to get checksums for hardlinks
should really fix abuild-tar.
2009-07-31 20:05:04 +03:00
Timo Teras 4a5147ff42 audit: sanitize --system
make the system audit compare only installed files, instead of
scanning the whole file system. also make it print only package
names with -q, so reinstalling modified packages becomes easy.
2009-07-31 19:35:45 +03:00
Timo Teras 123226bad2 db: load cache's installed index only if cache is active
other wise cache_fd points to var/lib/apk and contains the real
installed db causing it to be loaded twice.
2009-07-31 19:35:08 +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 67108bf07a io: fix corruption of big files on mmap write
remember to increment destination pointer; and munmap the proper
base address.
2009-07-31 10:50:55 +03:00
Natanael Copa fe43d8ab1d db: allow update of untrusted index 2009-07-30 19:16:37 +00:00
Natanael Copa b3596ff247 verify: report missing files rather than segfault 2009-07-30 14:29:20 +00:00
Timo Teras c1fe6d08f3 db: fix checksum storing to db
also take precautions in audit code if the db is missing the
checksum.
2009-07-30 11:55:59 +03:00
Timo Teras 5b48b85560 audit: protection mask for "symlinks only"
and use it for /etc/init.d by default. fixes #99.
2009-07-30 10:42:20 +03:00
Timo Teras 60c668f1dc io: keep static pointer to copying buffer
so we avoid some malloc/free calls.
2009-07-30 09:11:14 +03:00
Timo Teras 8e4075e6b1 io: fix mmap writing to actually work
apparently it needs to have both PROT_READ and PROT_WRITE. and
it needs to be MAP_SHARED for the writing to be effective. oh,
and the data needs to be preallocated with ftruncate; otherwise,
one gets SIGBUS.
2009-07-30 09:07:35 +03:00
Timo Teras f482701eee db: fix protected directory handling (fixes #89)
we don't want to do checksumming of existing files unless it's
in a protected directory. also, we keep the original file if it's
*modified*.
2009-07-29 19:39:59 +03:00
Timo Teras 2ff4059b9a io: use mmap to write archive entries to disk
avoids some copying and system calls.
2009-07-29 19:33:52 +03:00
Timo Teras 7b05eef61f tar: make checksumming of inner files conditional
and force checksumming only when unpacking archive. otherwise
it's extra computation for nothing.
2009-07-29 19:16:04 +03:00
Timo Teras 2887e04cd7 build: make install depend on main targets
apparently the double colon rule dependencies affect only the
specific rule-set.
2009-07-29 19:07:14 +03:00
Timo Teras 8cacc96bf0 tar: don't call digest finalization twice
otherwise bad things happens. avoid this be checking end of
stream at the beginning of read.
2009-07-29 19:06:10 +03:00
Timo Teras 6092865d85 add, fetch: make handling of special options more logical 2009-07-24 14:23:33 +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 195859b3fd db: fix repository write locking 2009-07-24 14:12:59 +03:00
Timo Teras 8e66768cd2 pkg: remove implicit bb dependency when install script is present
this dependency is now inserted automatically by abuild.
2009-07-24 14:06:03 +03:00
Timo Teras e1b489c8b5 db: increase required verbosity for filename prints 2009-07-24 14:04:57 +03:00
Timo Teras c8c52e1dc6 db: remove APK_NAME_VIRTUAL flag
use the package 'installed_size' == 0 as a test instead for
dependency only packages.
2009-07-24 14:02:56 +03:00
Timo Teras e5be34335c db: create cache index with non-repository packages
this enables virtual packages and files specified from command
line to work on non-harddisk installs.
2009-07-24 14:00:57 +03:00
Natanael Copa 8806ce875e archive: append .apk-new to hard link targets
Otherwise will link(2) fail since it does not exist.
2009-07-23 13:19:48 +00:00
Timo Teras 042879f417 index: fully process archive when reading index for signature check
can't cancel an index reading or we lose signature checking.
2009-07-23 11:41:10 +03:00
Timo Teras a388f4bfa6 index: more informative error message
when failed to load an existing index.
2009-07-23 11:35:40 +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 83ae16feb8 audit: add --system option
to check system files for changes.
2009-07-22 21:28:39 +03:00
Timo Teras 79f43861e6 signing: verify and generate identity
fixes verification of non-repository packages while installing
them. this is final thing needed for full signing support
(fixes #46).
2009-07-22 21:04:54 +03:00
Timo Teras 718ef3079e add: fixes to installing non-repository package
make sure cache is enabled on non-permanent rootfs setups.
some optimizations and fixes too.
2009-07-22 20:47:21 +03:00
Timo Teras 9b77c053e8 pkg: cleanup the signing code
smaller callback and less cases to check. also reintroduce the
oneshot digest flag, hopefully correct this time.
2009-07-22 19:56:13 +03:00
Timo Teras 9b63730d84 state: fix previous commit to show OK when everything is ok 2009-07-22 16:19:12 +03:00
Timo Teras 9dc60e8d1c state: commit fdb changes even on error
we might have done already something.
2009-07-22 16:11:21 +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 23582a0ec5 db: honour clean-protected flag again 2009-07-22 16:00:14 +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 0dadc27ce1 db: fix protected directory handling
do not overwrite untracked files.
2009-07-22 12:00:56 +03:00
Timo Teras 680a301511 various: installation fixes
- extract everything as .apk-new and overwrite only after data
  has been checksummed
- url construction fixes (to work with simple http servers)
- end of gunzip stream fixed
- remove oneshot digesting flag for now as it's usage was broken
2009-07-22 11:36:55 +03:00
Timo Teras 772e4aa26a various: fix installation of new style apks 2009-07-21 18:25:22 +03:00
Timo Teras 2345548e45 index: read also new style index files 2009-07-21 17:59:08 +03:00
Timo Teras 812483515a pkg: fix indexing of multi-part apks 2009-07-21 17:37:44 +03:00
Timo Teras 75802cb07d db: increase hash sizes a bit 2009-07-21 14:26:06 +03:00
Timo Teras 1339b14365 db: don't run pre-install until control data is verified
to make sure the scripts have not been altered.
2009-07-21 14:06:35 +03:00
Timo Teras 84e3786e05 db: fixes to package checksumming while installing it 2009-07-21 13:49:35 +03:00
Timo Teras be8b59dbe1 gzip: fix finalization of compressed output
the unflushed data when closing file can be several thousand kiloes,
loop until all is written out.
2009-07-20 15:20:37 +03:00
Timo Teras 89d1abe4e6 db: write errors about repository update (fixes #70) 2009-07-20 11:41:45 +03:00
Timo Teras eca9c22205 db: signed index loading (ref #46)
prefer index in the new format as signed .tar.gz.
2009-07-20 11:13:03 +03:00
Timo Teras 99be653f14 pkg: filenames with '/' cannot be control data 2009-07-20 08:56:53 +03:00
Timo Teras e30834fdcb digest: use oneshot context flag where approriate
speeds up digest calculation on some cases.
2009-07-17 15:56:09 +03:00
Timo Teras 0942832325 index: fix output file permissions, verify signed index (ref #46) 2009-07-17 14:29:02 +03:00
Timo Teras 65be7ade1d pkg: remove debug prints 2009-07-17 14:09:52 +03:00
Timo Teras d694025b91 pkg: fix index generation
that got broke during verify implementation.
2009-07-17 14:06:43 +03:00
Timo Teras 3f4f9e9957 verify: new applet (ref #46)
an utility to check package signature and integrity.
2009-07-17 13:07:52 +03:00
Timo Teras 50fed1063e pkg: .PKGINFO field for data checksum is 'datahash'
in future we might add datahashalg to specify the algorithm used.
2009-07-16 15:32:21 +03:00
Timo Teras 251656734d archive: use the abuild-tar mangled checksum if available
to speed up apk installation avoid calculating checksums.
2009-07-16 15:27:00 +03:00
Timo Teras 6b471bb614 various: new style index generation
change the index generation to do old index, or the new style index
where package identity is sha1 of control block and it's contained
within an .tar.gz to allow signing in future.
2009-07-16 15:16:05 +03:00
Timo Teras 0f6d96a4f5 gzip: always autoclose the inner stream 2009-07-16 13:47:26 +03:00
Timo Teras 6715a0ba12 pkg: remove support for the deprecated .INSTALL script 2009-07-16 08:52:22 +03:00
Timo Teras 623bc9c5a8 index: reuse existing index (fixes #25)
replace the old 'delete' option, with 'index'. the idea is that
one can provide existing index files to take cached meta-data of
the package from (assumes package has not been modified if index is
newer, and package size has not changed).

this way one always gives the list of .apk files to include in
the new index, and the old index is used only as "cache".
2009-07-15 16:47:43 +03:00
Timo Teras ba76c5f48a cache: make cache cleaning work again properly 2009-07-15 15:59:06 +03:00
Timo Teras a7c5fda40a blob: base64 encoding and decoding
and prefer sha1 checksums to be stored in base64 encoded format.
2009-07-15 14:48:57 +03:00
Timo Teras bfabf8f8d9 pkg: fix package scanner to read whole archive
otherwise we don't get chechksum anymore after the changes to
support partial gzip checksumming.
2009-07-15 08:38:30 +03:00
Timo Teras 981bc118f8 db: live with sha1 and md5
this also convers scripts file to a tar archive.
2009-07-14 19:14:05 +03:00
Timo Teras e9eaedff50 db: remove debug print
was left there unintentionally while debugging stuff.
2009-07-14 17:44:31 +03:00
Timo Teras e98d8253b9 blob: add some likelyness to help compiler optimizations 2009-07-14 14:08:15 +03:00
Timo Teras 8d1eeb58e4 blob: some helpers to replace snprintf
snprintf is dog slow. make the blob stuff have some helper functions
so we can use them in code paths that are executed often.
2009-07-14 13:27:21 +03:00
Timo Teras ab37bd0b0c db: speed up fdb creation
avoid recalculating hashes, and store the lengths of names, so
we can optimize some operations.
2009-07-14 11:55:08 +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
Timo Teras f1985b03bd hash: allow caching of hash value 2009-07-14 10:47:20 +03:00
Timo Teras 4562f44f9b bstream: make tokenizable and load index using bstream
some fixes on index reading code too.
2009-07-14 09:33:47 +03:00
Timo Teras e69b81f525 io: move csumming away from bstream to gunzip
in future we want to checksum on gzip boundary basis, not the
full file.
2009-07-13 20:37:03 +03:00
Timo Teras b30024d2bd openssl: register engines, and use oneshot digest when possible
to actually get hardware acceleration if available.
2009-07-13 14:28:52 +03:00
Timo Teras 3cbccbaf99 gunzip: accept concatenated gzip streams
allow .apk to consist of multiple separate gzip streams which
are just concatenated together.
2009-07-10 13:53:47 +03:00
Natanael Copa fa47cadb98 db: removed apk_repository_update_all() as its no longer needed
We use APK_UPDATE_CACHE apk_flag instead.
2009-07-09 06:25:27 +00:00
Natanael Copa d931f9fe5c ver: implement --limit
Support for limiting output for only showing the packages who have
the status we are interested in. For example --limit '<' will only
list packages that have a newer version available.

While here, we also fix so packages that are not in any repository
are displayed with '?'.
2009-07-09 08:17:58 +02: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 f1125dfcde db: check cache directory early
we need to know if caching is enabled, before the repositories are
added. otherwise the cache is not used properly at db opening time.
2009-07-08 16:19:53 +03:00
Timo Teras a3d19b5c0d apk: initialize openssl
add all ciphers and built-in engines so we get e.g. hw acceleration
of sha1 when available.
2009-07-08 16:19:06 +03:00
Timo Teras b54ff5dd1e build: link zlib dynamically, use --as-needed
use pkgconfig of zlib instead of hard requiring it. and link in
the pkg-config libs with --as-needed as not all of the openssl
libs are really required.
2009-07-08 10:46:38 +03: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 1531192cb9 add: ignore install failures on 'apk add --force'
and use this option in initramfs, so we are likely to get an usable
environment even if some packages from world are missing. fixes #50.
2009-07-07 10:03:30 +03:00
Timo Teras 812a6a3167 ver: fix output indentation 2009-07-07 09:45:09 +03:00
Timo Teras dc5c436c5a cache: delete also wget temporary files
check for the full filename to match an expected pattern or
delete it (so we delete files with .new, .new.backup, etc.).
final part of remote package caching: fixes #49.
2009-07-07 09:40:59 +03:00
Timo Teras b551c3b081 cache: use changeset to figure out downloadables
that way we get the same result as the 'apk add world' at boot
time; it might differ from currently installed set (ref #49).
2009-07-07 09:33:13 +03:00
Timo Teras 1a54de02b5 db: open flags revisited
more fine grained control what to load, and rename some of the
flags to be shorter.
2009-07-07 09:27:56 +03:00
Natanael Copa 4d940c7932 fetch: respect --simulate option 2009-07-06 08:48:25 +00:00
Natanael Copa d313c5e3cb info: fix compiler warning on x86_64
printf %i does not work so well with size_t on 64 bit.
Use %zu which seems to be portable enough.
2009-06-30 09:43:58 +00:00
Timo Teras 9858ffff69 cache: new applet (ref #49)
Administrative tool to download or delete files to/from the cache.
2009-06-29 11:22:55 +03:00
Timo Teras 233918e518 db: cache packages (ref #49)
If /etc/apk/cache is a symlink to directory, a copy of all installed
packages is stored there, and the index of remote repositories will
be there instead of /var/lib/apk. This enables to reconstruct running
system during boot.

Left as todo: remove cached copy when the package is removed, and
additional apk applet to download missing packages to cache and/or
remove extra items.
2009-06-29 09:29:57 +03:00
Timo Teras fac4cdb3fa blob: function to checksum a blob
And use it in couple of places. Some whitespace fixes too.
2009-06-28 18:52:40 +03:00
Timo Teras 7a29678aac help: auto construct help
And add some more verbosity to the help message.
2009-06-25 15:14:07 +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 4d04bd8a46 upgrade: new applet
Currently just goes through all world dependencies and updates them
where possible (ref #51).
2009-06-25 10:31:05 +03:00
Natanael Copa 5eab547de6 package: removed debug code 2009-06-22 09:41:49 +00:00
Natanael Copa 5b75b40bf9 version: added apk_version_compare_blob() function
We want be able to compare blobs so we basicly revert the old change,
and make a wrapper that takes version strings.
2009-06-22 11:08:39 +02:00
Natanael Copa 4bbed2d648 ver: only compare the given packages, show version
make apk_version_compare() take strings rather than blobs
add apk_pkgversion_compare(), a wrapper that takes packages
2009-06-20 12:38:07 +02:00
Natanael Copa cb074581f0 db: add function apk_repository_update_all
We might want to add an --update-index option to misc applets. For
example:

  apk add --update-index -u package
  apk version --update-index
2009-06-19 19:01:15 +02:00
Natanael Copa b669e488ed info: support for -d, --description
and re-arrange the order of displayed info
2009-06-19 18:35:17 +02:00
Natanael Copa 01268f7f01 info: allow multiple subactions at the same run
By using a bitmask we can combine subactions
2009-06-19 18:20:27 +02:00
Natanael Copa 7703f981d9 info: add size and webpage to usage 2009-06-19 17:36:05 +02:00
Natanael Copa 378ae7b02c info: add -w,--webpage and -s,--size options 2009-06-19 17:29:45 +02:00
Natanael Copa 61213c4018 improve --help output
apk --help will list the generic options only and give a list of commands
To get the details for a spefic command, 'apk command --help' should be used.
2009-06-19 15:40:37 +02:00
Natanael Copa 20a1217e86 add: support for forced versions
Support version numbers specified with packages. For example:

 apk add 'busybox<1.14'
 apk add 'squid=>3.0'
2009-06-16 09:59:21 +00:00
Natanael Copa d8b1b851c7 fetch: use lstat to verify filesize on existing targets
since we dont verify the checksum we dont need to calculate it
Speed up when you try fetch lots of stuff thats already there.
2009-06-16 09:57:34 +00:00
Natanael Copa 0dfc53b0c3 state: bugfix in the package version selector 2009-06-16 09:55:45 +00:00
Timo Teras 49c904c993 io: fix mmap bstream fd leak
We need to close the fd on destruction. This is what the corresponding
istream variant does too.
2009-06-11 13:03:10 +03:00
Natanael Copa 3646350479 fetch: readlink does not end buffer with \0
According the manpage readlink(2) does not append a null byte to buf.
So we have to do it ourselves.
2009-06-11 09:21:17 +00:00
Natanael Copa 64a85ec65d fetch: do not create hardlinks to softlinks but to softlink targets
Otherwise the iso image will have softlinks which is not what we want
2009-06-11 08:39:51 +00:00
Natanael Copa cd5d44fa9d fetch: removed debug message
leftovers from a debug session.
2009-06-09 09:58:34 +00:00
Natanael Copa 50cdcca833 fetch: added --link/-L option
fixes #42

This will also fix a bug that left an empty file in destination dir when
source file did not exist in repository.

There are still issues with paths longer than 255 chars.
2009-06-09 11:12:06 +02:00
Natanael Copa c8c9851369 fetch: fix fd leak
we should always close the in-stream, not only on failure.
2009-05-26 14:23:12 +00:00
Timo Teras 9b0c0a2053 Revert "add: replace coffe-cup with starwars"
This reverts commit 0906a1c7de.

Conflicts:

	src/add.c
2009-05-25 16:58:32 +03:00
Natanael Copa d584b19c32 state: upgrade deps for given packages to add -u 2009-05-24 15:20:35 +02:00
Linux User 651aa71ac2 add: fix segfault when no params are given 2009-05-21 20:24:07 +00:00
Natanael Copa 0906a1c7de add: replace coffe-cup with starwars
saves space
2009-05-21 14:54:07 +00:00
Natanael Copa a9640ba8e6 add: coffe-cup 2009-05-21 14:20:22 +00:00