Mail archive
alpine-devel

Re: [alpine-devel] [PATCH 1/8] add logging infrastructure

From: Natanael Copa <ncopa_at_alpinelinux.org>
Date: Fri, 28 Jun 2013 16:03:54 +0200

On Fri, 28 Jun 2013 13:35:31 +0300
Timo Teras <timo.teras_at_iki.fi> wrote:

> On Thu, 27 Jun 2013 18:35:42 -0400
> Dubiousjim <dubiousjim_at_gmail.com> wrote:
>
> > src/apk.c | 4 ++++
> > src/apk_database.h | 2 +-
> > src/apk_defines.h | 1 +
> > src/apk_print.h | 12 ++++++++----
> > src/database.c | 17 +++++++++++++++++
> > src/print.c | 36 ++++++++++++++++++++++++++++++------
> > 6 files changed, 61 insertions(+), 11 deletions(-)
>
> I do like the feature here, but not the implementation as-is.

Nice indeed. I have also thought about a log-to-logfile feature so you
have a history of what and when things were installed.

> > diff --git a/src/apk.c b/src/apk.c
> > index c3709e7..4bac0ba 100644
> > --- a/src/apk.c
> > +++ b/src/apk.c
> > _at_@ -46,6 +46,7 @@ static struct apk_option generic_options[] = {
> > required_argument, "DIR" },
> > { 'X', "repository", "Use packages from REPO",
> > required_argument, "REPO" },
> > + { 0x113, "no-log", "Don't write to log" },
> > { 0x101, "progress", "Show a progress bar" },
> > { 0x10f, "progress-fd", "Write progress to fd",
>
> This might have non-wanted implications on the tmpfs initramfs
> bootstrap.
>
> I've been thinking that we need some flag for apk to indicate that it's
> the tmpfs initial initramfs call to get proper defaults for flags like
> these.

I am generally against apk trying to be smart but one option is to
check if --root is specified and if destination directory is a tmpfs.

maybe add a --bootstrap option which would correspond to:
 --overlay-from-stdin
 --no-network
 --clean-protected
 --initdb

I suppose the challenge here is that many of the options are
conditional. For example, if there are no apkovl, there should be no
--overlay-from-stdin (an be worked around with /dev/null tricks) and if
there are PXE network repos we replace the --no-network with
--update-cache.

The --clean-protected is currently also optional with the boot option "keep_apk_new"


> Also wondering if we need to support flags specially in the options
> handling and always have both "foo" and "no-foo" long options.


-nc


---
Unsubscribe:  alpine-devel+unsubscribe_at_lists.alpinelinux.org
Help:         alpine-devel+help_at_lists.alpinelinux.org
---
Received on Fri Jun 28 2013 - 16:03:54 UTC