Bug 1395680 - `pkcon -c -1 ...` does not refresh cache, nor does `pkcon -c 0 ...`
Summary: `pkcon -c -1 ...` does not refresh cache, nor does `pkcon -c 0 ...`
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: PackageKit
Version: 26
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard Hughes
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-11-16 12:28 UTC by Alan Jenkins
Modified: 2018-05-29 11:31 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-05-29 11:31:57 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Alan Jenkins 2016-11-16 12:28:12 UTC
Description of problem:

Several times I have seen `pkcon -c -1` suggested as a way to insist that the cache be refreshed.  E.g. https://bugzilla.redhat.com/show_bug.cgi?id=1306992#c10

Also this would be one valid interpretation of

1. the manpage text

       -c, --cache-age AGE
           Set the maximum acceptable age for cached metadata, in seconds. Use -1 for 'never'.

2. the fact that the "special" value of `0` does *not* force the cache to be refreshed either


Version-Release number of selected component (if applicable):
PackageKit-1.1.3-2.fc24.x86_64

How reproducible: has been bugging me for a while now; I don't remember seeing it work the last few times I tried it.


Steps to Reproduce:
1. use wireshark to look at outgoing packets I guess
2. pkcon -c -1 install <not-installed-package>  # don't hit "y" 

Actual results:

no metadata is re-feteched

Expected results:

there should be some value for the `-c` option which forces the freshness of metadata to be re-checked against the package servers.  I assume this special value was intended to be `-1`; perhaps it was chosen after users tried `0` and found it was not interpreted naturally.

Additional info:

Documentation should probably be more explicit, e.g. expand 'never' to 'never refresh the cache' if that was intended.  `pkcon -c 0` is an *undocumented* special case - the only valid interpretation of the documentation is "refresh always, because cache is never less than 0 seconds old".

`pkcon -c 1` appears to work as expected (effectively forcing a refresh, because cache isn't less than 1 second old).
  
pkcon is probably not used in scripts.  IMO it _could_ be acceptable to fix pkcon by making `-c 0` behave naturally as above and `-c -1` mean "never refresh the cache".  This assumes that "never refresh the cache" is a useful option.  (offline operation?)

`pkcon refresh force` should *reject* the -c option.  Currently the `force` appears to be overriding the `-c -1`.

Comment 1 Fedora End Of Life 2017-07-25 23:54:11 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2018-05-03 08:20:03 UTC
This message is a reminder that Fedora 26 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 26. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '26'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 26 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 3 Fedora End Of Life 2018-05-29 11:31:57 UTC
Fedora 26 changed to end-of-life (EOL) status on 2018-05-29. Fedora 26
is no longer maintained, which means that it will not receive any
further security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.