[Yum] About the log level and information messages
Aurélien Degrémont
aurelien.degremont at lelfe.net
Fri Mar 26 16:15:13 UTC 2004
It will be good you change the log system for the next version.(About
it, is your HEAD branch, a branch for yum 2.1 or 3.0 ?).
Waiting for it, this patch seems a good solution, i think.
Aurélien
David Christian a écrit :
> Attached is a simple patch that checks to see if the input is a tty (and
> that -y is off) and if so, prints out the actions yum will take. I
> think this is a reasonable short-term fix: there's no reason why yum
> should print out ask the user for an answer to "Is this ok?" from a tty
> without printing out what it is asking for advice about. The other
> solution would be to assume the -y option when the log level is 1.
>
> Note that this patch won't break cron scripts since behavior when yum is
> run without being attached to a tty is unchanged.
>
> David
>
>>> When using it, I found its messages were to verbose and annoying, so
>>> i change the debuglevel flag into yum.conf to 1.
>>> This was quite well, but i was surprise when I see some messages like
>>> this :
>>>
>>> [lelfe at syunikiss lelfe]$ sudo yum update
>>> Is this ok [y/N]:
>>>
>>> Errrr.... ? What's ok ?
>>> Of course the question concerned the packages that will be
>>> updated/installed/removed, but they were not displayed, due to the
>>> too small debug level.
>>>
>
>
> ------------------------------------------------------------------------
>
> diff -aur /usr/share/yum/clientStuff.py yum/clientStuff.py
> --- /usr/share/yum/clientStuff.py 2004-03-16 23:21:04.000000000 -0500
> +++ yum/clientStuff.py 2004-03-26 01:36:56.000000000 -0500
> @@ -551,7 +551,16 @@
> return install_list, update_list, erase_list, updatedeps_list, erasedeps_list
>
> def printactions(i_list, u_list, e_list, ud_list, ed_list, nevral):
> - log(2, _('I will do the following:'))
> +
> + #Output yum's actions on all log levels IF stdin is a TTY
> + #In that case the user is going to be expected to confirm these
> + #actions
> + if(conf.assumeyes == 0 and sys.stdin.isatty()):
> + log_level = 1
> + else:
> + log_level = 2
> +
> + log(log_level, _('I will do the following:'))
>
> for pkg in i_list:
> (name,arch) = pkg
> @@ -560,7 +569,7 @@
> pkgstring = '%s %s:%s-%s.%s' % (name, e, v, r, arch)
> else:
> pkgstring = '%s %s-%s.%s' % (name, v, r, arch)
> - log(2, _('[install: %s]') % pkgstring)
> + log(log_level, _('[install: %s]') % pkgstring)
>
> for pkg in u_list:
> (name,arch) = pkg
> @@ -569,7 +578,7 @@
> pkgstring = '%s %s:%s-%s.%s' % (name, e, v, r, arch)
> else:
> pkgstring = '%s %s-%s.%s' % (name, v, r, arch)
> - log(2, _('[update: %s]') % pkgstring)
> + log(log_level, _('[update: %s]') % pkgstring)
>
> for pkg in e_list:
> (name,arch) = pkg
> @@ -578,10 +587,10 @@
> pkgstring = '%s %s:%s-%s.%s' % (name, e, v, r, arch)
> else:
> pkgstring = '%s %s-%s.%s' % (name, v, r, arch)
> - log(2, _('[erase: %s]') % pkgstring)
> + log(log_level, _('[erase: %s]') % pkgstring)
>
> if len(ud_list) > 0:
> - log(2, _('I will install/upgrade these to satisfy the dependencies:'))
> + log(log_level, _('I will install/upgrade these to satisfy the dependencies:'))
> for pkg in ud_list:
> (name, arch) = pkg
> (e, v, r) = nevral.evr(name, arch)
> @@ -589,10 +598,10 @@
> pkgstring = '%s %s:%s-%s.%s' % (name, e, v, r, arch)
> else:
> pkgstring = '%s %s-%s.%s' % (name, v, r, arch)
> - log(2, _('[deps: %s]') % pkgstring)
> + log(log_level, _('[deps: %s]') % pkgstring)
>
> if len(ed_list) > 0:
> - log(2, _('I will erase these to satisfy the dependencies:'))
> + log(log_level, _('I will erase these to satisfy the dependencies:'))
> for pkg in ed_list:
> (name, arch) = pkg
> (e, v, r) = nevral.evr(name, arch)
> @@ -600,7 +609,7 @@
> pkgstring = '%s %s:%s-%s.%s' % (name, e, v, r, arch)
> else:
> pkgstring = '%s %s-%s.%s' % (name, v, r, arch)
> - log(2, _('[deps: %s]') % pkgstring)
> + log(log_level, _('[deps: %s]') % pkgstring)
>
> def filelogactions(i_list, u_list, e_list, ud_list, ed_list, nevral):
> i_log = _('Installed: ')
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Yum mailing list
> Yum at lists.dulug.duke.edu
> https://lists.dulug.duke.edu/mailman/listinfo/yum
More information about the Yum
mailing list