Commit Graph

1050 Commits (bc0ed3774aa78dcd8b9cd97edaffdab7f60ffb4d)

Author SHA1 Message Date
Timo Teräs b45415b109 add: fix virtual package id generation
Fixes 37fbafcd by adding more input to the hash than just second
grained time stamp - collisions would happen when running apk
scripted.

For virtual package the hash works only as unique identifier, so
try to add elements that should make it unique in most cases.

Fixes #10648
2019-07-02 15:27:57 +03:00
Timo Teräs 366d0ee371 print usage and exit with error on invalid arguments
Add also some testing to make sure help, long help and handling
of invalid arguments works as expected.

Based on pull request #19 originally by Laurent Arnoud (@spk).
2019-06-05 09:56:13 +03:00
Timo Teräs c3a93a4aa5 fix all applets to return -ENOTSUP if it's unrecognized
The return -1 seems to have been left over from earlier code, and
could have been treated as -EPERM. This helps to fix the other command
line handling that potentially require changing.
2019-06-05 09:32:29 +03:00
Timo Teräs b0be9f610c solver: fix common dependency merging to inherit pinning and flags
Notably this fixes occasional issues when doing upgrade with multiple
versions of same packages. Without this the upgrade flag is not always
propagated properly down the dependency chain.
2019-06-05 08:51:00 +03:00
Timo Teräs 1c47f37443 use fixed system time in test mode to have fixed test output
fixes test suite regression from previous commit
2019-06-03 16:19:17 +03:00
Timo Teräs 37fbafcd92 add: make virtual packages upgradeable (ref #9957)
Originally the virtual packages could have dependencies added to it.
However, commit b06e3b99 broke this behaviour to fix error reporting.
The root cause however was that the virtual depedency package was not
properly versioned.

This fixes to use current date/time as the package version, and
constructs the "faked" package hash from it. This effectively makes
"add -t virtpkg deps.." replace the dependencies which should be the
desired behaviour for "abuild deps".

'world' dependency to the generated virtual package is also now
versioned to make sure it get's upgraded.
2019-06-03 09:33:43 +03:00
Ian Douglas Scott d901444ec9 Fix compile with glibc 2019-05-28 13:07:50 +03:00
A. Wilcox 84941a5967 list: Detect orphaned packages correctly
BIT(1) corresponds with decimal 2, which is the first available repository.

Before this fix, `apk list -O` would list every package installed from the
first available repository, which is the 'system' repository on most Adélie
Linux computers.

After this fix, `apk list -O` correctly lists only the packages which are
no longer available.
2019-05-01 18:56:43 +03:00
Timo Teräs 44daf80873 fix strncpy bounds errors
error: 'strncpy' specified bound 4096 equals destination size [-Werror=stringop-truncation]

Based on patch by Elan Ruusamäe <glen@delfi.ee>
2019-02-13 16:05:27 +02:00
Elan Ruusamäe 86922d1a34 include sys/sysmacros.h for makedev definition 2019-02-13 15:32:22 +02:00
Natanael Copa 947baeea18 fetch: fix error message for --recursive
Give error message for `apk fetch --recursive missing`
2019-01-10 09:29:35 +01:00
Timo Teräs bd8967bcb7 Revert "move --simulate to global options"
This reverts commit 358f703b76.

The short option -s conflicts info --size and fetch --stdout.
Revert this for now.
2018-11-15 12:03:51 +02:00
Timo Teräs 0565e9bb05 fix orphan package handling for certain provides cases 2018-11-12 15:00:14 +02:00
Timo Teräs 47570f80e9 prefer selecting packages by their primary name 2018-11-12 14:16:36 +02:00
Timo Teräs a86c8ed082 fix package preference based on it's conflicts in --latest mode
remove also redundant pkg_selectable check in repair mode.
2018-11-12 13:20:14 +02:00
Timo Teräs c3fe426da0 fix short option string to be nil terminated 2018-11-02 17:42:46 +02:00
Timo Teräs b06e3b991d fix error reporting for virtual package addition
Move addition of virtual package after the dependencies have been parsed
as then the reverse dependency structers can be populated correctly.
2018-11-02 17:41:34 +02:00
Timo Teräs 31338affc2 don't report virtual packages as masked 2018-11-02 17:12:20 +02:00
Timo Teräs 22abda2af4 inhibit printing same 'required by' dependency multiple times
this would happen if same package matched multiple times due to
multiple provided names.
2018-11-02 15:40:53 +02:00
Timo Teräs 59271f8c13 print: don't print spurious newlines 2018-11-02 15:40:45 +02:00
Timo Teräs f38d1f74af fix xattr hash to be sha1
The hash type was accidentally changed in previous commit. Currently
csum->data cannot hold longer hash, so fix the hash.
2018-10-30 18:26:10 +02:00
Timo Teräs beab8545eb add support for openssl 1.1 2018-10-26 08:22:08 +03:00
Timo Teräs 40ffdfe623 apk: fix all_options array size off-by-one
merge_options() will write one more entry to the options table
which is the end-of-table indicator. Allocate memory for it too.
valgrind did not pick it up due to being in stack; changing alloca
to malloc would make valgrind notice the issue too.

Reported-by: Mobile Stream <info@mobile-stream.com>
2018-10-05 09:45:02 +03:00
Timo Teräs 0e3be0fd4a cache: support --latest and --upgrade to affect download policy 2018-09-25 13:07:42 +03:00
Timo Teräs 358f703b76 move --simulate to global options
there are several applets that support simulation but are not
committing changes to database
2018-09-25 13:06:40 +03:00
Timo Teräs 4c6fc81474 add: add --latest flag to help analyze why upgrade fails 2018-09-11 10:34:14 +03:00
Timo Teräs 6484ed9849 rework unpacking of packages and harden package file format requirements
A crafted .apk file could to trick apk writing unverified data to
an unexpected file during temporary file creation due to bugs in handling
long link target name and the way a regular file is extracted.

Several hardening steps are implemented to avoid this:
 - the temporary file is now always first unlinked (apk thus reserved
   all filenames .apk.* to be it's working files)
 - the temporary file is after that created with O_EXCL to avoid races
 - the temporary file is no longer directly the archive entry name
   and thus directly controlled by potentially untrusted data
 - long file names and link target names are now rejected
 - hard link targets are now more rigorously checked
 - various additional checks added for the extraction process to
   error out early in case of malformed (or old legacy) file

Reported-by: Max Justicz <max@justi.cz>
2018-09-10 10:59:39 +03:00
Timo Teräs 7b654e1254 apk: sanitize return value
Most applets return whatever apk_solver_commit() returns. It is the
number of errors found (or negative for hard error). Sanitize the
error value to not give false success exit code in the unlikely case
of errors % 256 == 0.

Reported-by: Max Justicz <max@justi.cz>
2018-09-05 10:21:22 +03:00
Natanael Copa 13c534db77 prevent automatic repository index update with --no-network
We should not update repository index when --no-network is specified.

ref #9126
2018-08-21 12:25:37 +00:00
Jesse Young 1d55b9488f archive: enable FIFO extraction 2018-08-14 23:27:08 +03:00
Timo Teräs e1a05c74cb prevent automatic repository index update for 'apk del'
ref #9063
2018-07-18 13:29:13 +03:00
Jussi Kukkonen d609ef3c6c Invalidate id cache after script execution
It's common for a pre-install script to do something like
    addgroup -S group 2>/dev/null
When apk installs files after this, it sets the owner/group based on id cache
but currently the id cache is stale and doesn't contain the new group at that
point: instead the file will be installed with gid that the build host
happened to have for that group -- on target this might mean a non-existing
group or a completely different group.

We can't know if the script really did modify id cache contents so make sure
to reset the id cache on every script execution.
2018-07-02 10:06:53 -05:00
Sören Tempel 5c4b90dfd4 list: fix segmentation fault with virtual packages
Virtual packages have the origin pointer set to NULL. Trying to print it
using the BLOB_PRINTF macros causes a segmentation fault.

Inspired by the `print_origin_name` function from `src/search.c` this
commit attempts to fix it by checking whether `pkg->origin` is NULL
before attempting to print it. If it is NULL the pkg name is printed
instead.

Since printing the pkg name requires a different format string this
commit splits the printf call for printing the package line into
multiple ones. The output format shouldn't have changed at all though.
2018-07-02 08:52:22 -05:00
Timo Teräs 7561a501b4 fetch: ignore conflicts when solving --recursive fetches 2018-06-14 20:40:05 +03:00
Natanael Copa 611172b7a9 fetch: include install_if dependencies with --recursive
Run apk_solver_solve once with all args as dependencies instead of
running apk_solver_solve for each arg. This is neccesary so the
install_if calculation is done correctly.
2018-06-14 18:55:06 +03:00
Edan Bedrik dafbb1c4f4 url: return relevant error value from apk_istream_fetch 2018-05-08 22:44:23 +03:00
Timo Teräs 258519b1cd db: fix refreshing index if time is zero
During netboot on systems without RTC, time() will be near zero,
and the index fill not exist. Thus the plain test of st.st_mtime
against system time failed. Verify that fstatat() succeeds.
2018-04-05 09:57:17 +03:00
William Pitcock 0dcbd933c8 solver: allow names with only one provider to be autoselected regardless of priority 2018-02-21 15:35:53 +00:00
William Pitcock a5d9e2eb0a add: child dependencies can never take a pinning, give a useful error 2018-02-20 22:22:02 +00:00
William Pitcock dc7298122e apk: in test mode, always exit 0 (so the test harness doesn't stop running tests) 2018-02-20 22:21:27 +00:00
William Pitcock d52285c9aa list: use `apk list --providers` to search virtual providers instead of enabling virtuals by default 2018-01-29 03:17:07 +00:00
William Pitcock d379edd5bf search: remove from APK_COMMAND_GROUP_QUERY
list does everything search does and more
2018-01-29 03:03:15 +00:00
William Pitcock 3334624cd1 list: add option to match against real names only instead of providers 2018-01-29 02:59:39 +00:00
William Pitcock 368b8b6725 list: add --depends option for searching based on rdepends 2018-01-29 02:55:29 +00:00
William Pitcock 8fcb57bf0f list: refactor package dumping vs package filtering 2018-01-29 02:39:39 +00:00
William Pitcock fff8bfa588 list: new applet
The list applet provides a convenient way of inspecting both the available
and installed package databases by listing their contents.  In some ways,
it is similar to `apk search` but is considered to be a superset of
`apk search` functionality.

A few `apk list` criterion are not yet ready though, such as `apk list --depends`
which searches by runtime dependency (replacing `apk info --rdepends`).
2018-01-28 23:55:29 +00:00
William Pitcock 5da4dec2a2 apk: make --help --verbose actually work. 2018-01-09 17:07:22 +00:00
William Pitcock 182bfa0a9f apk: properly error out if an unknown command is requested 2018-01-09 17:07:22 +00:00
William Pitcock 1777040cc5 apk: commit options help text: fix typo concerning diskless boot 2018-01-09 17:07:22 +00:00
William Pitcock abf7c2838b apk: usage: cleanup help text when no applet is selected 2018-01-09 17:07:13 +00:00
Timo Teräs 118f29c895 fix --update-cache help to reflect reality
Internally the value is in seconds, but on command line it's in
minutes.
2018-01-09 10:32:03 +02:00
Timo Teräs 5f7dcadc69 auto-update index only when database is opened for writing 2018-01-08 11:56:48 +02:00
Timo Teräs d0a25d670a increase libfetch connection pool limits slightly 2018-01-04 11:08:30 +02:00
Timo Teräs 8a28c6d0d4 enable automatic update of indexes controlled by --cache-max-age
This modifies apk cache for indexes to be automatically refreshed
periodically without explicit 'update' or '--update-cache' usage.

The default is to do if-modified-since request if the local copy
is older than 4 hours. This age can be changed with --cache-max-age.
Using --update-cache will change this age to 60 seconds to make
sure the cached copy is relatively new. The small age is in order
to try to avoid downloading indexes second time when apk-tools is
upgraded and apk re-execs after self-upgrade.

Accordingly using explicitly 'apk update' will now enforce
--force-refresh and request the very latest index by requesting
any potential http proxy to do refresh too.
2018-01-04 10:56:09 +02:00
Timo Teräs 2da67940d5 url: add "Cache-Control: no-cache" header with --force-refresh
fixes #8161
2018-01-03 16:00:38 +02:00
Timo Teräs 039ff3bd46 split --force to several --force-[type] options
This unloads --force as several of the things are really not wanted
together. E.g. --force-refresh is a lot different from --force-broken-world
and doing --force to get the other might introduce unwanted behaviour.

--force is still kept for backwards compatibility and it enables
most things --force was used for.
2018-01-03 16:00:38 +02:00
Henrik Riomar e0eff8742f add new umbrella flag --initramfs-diskless-boot
This flag enables a group of options used during initramfs tmpfs
initial install.
2018-01-03 14:21:40 +02:00
Henrik Riomar 23cb104775 add new flag --no-commit-hooks
This flag skips running hook scripts

This flag *must* be used during initramfs tmpfs initial install.
The reason that this new flag is needed is that the hooks will currently
always fail as musl and /bin/sh is missing at this stage on diskless.
2018-01-03 14:20:58 +02:00
Timo Teräs b0fcc56f22 db: fix triggers to report deleted directories
This change just changes to keep deleted directory items in
the hash with ref count zero and modified flag set. Those entries
are reused when needed. The side effect is that fire_triggers()
will now see those removed direcotries and reports them. Other
enumerators of the directories hash are protected to skip removed
directories when appropriate.
2018-01-03 09:31:10 +02:00
Timo Teräs 8ee79c72b2 apk, del: fix few memory leaks
This fixes couple of valgrind reported leaks - though they are
non-important since the leak happens on "exit" only and kernel
frees it anyway.
2018-01-03 09:30:12 +02:00
Timo Teräs 667cb6bca7 commit: properly analyze packages with provides="$pkgname" 2018-01-02 15:45:21 +02:00
Nils Andreas Svee ac1681247f fix typo in MIPS byte-order apk_defines.h 2017-12-15 10:08:36 +02:00
Timo Teräs 8e7fd3e06f solver: fix potential install_if processing failure, fixes #8237
In discovery phase, there was logic to not process packages
multiple times. However, that logic failed to account the package's
depth and install_if state for the name being processed. This
caused install_if processing failure in certain topologies of the
dependency graph. Adds also a test case that should catch this
issue reliably.
2017-12-12 15:16:52 +02:00
Nils Andreas Svee 0700e8318f add detection of mips archs 2017-12-11 09:02:50 +02:00
Timo Teräs 97d8aab0c2 fetch: print additional error diagnostics in verbose mode 2017-11-28 14:25:38 +00:00
William Pitcock 20ae27c1da solver: prefer highest requirer count above installed status
This ensures a swap is emitted when replacing a virtual with
apk add.
2017-11-02 17:15:00 +00:00
William Pitcock 6aabb96c20 solver: fix dbg_printf() call in select_package() 2017-11-02 17:14:18 +00:00
William Pitcock 0a17a648db solver: only select a default if there is at least one provider with a declared provider_priority 2017-11-02 16:31:50 +00:00
William Pitcock 9165aa3894 solver: instead of tracking selected packages, score by requirer count for tiebreaking 2017-11-02 16:24:09 +00:00
William Pitcock f18c708183 solver: implement support for choosing default virtuals
By introducing a new package metadata field, `provider_priority`
(index letter `k`), we can specify default packages to satisfy a
virtual.

If a user wishes to select an alternative provider for the virtual,
a changeset swapping the default provider for the selected provider
will be generated by the dependency resolver.
2017-11-02 03:08:24 +00:00
Timo Teräs e03716ff3b solver: consider virtual provides to exclude non-provides transitively
this fixes package selection when a 'real' package exists, but would
need to be provided by another package with 'virtual provides'.

In current package database this can happen with postgresql which is
also provided by postgresql-bdr. Normally postgresql would be satisfied
by postgresql, but if any package depends on postgresql-bdr and there's
no versioned dependency on postgresql this will help apk figure out
that postgresql-bdr should be used.
2017-10-27 15:20:03 +03:00
Timo Teräs 2f3c842049 io: fix skip and splice to detect unexpected end-of-file 2017-10-12 13:35:46 +03:00
Timo Teräs 97e4d0531f db: handle default root correctly for /proc
dbopts->root may be null; use db->root instead

fixes #7162
2017-10-10 11:39:38 +03:00
Timo Teräs 86436fce2f build and use bundled libfetch natively 2017-10-05 16:59:14 +03:00
Timo Teräs 8f0938a056 package: remove package script after use (fixes #7974)
this is a regression introduced in commit 349c61c9
("add support for pre and post commit hooks")
2017-10-04 16:56:07 +03:00
Damiano Albani 806a476190 info: fix typo in help 2017-09-27 18:01:07 +03:00
Timo Teräs e6e90a6463 commit: proper singular/plural for 'error(s)' in commit message
based on github pull request #5
2017-08-23 09:03:35 +03:00
Dmitry Golovin 16336ba265 fix comparison of unsigned expression < 0 is always false
found by clang
2017-08-23 08:56:44 +03:00
Dmitry Golovin c099018e01 use labs istead of abs with long argument 2017-08-23 08:54:00 +03:00
A. Wilcox 8221be3569 index: Only rewrite arch if no error is encountered 2017-07-29 01:57:55 +00:00
A. Wilcox 13747fab83 database: include POSIX header for ST_* defines 2017-07-29 01:57:34 +00:00
Timo Teräs 677d3240a8 tar: use standard header prefix
APKs have been created with GNU tar so far, which uses the
GNU extensions for long names. In order to increase portability
support the standard header's 'prefix' portion in case
the GNU extensions are not present.
2017-06-26 14:29:29 +03:00
Timo Teräs 51ec463e9d db: fix current directory instance caching in tar extraction
Depending how the directory entries are ordered, the cached dir
instance might not have been updated correctly. This has not been
a problem as the entries have been ordered, but is now triggered
on ppc.
2017-06-26 10:59:37 +03:00
A. Wilcox 17dd532e42 database: mark error on renameat failure 2017-06-26 10:32:38 +03:00
Timo Teräs 4d9c0c39b0 io: make io vtables const struct, and add accessors for them
This reduces function pointers in heap, and unifies how the
io functions are called.
2017-06-23 10:07:44 +03:00
Timo Teräs ca9d476ba3 archive: validate reading of pax and gnu long filename extensions
Detect properly if the file stream gets an error during these
read operations.

Reported-by: Ariel Zelivansky from Twistlock
2017-06-23 10:07:44 +03:00
Timo Teräs 6b9a07d1ad archive: fix incorrect bounds checking for memory allocation
The value from tar header is unsigned int; keep it casted to
unsigned int and size_t instead of (signed) int, otherwise
the comparisons fail to do their job properly. Additionally check
entry.size against SSIZE_MAX so the rounding up later on is
guaranteed to not overflow.

Fixes CVE-2017-9669 and CVE-2017-9671.
Reported-by: Ariel Zelivansky from Twistlock
2017-06-23 10:07:44 +03:00
William Pitcock 5d439c4739 Revert "version: consider pkg-rX and pkg to be the same version"
This reverts commit ee5ce7284a.
2017-06-23 06:59:13 +00:00
William Pitcock 17f8c2edec print: oh dear, i have reworked the progress bar again
- rework the progress bar a little bit, basically removing the [ and ] to give a more
  modern aesthetic.

- if utf-8 locale is enabled, use unicode codepoint 0x2588 instead of # to give the
  progress bar a nicer look.

- if APK_PROGRESS_CHAR environment variable is defined, use the character defined there
  for the progress bar.
2017-06-01 05:25:56 +00:00
William Pitcock 40aee5f1d0 apk_defines: implement mulmod() 2017-06-01 04:24:15 +00:00
William Pitcock 9325eb721d index: fix unsatisfied dependencies warning (maybe vs may be) 2017-05-28 05:41:36 +00:00
William Pitcock 3eb0a0aaa4 manifest: fix up help entry 2017-05-28 01:09:42 +00:00
William Pitcock 693b4bcdb0 version: add support for fuzzy version matching
This is useful for requirements such as: python3=~3.6, which would match python3-3.6.[0-9].
This implementation should in theory be backwards compatible with the implementation in Adelie.
2017-05-27 21:49:53 +00:00
A. Wilcox ee5ce7284a version: consider pkg-rX and pkg to be the same version 2017-05-27 21:34:05 +00:00
William Pitcock 18f7aa9e44 manifest: add file support as well as apkdb support 2017-05-27 21:19:41 +00:00
William Pitcock 46c2693468 manifest: dump checksum type too 2017-05-27 20:55:31 +00:00
Timo Teräs ede5165833 db: fix regression preventing remounting apk cache r/w
Introduced in commit c0f2d88f34.
fstatfs is needed to inspect the mount flags.
2017-05-25 18:06:27 +03:00
William Pitcock b4b95e9ae7 manifest: new applet which dumps checksums in sha1sum format for a package 2017-05-20 06:19:00 +00:00
Kaarle Ritvanen c072c18d6e close database on SIGINT
cleans up procfs mount
2017-04-28 16:19:01 +03:00
Kaarle Ritvanen 5c349335c7 db: separate init from open 2017-04-28 13:28:32 +03:00
William Pitcock ba7b50c0f8 solver: don't clobber package swaps in cases where an installed package is being replaced by a provider 2017-04-27 23:23:47 +00:00
Timo Teräs 027df02dc2 print: handle mixing stdout and stderr printing
Fixes regression from commit 5ba27c90 which caused stdio
buffering issues now that output is split to stderr/stdout.

See also commit 51737872 for some of the history.

Fixes #7107
2017-04-26 09:34:32 +03:00
readerreader f3a4272a02 fetch: spell "its" properly in user visible message 2017-04-25 08:07:32 +03:00
William Pitcock 9fb2568aa7 fetch: open the installed database to allow fetching a dependency tree rooted by a virtual 2017-04-25 00:26:36 +00:00
William Pitcock e7f8d71d2b fetch: don't segfault when given an unknown package name 2017-04-25 00:00:19 +00:00
William Pitcock a841d6b259 print: don't shadow log() 2017-04-24 23:53:26 +00:00
Shiz 5ba27c9000 print: print warnings and errors to stderr 2017-04-24 22:42:29 +00:00
Avi Halachmi (:avih) 515f31eb52 progress: shorten bar to prevent newlines on some terminals
On some (probably buggy) terminals, printing up to the rightmost column
may end up with the terminal issueing a newline (probably due to putting
the cursor at the next char -> new line).

Some other progress bars avoid it by not reaching the rightmost column.

Shorten the bar width from term-width - 7 to -8 (the 7 are "xxx% []").
2017-03-29 08:14:39 +03:00
Natanael Copa bcb4b06ff8 db: catch asprintf failure 2017-03-13 14:55:36 +01:00
Natanael Copa 93d6b2b529 db: prevent umount /proc when it was mounted by someone else
This fixes regression introduced by commit 72b878e655
2017-03-13 14:55:36 +01:00
Natanael Copa 17ba5dc11c commit: include limits.h for PATH_MAX
this fixes build on ppc64le
2017-03-06 17:38:32 +01:00
Timo Teräs 697c50524a package: add more secure signature methods 2017-02-28 10:47:15 +02:00
Timo Teräs 0fe3f3964b fetch: fix --recursive mode to work with pure virtual packages
The virtual package provider still needs to be explicitly
given on command line.
2017-02-27 14:56:57 +02:00
Timo Teräs 6542d4ca2c db: allow overriding cache location 2017-02-27 11:14:33 +02:00
Timo Teräs c0f2d88f34 db: allow caching packages on tmpfs
fixes #5616

The original intention was not use unnecessary space on tmpfs
e.g. if the cache directory is a mount point, but accidentally
left unmounted. But there are valid cases when packages are
intentionally wanted to be cached on tmpfs. If caching is not
desired, the user can just remove the cache directory.
2017-02-27 11:05:01 +02:00
Timo Teräs 704694bd1d commit: fix to work if commit_hook.d directory does not exist 2017-02-27 10:54:28 +02:00
Timo Teräs 72b878e655 db: mount /proc for --root if it's not mounted, use mount syscall
musl c-library does not work properly without /proc, and potentially
running the scripts need this.
2017-02-27 10:52:16 +02:00
Henrik Riomar faff904740 commit: log parameter passed to a hook script 2017-02-16 10:10:30 +02:00
Henrik Riomar 349c61c961 add support for pre and post commit hooks
This allows for instance integration of etckeeper

[TT: Reorganized code a bit, and modified to use single
directory commit_hooks.d with argument for script of stage.]
2017-02-15 13:44:04 +02:00
Breno Leitao 28a9dcda56 Add ppc64le entry in apk defines.
Currently apk only knows about powerpc and ppc64. I am adding support for ppc64le.
ppc64le is the based on the ABI v2, which defines the endianess as little,
while ppc64 is based on the first 64-bits ABI.
2017-01-17 08:39:06 +02:00
Timo Teräs ca368916e0 tar: return correct error for short read of tar archive 2017-01-05 16:18:39 +02:00
Tuan M. Hoang ce72c8498e add s390x headers 2016-11-21 09:43:37 +02:00
Timo Teräs 0545fa0d35 pkg: reset umask for package scripts
It is unreasonable to assume that all package writers would except
to reset umask themselves. It's done currently in most packages,
but we had first issue of this kind recently, so better just reset
umask.
2016-08-23 14:21:16 +03:00
Timo Teräs ac0a9659d1 upgrade: improve self upgrade functionality a bit
trigger it only if apk-tools can be upgrade, add test cases
2016-07-22 11:13:33 +03:00
Timo Teräs 22434a5ff0 lua: remove unused reg_apk_db_meta_methods 2016-07-22 10:11:04 +03:00
Timo Teräs 06ae5fdfdc detect aarch64 architecture and assign default name for it 2016-07-08 11:10:32 +03:00
Timo Teräs 5723afded3 fix cross-compiling to pick right libfetch.a 2016-07-06 14:19:08 +03:00
Natanael Copa bb622dc9b0 info: add support for --license
print license with the --license option.
2016-06-13 10:02:08 +00:00
Natanael Copa 98a13624a1 build: allow override compiler/linker flags for external libs
Make it possible to individually override openssl, zlib and libfetch
cflags and linker flags. This makes it possible to build apk-tools
without having pkg-config installed.
2016-06-13 09:32:02 +00:00
Timo Teräs 5906aef695 fix info --who-owns to work with relative filenames
fixes #5656
2016-05-31 16:58:05 +03:00
Timo Teräs 6807de43da index: don't return error if --index does not exists
it's only used to speed up things, and having it non-existant
is not a fatal error - all included things in index will be
passed in command line anyway
2016-05-27 12:21:14 +03:00
Timo Teräs f9b4fb469b apk: don't exit with error code for -V and --print-arch 2016-04-19 08:55:58 +03:00
Timo Teräs 9039dbe06c blob: fix sign extension in test_bit 2016-04-03 16:06:57 +03:00
Timo Teräs a2a5cd9c69 fetch: allow enabling --simulate 2016-02-16 15:59:55 +02:00
Timo Teräs 445ea07220 implement fetch --purge
which will delete any .apk package on output directory that were
not downloaded by fetch

this allows apk fetch to incrementally build repositories for
binary images
2016-02-16 15:19:52 +02:00
Timo Teräs 9c736d01d9 archive: fix long symlink target names
don't overwrite the link_target if it was found from pax header.
ref #5076
2016-02-09 16:55:06 +02:00
Timo Teräs 2a066169bd commit: self-conflict error and satisfies printing
- self-conflicts when the exact same version of a name is provided
  twice is now properly detected and diagnozed
- don't print redundant satisfies diagnostic
2015-12-10 14:30:57 +02:00
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 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 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 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 5ecc97e724 add simple stats applet 2015-06-12 11:20:01 +03:00