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

Handle alternatives in transaction files #452

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

Conversation

Duncaen
Copy link
Member

@Duncaen Duncaen commented Dec 27, 2021

No description provided.

@Duncaen
Copy link
Member Author

Duncaen commented Dec 27, 2021

This should resolve all issues with switching files between real and alternatives (#253).
Additionally files.plist is now loaded and added to the transaction files at the same time scripts are loaded from the binary package, instead of loading the binpkgs twice.

@lgtm-com
Copy link

lgtm-com bot commented Dec 28, 2021

This pull request fixes 1 alert when merging 121d12e into 6e3309b - view on LGTM.com

fixed alerts:

  • 1 for Time-of-check time-of-use filesystem race condition

Copy link
Member

@Chocimier Chocimier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few nits. Had not read in depth yet.

lib/transaction_files.c Outdated Show resolved Hide resolved
lib/transaction_files.c Outdated Show resolved Hide resolved
lib/transaction_files.c Show resolved Hide resolved
lib/transaction_files.c Outdated Show resolved Hide resolved
}

static xbps_dictionary_t
copy_alternatives(xbps_dictionary_t src)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it xbps_dictionary_copy_mutable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

xbps_dictionary_copy{,_mutable} does a shallow copy. This function copies each the keys and values, which are the alternative group provider arrays, which with a shallow copy would modify the pkgdb's alternative providers.

At the moment, this copy is used to "simulate" the alternative changes during the transaction, but it might make sense to rip out all alternative changes during extraction of packages and just do it once before running all the post install scripts.

lib/transaction_files.c Outdated Show resolved Hide resolved
@Duncaen Duncaen force-pushed the transaction-files-alternatives branch from 121d12e to cfa9e33 Compare July 20, 2022 13:56
@lgtm-com
Copy link

lgtm-com bot commented Jul 20, 2022

This pull request fixes 1 alert when merging cfa9e33 into 061f5cb - view on LGTM.com

fixed alerts:

  • 1 for Time-of-check time-of-use filesystem race condition

@Duncaen Duncaen force-pushed the transaction-files-alternatives branch from cfa9e33 to f8d708f Compare July 20, 2022 14:25
@lgtm-com
Copy link

lgtm-com bot commented Jul 20, 2022

This pull request fixes 1 alert when merging f8d708f into 061f5cb - view on LGTM.com

fixed alerts:

  • 1 for Time-of-check time-of-use filesystem race condition

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.

None yet

2 participants