Commit Graph

18 Commits (cute-signatures)

Author SHA1 Message Date
Timo Teräs a662047e2c print: improve indented printing api
- make sure all commit errors go to stderr
- make it a bit more api like
2021-12-27 14:34:01 +02:00
Timo Teräs aca77e8410 Use __attribute__ ((format)) where possible and fix issues found by it 2021-07-26 10:25:23 +03:00
Timo Teräs 1456296b43 add adbgen applet to generate databases from it's text dump 2021-06-02 22:35:58 +03:00
Drew DeVault 646c834492 Log to /var/log/apk.log
This adds a log file at /var/log/apk.log. On each run, apk's version
information and the current date & time are written to this file,
followed by any normal apk output.
2021-03-19 12:26:15 +00:00
Timo Teräs 354713d2f7 rename apk_db_options to apk_ctx, rework logging
makes apk_verbosity non-global

fixes #10682
2020-10-09 16:09:19 +03:00
Timo Teräs 7a7eca8670 make apk_flags non-global, make progress printing state non-global
ref #10682
2020-10-09 16:09:19 +03:00
Timo Teräs 6cedfe27ac db: mask password component of printed URLs
fixes #10710
2020-10-05 12:58:46 +03:00
TBK 5d796b5678 use SPDX-License-Identifier in source files 2020-05-07 10:45:42 +03:00
Sören Tempel a6039e38a4 Humanize size output of `apk info`
This commits adds a function for receiving the closet byte unit and the
size in that unit for a given size_t. The function doesn't return a
string since dynamic memory allocation (or a static buffer) would be
required to implement this properly.

Discussion: It might be useful to add a command line flag for disabling
this behaviour in order to retain compatibility with the previous apk
info output format.
2020-01-05 23:26:50 +02:00
Shiz 5ba27c9000 print: print warnings and errors to stderr 2017-04-24 22:42:29 +00:00
Natanael Copa adc5b0b161 print: move progress bar update logic to apk_print_progress
- let the apk_print functions deal with the forced print itself. We
  avoid that the callbacks need to deal with the force flag. We can
  also get rid of the APK_PRINT_PROGRESS_* defines.

- let the reader of --progress-fd decide how often things are updated
  rather than having a fixed granularity off 1/100 (percent)

- avoid detect screen size and percent/bar calculations in case the
  --no-progress was given

- track satistics for both the ascii bar and percent info and update bar
  only if either percent or bar changes. This makes the bar go smoother
  when width is wider than 100 chars and it makes the percent counter
  go smooth when screen width is less thann 100 chars. It also
  simplifies the callbacks as they no longer need to deal with update
  granularity.
2013-06-19 10:00:31 +00:00
Timo Teräs 0a13141889 print: move progress printing to common functions 2013-06-17 16:47:49 +03:00
Timo Teräs e51232e710 errors: rewrite the logic how errors are reported
Instead of the dependency oriented logic, switch to print them
for each package or name needed. Might give a bit more readable
errors now. There's still few corner cases that proper error is
not output, which are cought by the test cases.
2013-06-13 18:22:00 +03:00
Timo Teräs 1817b0a3c3 all: update copyright year statement 2011-09-13 11:53:01 +03:00
Timo Teräs bfd53b59d2 print: minor cleanup to indented writer 2011-09-09 20:06:10 +03:00
Timo Teräs 6b24f3c399 apk: improve indented printing
* fixup the help messages to align up properly
 * refresh screen width on SIGWINCH
2011-07-22 12:08:35 +03:00
Natanael Copa 11925542d8 print: clean up after copy-paste 2010-06-11 07:09:25 +00:00
Natanael Copa 3ec82a5a42 First steps for libapk 2010-06-11 07:02:18 +00:00