Commit Graph

268 Commits (6ea922cc870c27c25fb377d75a570de676175e5e)

Author SHA1 Message Date
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 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 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 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 cecb810746 db: fix error message 2013-09-20 21:31:29 +03:00
Natanael Copa 21d4e9243a db: fix segfault when --root points to invalid dir
fixes #2134
2013-07-17 08:30:53 +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
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 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 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 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 fe41ae07b9 apk: use string array in applet mains, separate apk_name_foreach_matching 2013-06-18 13:02:27 +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 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 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 59d15ab259 solver, errors: fix few additional test cases and clean ups 2013-06-13 21:59:08 +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
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 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 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 38c1e65afb db: strip leading and trailing slashes from protected path spec 2012-05-01 14:30:06 +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 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 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 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 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 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 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 a9d526836e apk: fix some unharmful leaks reported by valgrind 2012-02-17 10:02:44 +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 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