Commit Graph

877 Commits (531fea4c9082d6542c776dcb6d4ca0a3949ecdd0)

Author SHA1 Message Date
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