Commit graph

16 commits

Author SHA1 Message Date
Hermès Bélusca-Maïto 53cc92613f
[WINESYNC] Support improvements for staging patches (#5898)
- Simplify patch directory usage;
- Fix the path shown in the warning message.

The staging patch path in the warning message didn't show the correct
sub-directory where the patch resides.
2023-12-18 22:21:41 +01:00
Hermès Bélusca-Maïto 32b81a9157
[WINESYNC] When initially reverting wine-staging patches, ignore whitespace.
This fixes in particular problems when reverting created new files (i.e.
they are deleted). I suspect this is due to an endline-format "expectation"
from the git apply command.
2023-12-18 22:21:40 +01:00
Hermès Bélusca-Maïto 1d92196d2a
[WINESYNC] Use the same 'winesync' author as for all the other commits the script generates.
This now correctly sets the commit author as 'winesync' (before it was
the committer's developer name) for the following types of commits:

`[WINESYNC]: revert wine-staging patchset for <MODULE_NAME>`

and

`[WINESYNC]: <MODULE_NAME> is now in sync with wine-staging <WINE_TAG>`
2023-12-18 22:21:39 +01:00
Hermès Bélusca-Maïto f8569465ce
[WINESYNC] Make the wine-staging tag optional, in which case Wine-Staging is not used. 2023-12-18 22:21:38 +01:00
Hermès Bélusca-Maïto 7f8d2d14b7
[WINESYNC] Elegantly handle empty 'files' and 'directories' lists.
Expand on Timo's commit 4b5a55516.
We may encounter cases where either the 'directories' or 'files' lists
in the .cfg YAML files are empty, and we don't want the script to throw
an exception in that case.

Furthermore, explicitly check for such empty lists when calling PyGit2
index.add_all(...) function, because if it's called on a None or empty
list, _all_ untracked files in the selected git repository get added,
which is not what we want there.
2023-12-18 22:21:37 +01:00
Hermès Bélusca-Maïto 67ca439d06
[WINESYNC] Allow using the "new" Wine-Staging patchinstall.py script.
Wine-Staging switched to staging/patchinstall.py , removing the
deprecated patches/patchinstall.sh in Feb.16, 2023 commit
c1b4af92f7
just before the v8.2 release.

In order to maintain interoperability between older and newer
Wine-Staging versions, try to run first the new script; if it fails,
fall back to the older script.
2023-12-18 22:21:36 +01:00
Hermès Bélusca-Maïto 454901ab0b
[WINESYNC] Explicitly use posix paths for git file manipulations.
Whenever using git, be it on Windows CMD, git-bash on Windows, or in
*nix systems, git appears to always use posix-like paths internally.
So, enforce them with posixpath when building/concatenating paths that
are going to be passed to pygit2 functions.

Otherwise, exceptions like the following one happens:

```
  File "./winesync.py", line 296, in revert_staged_patchset
    self.reactos_index.remove(os.path.join(self.staged_patch_dir, patch_file_name))
[... skipped ...]
OSError: index does not contain sdk\tools\winesync\setupapi_staging\0002-wine-staging-4.0-setupapi_winetest.patch at stage 0
```

(The git index actually contains the specified path, but in "posix" form
with slash-separators.)

On *nix platforms, these changes should not matter.
2023-12-18 22:21:35 +01:00
Hermès Bélusca-Maïto e638ff59d1
[WINESYNC] Fix some apparent problems with commits manipulation with pygit2. 2023-12-18 22:21:34 +01:00
Hermès Bélusca-Maïto d566273583
[WINESYNC] Minor formatting. 2023-12-18 22:21:33 +01:00
Andriy Shevchenko 2ea03b5b22
[REACTOS] Fix typos in comments (#5591)
Fixing typos in code comments enhances code readability and comprehension for developers and collaborators.
2023-08-22 16:20:29 +03:00
Timo Kreuzer 4b5a555161 [WINESYNC] Allow directories to be None 2023-08-19 23:50:52 +03:00
Mark Jansen fd00338b59
[WINESYNC] Fail gracefully when unable to delete a file 2022-04-09 01:26:30 +02:00
Jérôme Gardou 79d15a1f37 [WINESYNC] Fix for older versions of PyYAML 2021-02-04 16:37:00 +01:00
Jérôme Gardou 81c312d3e0 [WINESYNC] Properly handle the case when the file doesn't exist on ReactOS side 2021-01-05 11:03:13 +01:00
Jérôme Gardou 55d0c3cf66 [WINESYNC] Improve script
- Fix situation with added or deleted files
 - Improve getting blob IDs
 - Improve messages
2020-09-16 10:35:58 +02:00
Jérôme Gardou f149b8ce86 [TOOLS] Add a python script for syncing wine patches
This requires the pygit2 module
usage : ./winesync.py module <wine-tag> <winestaging-tag>

for instance ./winesync.py d3dx9 wine-4.1 v4.1

This requires to have a wine git checkout and a wine-staging checkout
configuration is done through yaml file named <module>.cfg specifying
the following:
 - file mappings
 - directory mappings
 - latest wine version the module is synced with
it then creates a local branch in the wine checkout, based on the given
tag, and then the staging script is ran on top of it.
Thanks to the mappings defined in the module configuration file, it then
create individual commits in the reactos git checkout with reworked
path.
In case of problem, it stops and lets you amend the latest commit and go
along with the process once this is done. (Makefile.in modified, new or
removed files, patches not cleanly applied)

Staging patches are added into the <module>_staging directory for the
ease of reverting them later. (TODO)

See previous [WINESYNC] commits to have an overview of the result
2020-02-26 18:19:18 +01:00