[Yum-devel] [PATCH] Add "Dep-Install" as a state to history.

Seth Vidal skvidal at fedoraproject.org
Mon Oct 12 13:50:47 UTC 2009



On Mon, 12 Oct 2009, James Antill wrote:

> This is mostly an output tweak for "yum history info", however we now
> don't manually install a Dep-Install on redo.
>   This means yumdb.reason is correct, and is probably what the user
>  wants the majority of the time.
> ---
> output.py       |    2 ++
> yum/__init__.py |    4 +++-
> yum/history.py  |    3 +++
> 3 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/output.py b/output.py
> index d0b9f7f..da84221 100755
> --- a/output.py
> +++ b/output.py
> @@ -1181,6 +1181,8 @@ to exit.
>             st = hpkg.state
>             if st == 'True-Install':
>                 st = 'Install'
> +            if st == 'Dep-Install': # Mask these at the higher levels
> +                st = 'Install'
>             if st == 'Obsoleted': #  This is just a UI tweak, as we can't have
>                                   # just one but we need to count them all.
>                 st = 'Obsoleting'
> diff --git a/yum/__init__.py b/yum/__init__.py
> index daa437f..2496f8f 100644
> --- a/yum/__init__.py
> +++ b/yum/__init__.py
> @@ -3610,6 +3610,8 @@ class YumBase(depsolve.Depsolve):
>         """ Given a valid historical transaction object, try and repeat
>             that transaction. """
>         # NOTE: This is somewhat basic atm. ... see comment in undo.
> +        #  Also note that redo doesn't force install Dep-Install packages,
> +        # which is probably want is wanted the majority of the time.


maybe fix this comment to be 'what is wanted'.


>         old_conf_obs = self.conf.obsoletes
>         self.conf.obsoletes = False
>         done = False
> @@ -3670,7 +3672,7 @@ class YumBase(depsolve.Depsolve):
>                 if self.remove(pkgtup=pkg.pkgtup):
>                     done = True
>         for pkg in transaction.trans_data:
> -            if pkg.state in ('Install', 'True-Install'):
> +            if pkg.state in ('Dep-Install', 'Install', 'True-Install'):
>                 if self.remove(pkgtup=pkg.pkgtup):
>                     done = True
>         for pkg in transaction.trans_data:
> diff --git a/yum/history.py b/yum/history.py
> index 644c2fc..97571c5 100644
> --- a/yum/history.py
> +++ b/yum/history.py
> @@ -47,6 +47,7 @@ _sttxt2stcode = {'Update' : TS_UPDATE,
>                  'Erase' : TS_ERASE,
>                  'Install' : TS_INSTALL,
>                  'True-Install' : TS_TRUEINSTALL,
> +                 'Dep-Install' : TS_INSTALL,
>                  'Reinstall' : TS_INSTALL, # Broken
>                  'Downgrade' : TS_INSTALL, # Broken
>                  'Downgraded' : TS_INSTALL, # Broken
> @@ -292,6 +293,8 @@ class YumHistory:
>                 state = 'Downgraded'
>         if state is None:
>             state = _stcode2sttxt.get(txmbr.output_state)
> +            if state == 'Install' and txmbr.isDep:
> +                state = 'Dep-Install'
>         return state
>
>     def trans_with_pid(self, pid):
> -- 
> 1.6.2.5

otherwise:

ACK

-sv



More information about the Yum-devel mailing list