Commit Graph

1231 Commits (81782bfc150225df75b11efa4fa0ade428ae3676)

Author SHA1 Message Date
Timo Teräs 81782bfc15 apk-tools-2.12.0 2020-10-09 14:18:45 +03:00
Timo Teräs 5f66b618ef various changes to make clang not give warnings 2020-10-07 21:16:35 +03:00
Timo Teräs 90137499af apk-tools-2.12.0_rc2 2020-10-06 14:51:19 +03:00
Timo Teräs 3fae0c693f db: make the --repositories-file change more announced
Document the version when changed. And print error with similar note
if the given repositories-file cannot be read.
2020-10-06 14:27:59 +03:00
Timo Teräs 7158474f1b libfetch: keep http auth only if redirect is for the same host
fixes #10688
2020-10-06 11:24:05 +03:00
Paul Spooren dac30d5049 database: automatically create missing cache dir
On some systems the `/var/` dir is mounted in a tmpfs which is reseted
after each reboot. For that reason no post-install script can handle the
creation of the cache dir at `/var/cache/apk`.

Check on database opnening if the folder is available, if not create it.
Fixes #10715

Signed-off-by: Paul Spooren <mail@aparcar.org>
2020-10-06 10:02:21 +03:00
Timo Teräs 7c2a3657fb db: make --repositories-file relative to host root
It used to be relative to the --root specified root, but that
causes issues with relative command line filenames and is unintuitive.
Update documentation accordingly. Fixes #10702.
2020-10-05 16:49:57 +03:00
Timo Teräs 6cedfe27ac db: mask password component of printed URLs
fixes #10710
2020-10-05 12:58:46 +03:00
Timo Teräs 8a794021c4 commit: rephrase the error messages more understandable
fixes #10703
2020-10-03 13:58:30 +03:00
Timo Teräs c269e9c24d db: check cache only if some repositories are enabled 2020-10-01 14:31:41 +03:00
Timo Teräs c538509a2a Implement upgrade --prune to remove stale world dependencies 2020-09-28 17:38:07 +03:00
Ariadne Conill fa63e46a75 database: clarify the deprecation notice for checksum-less packages
Closes #10708.
2020-08-29 20:37:57 +03:00
Ariadne Conill d5dcaeb1cd update mailmap with my newer email 2020-08-29 17:31:30 +03:00
Timo Teräs fb0109fdb1 fix --repository short option to be -X as before
unintentional regression from commit edb45ae464
fixes #10707
2020-08-26 23:05:03 +03:00
Timo Teräs 2408ad4f95 build: make soname explicit and simplify and fix soname link 2020-08-25 15:35:46 +03:00
Timo Teräs f25519ec40 apk-tools-2.12.0_rc1 2020-08-25 14:50:12 +03:00
Timo Teräs e2afc7e7a9 fix, simplify and document upgrade --ignore 2020-08-24 15:26:25 +03:00
Oliver Smith f3cf824948 solver: add more dbg_printfs 2020-08-24 14:25:40 +03:00
Timo Teräs edb45ae464 enforce options definitions to bind the enum and the descriptor
This uses some macro trickery to make sure that there's one-to-one
mapping with the option index enum and the descriptor. The down
side is that enum's are generated via #define's and editors might
not pick them up for auto completion, but the benefits are more:
it's no longer possible have mismatching enum value and descriptor
index, and the amount of source code lines is less.
2020-08-24 13:35:36 +03:00
Ariadne Conill 82de29cf7b test: add test for granular upgrade 2020-07-30 11:42:17 +03:00
Ariadne Conill bef1faf1cb upgrade: allow for specified package upgrades
Fixes #10667 and #10700
2020-07-30 11:41:35 +03:00
Ariadne Conill ffcdd350d0 libfetch: implement default port for HTTPS.
If getservbyname() fails, libfetch will attempt to connect to port 0.
2020-05-29 08:00:22 +03:00
Ariadne Conill 8b63e0fcfb gitignore: add generated help.h header 2020-05-28 17:56:22 +03:00
Ariadne Conill f4c3f0ad2a database: create additional device nodes when initializing root fs
Some triggers and maintainer scripts depend on /dev/random, /dev/urandom,
/dev/zero and /dev/console.
2020-05-27 08:29:01 +03:00
Fredrik Gustafsson 4d69d123f5 fix logic to not compile lua module when it was not asked
fixes 12fdf6fc "allow building without help..."
2020-05-19 17:03:25 +03:00
Timo Teräs d0edeec8fb make the atom functions not use global state
This greatly helps with memory management on applications that
may want to daemonize and open/close database several times.

