Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xbps-install: remove obsolete packages during update #162

Open
wants to merge 22 commits into
base: master
Choose a base branch
from

Conversation

Chocimier
Copy link
Member

This is proof of concept phase of automatic removal of obsolete installed packages, with optionally installing other ones in exchange.
This is meant to solve two problems: explicit removal of packages removed from repo, like void-linux/void-packages#13423 and automatic replacing packages, like void-linux/void-packages#13379 . This PR is not meant to unindex packages to not be able to install them.

Code is based on xbps_transaction_package_replace.

Open problems:

  • providing data for xbps-install
    Hard-coded list is not good enough. The list should be included into repodata to make sure it is synchronized with available packages. There are two possible ways to do that: add into root element of index.plist new top-level a metadata key that will contain the list, or add new file in addition to index.plist and index-meta.plist.
  • source of data for xbps-rindex
    For packages to be removed, we want to completely remove templates, so there is no place to put information about what packages needs to be removed from installations. New common/successions file may be added to void-packages repository from which list in repodata will be generated.
  • virtual packages
    I need some explanation why they need to be processed differently than regular packages.
  • decide which packages to remove
    Packages turned into removed packages as per current Manual.md should be automatically removed. For other, that were removed because of e.g. not able to rebuild but otherwise were OK and were removed by dropping template (and possibly removing xbps from mirror), individual decision could be made by generally they can stay installed.
  • not creating empty transactions
    Just a detail that will be solved with return code.
  • efficiency
  • terminology: succession, retirement, obsolescence, …

Lot of tests need to be done, e.g. automatic-install copying, virtual packages, interference with updates etc.

Waiting for opinions.

@Duncaen
Copy link
Member

Duncaen commented Aug 5, 2019

One problem with repodata as source is, that its not signed. Most other metadata is at least checked against what the signed binary package provides on install/update.

@Chocimier
Copy link
Member Author

Is there a reason to not put signature of plists into repodata?

@Vaelatern
Copy link
Member

The reason we have is that signatures are made at a different time than the repodata is updated.

@Chocimier
Copy link
Member Author

Ok, but why not to leave signing packages as is and start to sign repodata (it is xbps-rindex too)?
Presence of privkey during build is considered a security risk, I guess?

Or if it is not an option, do you see some other way to publish obsoletes list?

@Vaelatern
Copy link
Member

Signing repodata would be good.

@Chocimier
Copy link
Member Author

Signing index.plist for now, but I think it will be easier to add third plist and modify reading archive than to modify iterating packages in index.plist to skip metadata.

@Chocimier
Copy link
Member Author

index.plist is signed now. There is other place (xbps_repo_fetch_remote), where signature should be verified.

@Chocimier
Copy link
Member Author

Now I only see minor things to change, like passing to xbps-rindex simpler data format than XML.

Please review.

@Chocimier
Copy link
Member Author

To sum up progress:

  • providing data for xbps-install: signed index-meta.plist
  • source of data for xbps-rindex: from text file similar to shlibs, passed with argument
  • virtual packages: not tested as I do not see use case
  • decide which packages to remove: to be done if change accepted
  • not creating empty transactions: done
  • efficiency: ok
  • terminology: chosen "outmoded"
  • tests: it works, some kyua tests written

@Chocimier Chocimier mentioned this pull request Oct 28, 2019
@Chocimier
Copy link
Member Author

Relevant if we want to change uninstalling by revbump to something predictable.
I do, but do not know how to broadcast list of packages to remove without signed repodata.

@Chocimier
Copy link
Member Author

Chocimier commented Feb 17, 2021

As discussed on irc, we should rather remove packages missing from repo without keeping list, using replaces= for replacements. Still needs signing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants