Commit Graph

912 Commits (8a41fd98a420dacb1390af553e6e3c56a3580bc1)

Author SHA1 Message Date
Timo Teräs 8a41fd98a4 solver: more debug output for package errors 2015-12-10 13:45:18 +02:00
Natanael Copa c43bfed8de db: add support for --no-cache
Implement --no-cache. The index is read directly from network and not
cached. This is useful for docker, where you install a set of packages
and directly after purge the cache. (see
1fc9e59d16/builder/scripts/apk-install)

fixes #4905
2015-12-07 12:50:32 +00:00
Timo Teräs 14b74c4dc0 apk-tools-2.6.5 2015-11-12 13:22:37 +02:00
Timo Teräs 31ed887a64 info: fix --installed test of conflicts 2015-11-12 13:11:55 +02:00
Timo Teräs 5a59c73ffd add armv7 target 2015-11-12 09:24:02 +02:00
Timo Teräs cce4cff553 io, database: preserve [am]time for cached and fetched files
preserve [am]time for all packages and indexes. this fixes the caching
error that 'apk update' is after new index is generated, but before
the used mirror is synchronized. this caused local apkindex timestamp
to be newer than file in mirror, when in fact it was outdated index.

this also fixes fetched files to have build timestamp so that files
going to .iso or custom images have proper timestamps (rsync with
appropriate --modify-window now works)
2015-11-09 12:51:01 +02:00
Timo Teräs 7501f6012f search: match packages only once
fixes #4770

apk_name_foreach_matching() can matches each package via it's
main name and all it's provides. Print matched packages only once.
2015-11-09 10:06:57 +02:00
Natanael Copa 707b51e0c6 io: fix posix_fallocate failure handling
We need fall back to a splice buffer if posix_fallocate call fails due
to file being a device (eg tty) or a pipe. This fixes apk fetch --stdout.
2015-10-08 11:42:23 +03:00
Andrew Wilcox 1bc31bdf22 blob: Add missing header 2015-10-08 11:35:09 +03:00
Timo Teräs 875bb43d7c apk-tools-2.6.4 2015-09-11 13:48:32 +03:00
Timo Teräs d99214ea55 db: stop extract more files if disk is full 2015-09-03 13:20:59 +03:00
Timo Teräs 9ffa38222b io: use posix_fallocate to allocate disk space
ftruncate does not allocate it, and subsequent access to mmaped
file will result in SIGBUS. this fixes to properly report disk
full errors.
2015-09-03 13:15:18 +03:00
Timo Teräs 0e87d08d2d apk-tools-2.6.3 2015-07-03 13:11:06 +03:00
Timo Teräs 57de8d0c5d relocate lock file to /lib/apk/db
the problem is that var/lock is on root installs symlink to /run/lock
(on tmpfs) and does not exist if doing chroot() to that root. fixes
apk to work when chrooted to existing rootfs install.
2015-07-02 09:56:50 +03:00
Timo Teräs 68453b99e6 remove db dir entry properly, so it can be recreated properly if needed
fixes #4261
2015-06-26 16:28:22 +03:00
Timo Teräs 9dd161c2b4 apk-tools-2.6.2 2015-06-12 12:10:35 +03:00
Timo Teräs 5ecc97e724 add simple stats applet 2015-06-12 11:20:01 +03:00
Timo Teräs 3e8e2b5622 free atoms when VALGRIND is defined 2015-06-12 10:32:54 +03:00
Timo Teräs c4295e9cf8 for completeness free all arrays before exit
so valgrind does not report any leaks
2015-06-12 10:18:06 +03:00
Timo Teräs 6b140ec5c7 fix bstream_from_fd to use mmap when available 2015-06-12 09:57:52 +03:00
Timo Teräs f08fee9528 fix search --has-origin to not leak memory 2015-06-12 09:48:29 +03:00
Timo Teräs 36d730e95d optimize base64 decoding a bit
it's a hot path for decoding checksums in fdb
2015-06-12 09:08:31 +03:00
Timo Teräs ed94d8ffba use murmur3_32 hash
it is more efficient than the previously used djb hash
2015-06-11 16:54:13 +03:00
Timo Teräs 4fab9290b6 speed improvements for database opening
resolve reverse dependencies after all packages have been loaded,
and avoid traversing the reverse name lists. now that we use
automatic virtual packages (soname, pkg-config, etc.) the reverse
dependency chains can become considerable longer than what it was
when the rdependency construction code was originally written.
2015-06-11 16:21:53 +03:00
Bobby Bingham e01b29e2fa search: fix swapped needle and haystack 2015-06-10 08:08:56 +03:00
Timo Teräs c088f2a692 apk-tools-2.6.1 2015-06-03 15:29:21 +03:00
Timo Teräs 37b65f1c01 fix directory permissions loading
commit 941fc1b1 uncovered a bug that directory permissions are
not updated properly at db load time if it's the default acl.
2015-06-01 11:22:58 +03:00
Timo Teräs eef2e02b29 apk-tools-2.6.0 2015-05-26 11:49:59 +03:00
Alex Dowad 4c3712ecb4 detect failures in writing to file during final flush of buffers
In practice this should fix to e.g. not wipe out /etc/apk/world if
final flush to /etc/apk/world.new fails.