Also the lifetime and "owner" of memory for all data is now
explicitly bound to owning struct apk_database, which might
be helpful when writing language bindings. As side effect, the
interned "atoms" are unique only within what apk_database, so
comparing packages from different apk_database may not work
as expected.

Fixes #10697
2020-05-19 12:02:56 +03:00
Timo Teräs 12fdf6fc21 allow building without help when lua interpreter is not available
fixes #10696
2020-05-19 10:50:57 +03:00
Timo Teräs 5e251b21fd Merge branch 'add-riscv-arch-defines' into 'master'
define APK_DEFAULT_ARCH for riscv32 and riscv64 targets

See merge request alpine/apk-tools!26
2020-05-17 11:12:29 +00:00
Ariadne Conill 0732976dbe define APK_DEFAULT_ARCH for riscv32 and riscv64 targets 2020-05-17 00:54:51 -06:00
Timo Teräs 7b76182f39 fix apk_blob_pull_csum to always initialize apk_checksum
Fixes #10686 to not use uninitialized value in the error paths.
2020-05-07 13:28:24 +03:00
TBK 5d796b5678 use SPDX-License-Identifier in source files 2020-05-07 10:45:42 +03:00
TBK f1c6067603 add LICENSE 2020-05-07 10:45:34 +03:00
Fredrik Gustafsson 6863928677 index: add argument --no-warnings
When creating an index apk warns if a dependency is missing a provider.
However when using a multi-arch repository, it's not an error that
a certain architecture is missing a dependency because that dependency
could be in an other architecture. Since apk index doesn't know about
this, add an argument to disable that warning.

Maintainer note: rebased for new option handling, and minor stylistic
adjustments.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
2020-05-06 15:49:33 +03:00
Timo Teräs 1d7123d837 rewrite option descriptors to be single string
This reduces the number of relocations on PIE binaries, and also
reduces the executable size. Parsing of the options is slightly
sped up as only the exact matching option group parser is called.
2020-05-06 13:05:25 +03:00
Timo Teräs 791f93fcbe man pages: make more friendly for help generation
Also few minor fixups added.
2020-05-06 13:05:25 +03:00
Timo Teräs 5258b484bf add script to autogenerate help from man pages
This creates main help like:
--
usage: apk [<OPTIONS>...] COMMAND [<ARGUMENTS>...]

Package installation and removal:
  add        Add packages to WORLD and commit changes
  del        Remove packages from WORLD and commit changes

System maintenance:
  fix        Check WORLD against the system and ensure consistency
  update     Update repository indexes
  upgrade    Install upgrades available from repositories
  cache      Commands related to the management of an offline package cache

Querying package information:
  info       Give detailed information about packages or repositories
  list       List packages matching a pattern or other criteria
  dot        Generate graphviz graphs
  policy     Show repository policy for packages

Repository maintenance:
  index      Create repository index file from packages
  fetch      Download packages from global repositories to a local directory
  manifest   Show checksums of package contents
  verify     Verify package integrity and signature

Miscellaneous:
  audit      Audit directories for changes
  stats      Show statistics about repositories and installations
  version    Compare package versions or perform tests on version strings

This apk has coffee making abilities.
--

And applet specific help like:
--
usage: apk add [<OPTIONS>...] PACKAGES...

Description:
  apk add adds the requested packages to WORLD and installs (or upgrades)
  them if not already present, ensuring all dependencies are met.

Options:
  --initdb         Initialize a new package database
  -l, --latest     Disables normal heuristics for choosing which repository to install a
  -u, --upgrade    When adding packages which are already installed, upgrade them rather
  -t, --virtual NAME
                   Instead of adding the specified packages to WORLD, create a new
  --no-chown       Do not change file owner or group
--
2020-05-06 13:05:19 +03:00
Fredrik Gustafsson d61c009f7a apk: do not manage file ownership as non-root or when asked so
If apk is run as a non-root user, it's not possible to chown files.

Maintainers note: minor wording changes on commit log and man page.

Signed-off-by: Fredrik Gustafsson <fredrigu@axis.com>
2020-04-28 14:48:49 +03:00
Timo Teräs b67df9843d man pages: fix apk-del section in the main index 2020-04-24 11:47:37 +03:00
Fredrik Gustafsson 4856ddff31 man pages: format email addresses consistently
Some email addresses was underlined and some wasn't. Remove underline
from all email addresses to be consistent. The reason for chosing
no underline is that the email address isn't clickable and to be
consistent with the output from git log.
2020-04-21 11:19:06 +03:00
Rasmus Thomsen 47053ede6b build: fix includedir in pkgconfig file
We want to include via <apk/$headerfile> and not via <$headerfile>,
so we want to add an include statement for the dir the apk folder
which contains the headers is contained in.
2020-04-01 19:14:28 +03:00
Timo Teräs d6c54f9320 libfetch: fix no_proxy domain name comparision
Fix comparing of the hostname portion that matches exactly.
The no_proxy matching is pretty rudimentary though and probably
could go through a bit of additional rework.

Fixes #10681
2020-04-01 11:08:43 +03:00
Timo Teräs 845b6397ab db: fix database reading without scripts or triggers
Most notably this happens after blank database is initialized with --initdb,
but can happen also in other conditions.

The error checking changes modified behaviour if the file does not exist.
Explicitly check for ENOENT and ignore it. But the behaviour is improved
from earlier as now e.g. EPERM will be detected and reported correctly.

Fixes #10679

Fixes: 6da3e8eb15 "istream, archive, db: convert db and tar function to use istream"
2020-04-01 10:47:54 +03:00
Timo Teräs eae92bbacf libfetch: fixups to packetization socket option setting
- split the code to a helper function
- do not set sockets to corked state when putting back to
  cache so socket state is always deterministic
- cork/uncork also when sending CONNECT to a proxy, this
  can reduce a little bit the latency how fast the packet
  gets sent out
- also pair corking with uncorking in http_request to make
  it more obvious pairing
2020-03-25 08:50:44 +02:00
Alexander Wauck 09dbe46a76 libfetch: minor HTTP handling improvement
The recent TCP_CORK change missed this bit of code.  This change
should improve performance a bit when making HTTP requests by calling
http_cmd only once instead of three times.
2020-03-25 08:33:37 +02:00
Rasmus Thomsen 104c65ab92 build: add apk.pc.in 2020-03-23 13:44:42 +02:00
Timo Teräs b879d9ea59 build: inspect GitLab CI variables for version string 2020-03-23 13:41:51 +02:00
Timo Teräs 2d86411446 build: fix 'make check' for libfetch 2020-03-23 13:33:51 +02:00
Antoine Fontaine e8522411c1 lower min-width to 25 columns
Some screen size are quite small. For example, the default phosh
terminal is less than 50 character wide on Pinephone. This lowers the minimum
loading bar size to 25 characters.

For comparison, 25 character wide is just as wide as "apk add firefox
linux-lts" without the quotes.

Here's a bad picture to illustrate the result
gitlab.alpine.org/uploads/48c20f746fbf685b62b6bd73585ecbf2/pinephone-phosh.png
2020-03-21 17:41:49 +02:00
TBK a9916c2d4a fix glibc build
fixes #10677

src/apk_defines.h:152:15: error: unknown type name 'uint32_t'
 static inline uint32_t get_unaligned32(const void *ptr)
               ^~~~~~~~
2020-03-21 17:37:47 +02:00
Rasmus Thomsen 4966bc5ede build: enable building of development package
- always create .so and .a with the apk libary code
- create .pc file
- install headers and above mentioned files

Maintainers edit: merged commits, cleaned up sed script logic,
and few other minor fixes.
2020-03-16 15:36:46 +02:00