rattler-build icon indicating copy to clipboard operation
rattler-build copied to clipboard

Handle the variations of prefix's for Windows

Open wolfv opened this issue 1 year ago • 0 comments

conda-build detects a variety of different formats for prefix's in (text)-files on Windows:

    prefix_u = prefix.replace("\\", "/") if utils.on_win else prefix
    # If we've cross compiled on Windows to unix, chances are many files will refer to Windows
    # paths.
    if utils.on_win or m.config.subdir.startswith("win"):
        # TODO :: Should we also handle MSYS2 paths (/c/blah) here? Probably!
        pfx_variants = [
            prefix[0].upper() + prefix[1:],
            prefix[0].lower() + prefix[1:],
            prefix_u,
            prefix_placeholder.replace("\\", "'"),
            prefix_placeholder.replace("/", "\\"),
        ]
        # some python/json files store an escaped version of prefix
        pfx_variants.extend([pfx.replace("\\", "\\\\") for pfx in pfx_variants])
    else:
        pfx_variants = (prefix, prefix_placeholder)

We currently only detect backward and forward slash variants.

wolfv avatar Feb 23 '24 12:02 wolfv