This was prompted by an incident the other day where I ran the root
partition of an Alpine box out of space using 'apk add', and apk
helpfully wiped the contents of /etc/apk/world at the same time.

It might be tricky to try to reproduce exactly the same failure,
but from an examination of the code, setting 'rc' before the final
call to fdo_flush rather than after is one possible cause of this
behavior. (If the entire contents of /etc/apk/world.new are buffered,
and all get written out in the final fdo_flush call, and that call
fails, fdo_close will still happily rename /etc/apk/world.new to
/etc/apk/world.)
2015-05-26 08:38:45 +03:00
Timo Teräs c6d273fc34 apk-tools-2.6.0_rc4 2015-04-24 10:12:03 +03:00
Timo Teräs 997aa99e3d do not extract files with malicious name
the security implications are not as high as compared to regular
tar/unzip archiver. this is because you are anyway trusting
the package to install files anywhere in the filesystem.

this serves rather as a sanity to check against errors in created
package.
2015-04-24 09:54:54 +03:00
Timo Teräs c4960a1a7d allow virtual packages beginning with dot by default on tmpfs installs
the allows update-kernel script to work on tmpfs install before
cache is configured.
2015-04-24 09:33:09 +03:00
Timo Teräs fd98e9c718 modifications for the previous commit in error message handling
forgot to --amend my changes
2015-04-24 09:32:22 +03:00
Alex Dowad 74dc8e232f print.c: provide more detailed error messages if retrieving a package fails
fetch_maperror() translates error codes returned by libfetch to our error
codes. Handle those in apk_error_str(), returning error messages which
advise the user of the most likely fix.

A custom error code, EAPKSTALEINDEX, has been added for cases where
retrieving a package fails due to a HTTP error 404 or similar.

[TimoT: add also EAPKBADURL, as well as organize a bit better where the
EAPKSTALEINDEX is generated]
2015-04-22 20:08:16 +03:00
Alex Dowad be31eb24d8 io: fix compiler error by including stdint.h
According to the C standards, uint32_t is defined in stdint.h.
Presumably apk is usually built against C libraries where
stdint.h is indirectly included through another header file,
but this isn't the case with the version of glibc which I am using.
2015-04-22 10:50:31 +03:00
Timo Teräs 0ed9a55b7d apk-tools-2.6.0_rc3 2015-04-17 11:21:06 +03:00
Timo Teräs 1a5d6d06d6 fix issue introduced in previous xattr error handling changes 2015-04-17 10:34:49 +03:00
Timo Teräs 820098d6ad disable xattrs on symlinks for now
there's no nice syscall to manipulate xattrs with atfd and
or open the symlink without dereferencing it (and having fd
that we can do xattrs with)
2015-04-17 10:07:49 +03:00
Timo Teräs 90e760339e make file install errors non-fatal, and xattr errors hidden
user xattrs on tmpfs are not supported no non-grsec kernels,
and many times root fs is mounted without user_xattr. Thus
to allow things to go smoothly on non-grsec kernels xattr
unsupported errors are now hidden.

xattrs can be fixed still now with "apk fix --xattrs"
2015-04-17 10:05:10 +03:00
Timo Teräs 60867c47c5 apk-tools-2.6.0_rc2 2015-04-13 10:43:55 +03:00
Timo Teräs 3490ff789a fix tee io error handling
use ERR_PTR mechanism, and handle it at all places.
2015-04-13 09:42:27 +03:00
Timo Teräs 4395532932 fix error mapping types
on arm char is by default unsigned, so this caused crashes
as the ERR_PTR mechanism did not work as expected with unsigned
types. extend the array type to be signed short explicitly.
2015-04-13 09:42:27 +03:00
Natanael Copa 2322ba0ad9 update: return errors also with --quiet
fixes #4040
2015-04-10 17:33:21 +00:00
Timo Teräs 60dd5798c9 use memmove for copying buffer leftovers, as the ranges may overlap
issue cought by fortify
2015-04-08 16:58:20 +03:00
Timo Teräs 29bb67e01e apk-tools-2.6.0_rc1 2015-04-08 11:25:53 +03:00
Timo Teräs 9ed5a60dec unbreak audit after xattr support 2015-04-08 11:16:46 +03:00
Timo Teräs 23d0a2244a ignore .apk-new files for overlays 2015-04-08 11:08:16 +03:00
Timo Teräs 941fc1b10c make default dir/file acl implicit
apk in alpine 3.1 already supports this optimization, but kept
the database format. now is time to start using this feature.
2015-04-08 10:58:00 +03:00
Timo Teräs 83ab022301 audit xattrs
ref #3027
2015-04-08 10:27:49 +03:00
Natanael Copa 944eae4b27 update: return failure if any mirror update failed
fixes #4040
2015-04-07 10:49:51 +02:00