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

Add File & Directory skipping #61

Merged
merged 12 commits into from
Jun 8, 2024

Conversation

Twinki14
Copy link

@Twinki14 Twinki14 commented May 27, 2024

Motivations

Sometimes there's files or directories that could be skipped during linking to overall speed up the process or give us an overall cleaner result. Recently such circumstances have included files suffixed with .mohidden or directories named .git

#60 is an example of an attempt at solving a specific example, but having such hardcoded values goes against what usvfs is

So a better solution is ideal

Modifications

  • Add two different lists with proper write & clear access functions that act very nearly identical to the existing executable blacklist, skipFileSuffix and skipDirectories.
  • skipFileSuffix are suffixes that are compared to the filename during file linking, and if the ending of the filename matches one of the intended to-skip file suffixes, the file will be skipped
  • skipDirectory acts similarly, but instead of a suffix the entire directory name is tested and compared

# Motivations

# Modifications
-
- Update BOOST_PATH for the correct boost version
- Add .clang-format
@Twinki14
Copy link
Author

I'm still piecing together a PR for mod organizer that utilizes the newly added exposed functions, so this will stay as a draft in the meantime

@Twinki14 Twinki14 changed the title WIP: Add File & Directory skipping Add File & Directory skipping May 27, 2024
@Twinki14 Twinki14 marked this pull request as ready for review May 27, 2024 16:21
@Twinki14
Copy link
Author

Now ready for review

Twinki14 added a commit to Twinki14/modorganizer that referenced this pull request May 27, 2024
# Motivations
ModOrganizer2/usvfs#61 Highlights some reasons why the ability to skip files & directories would be beneficial

# Modifications
- Add two new settings, `skip_file_suffixes` and `skip_directories`
- Wire the two new settings up to usvfs
- Add two new buttons to the `Workarounds` dialog, one to adjust Skip File Suffixes and another for Skip Directories, both buttons act nearly identical to the Executable Blacklist button
- Add a new grouping in the `Workarounds` dialog box that contains the usvfs buttons to keep the dialog a tad organized

# Results
include/usvfs.h Outdated Show resolved Hide resolved
.clang-format Outdated Show resolved Hide resolved
include/usvfs.h Outdated Show resolved Hide resolved
src/usvfs_dll/hookcontext.cpp Outdated Show resolved Hide resolved
src/usvfs_dll/sharedparameters.cpp Outdated Show resolved Hide resolved
src/usvfs_dll/sharedparameters.cpp Outdated Show resolved Hide resolved
src/usvfs_dll/sharedparameters.cpp Outdated Show resolved Hide resolved
src/usvfs_dll/sharedparameters.cpp Outdated Show resolved Hide resolved
src/usvfs_dll/usvfs.cpp Outdated Show resolved Hide resolved
src/usvfs_dll/usvfs.cpp Outdated Show resolved Hide resolved
@Twinki14
Copy link
Author

Updated, all requested changes have been addressed

@Twinki14 Twinki14 requested a review from Holt59 May 27, 2024 19:20
Copy link
Member

@Holt59 Holt59 left a comment

Choose a reason for hiding this comment

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

Looks good to me, I'll wait a bit for @Silarn or @Al12rs review before merging.

src/usvfs_dll/usvfs.cpp Outdated Show resolved Hide resolved
@Twinki14 Twinki14 marked this pull request as draft May 28, 2024 20:23
@Twinki14 Twinki14 requested review from Al12rs and Holt59 June 1, 2024 23:07
@Twinki14 Twinki14 marked this pull request as ready for review June 1, 2024 23:07
@Twinki14
Copy link
Author

Twinki14 commented Jun 1, 2024

PR is ready for review again

I've removed fileShould.. functions and replaced them to simply return the list entirely of file suffixes / file directories and moved the logic to check the fileName against those lists inside the Virtual Linking functions.

Copy link
Member

@Al12rs Al12rs left a comment

Choose a reason for hiding this comment

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

Seems good, I reviewed from phone though.
Have you been able to test and verify things are being skipped correctly?

include/usvfs.h Show resolved Hide resolved
@Twinki14 Twinki14 requested a review from Al12rs June 3, 2024 22:22
@Holt59 Holt59 merged commit beab783 into ModOrganizer2:master Jun 8, 2024
9 checks passed
@Twinki14 Twinki14 deleted the file-dir-skipping branch June 11, 2024 18:53
Holt59 pushed a commit to ModOrganizer2/modorganizer that referenced this pull request Jun 15, 2024
* Use new Skip File & Skip Directory in usvfs.

# Motivations
ModOrganizer2/usvfs#61 Highlights some reasons why the ability to skip files & directories would be beneficial

# Modifications
- Add two new settings, `skip_file_suffixes` and `skip_directories`
- Wire the two new settings up to usvfs
- Add two new buttons to the `Workarounds` dialog, one to adjust Skip File Suffixes and another for Skip Directories, both buttons act nearly identical to the Executable Blacklist button
- Add a new grouping in the `Workarounds` dialog box that contains the usvfs buttons to keep the dialog a tad organized
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